DGtal 1.3.0
Loading...
Searching...
No Matches
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)
35#define Display2DFactory_RECURSES
36
37#if !defined Display2DFactory_h
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
86namespace DGtal
87{
88
90// struct Display2DFactory
96 {
97 public:
98
99template <Dimension dim, typename TInteger>
100static
101void
103
104template <Dimension dim, typename TInteger>
105static
106void
108
109// DiscreteExteriorCalculus
110template <Dimension dimEmbedded, Dimension dimAmbient, typename TLinearAlgebraBackend, typename TInteger>
111static
112void
114// DiscreteExteriorCalculus
115
116// KForm
117template <typename TCalculus, DGtal::Order order, DGtal::Duality duality>
118static
119void
121
122template <typename TCalculus, DGtal::Order order, DGtal::Duality duality, typename TColorMap>
123static
124void
125drawWithColorMap(DGtal::Board2D& board, const DGtal::KForm<TCalculus, order, duality>& kform, const TColorMap& colormap);
126// KForm
127
128// VectorField
129template <typename TCalculus, DGtal::Duality duality>
130static
131void
133// VectorField
134
135// AngleLinearMinimizer
136static void draw( DGtal::Board2D & board, const DGtal::AngleLinearMinimizer & );
137// AngleLinearMinimizer
138
139// ArithmeticalDSS
140template <typename TCoordinate, typename TInteger, unsigned short adjacency>
141 static void drawAsBoundingBox( DGtal::Board2D & aBoard,
143
144template <typename TCoordinate, typename TInteger, unsigned short adjacency>
145 static void drawAsDigitalPoints( DGtal::Board2D & aBoard,
147
148template <typename TCoordinate, typename TInteger, unsigned short adjacency>
150// ArithmeticalDSS
151
152
153// ArithmeticalDSSComputer
154template <typename TIterator, typename TInteger, int connectivity>
155 static void drawAsBoundingBox( DGtal::Board2D & aBoard,
157
158template <typename TIterator, typename TInteger, int connectivity>
159 static void drawAsDigitalPoints( DGtal::Board2D & aBoard,
161
162template <typename TIterator, typename TInteger, int connectivity>
164// ArithmeticalDSSComputer
165
166
167// AlphaThickSegmentComputer
168template < typename TInputPoint, typename TConstIterator>
169static void drawAsBoundingBox( DGtal::Board2D & aBoard,
171
172template < typename TInputPoint, typename TConstIterator>
173static void drawAsDigitalPoints( DGtal::Board2D & aBoard,
175
176template < typename TInputPoint, typename TConstIterator>
177 static void draw( DGtal::Board2D & aBoard,
179// AlphaThickSegmentComputer
180
181
182// CircleFrom2Points
183template <typename TPoint>
184static void draw(Board2D & aBoard, const DGtal::CircleFrom2Points<TPoint> & );
185// CircleFrom2Points
186
187
188// CircleFrom3Points
189template <typename Point>
190static void drawArc(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true);
191
192template <typename Point>
193static void drawSector(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true);
194
195template <typename Point>
196static void drawAnnulus(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true, const double& w = 1.0);
197
198template <typename Point>
199static void draw(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true);
200
201template <typename TPoint>
202static void draw(Board2D & aBoard, const DGtal::CircleFrom3Points<TPoint> & );
203// CircleFrom3Points
204
205
206// DigitalSetBySTLSet
207template<typename Domain, typename Compare>
209// DigitalSetBySTLSet
210
211
212// DigitalSetByAssociativeContainer
213template<typename Domain, typename Container>
215// DigitalSetByAssociativeContainer
216
217
218// DigitalSetBySTLVector
219template<typename Domain>
221// DigitalSetBySTLVector
222
223
224// FP
225template <typename TIterator, typename TInteger, int connectivity>
227
228template <typename TIterator, typename TInteger, int connectivity>
230// FP
231
232
233// FreemanChain
234template <typename TInteger>
236
237template <typename TInteger>
239
240template <typename TInteger>
241static void draw( DGtal::Board2D & aBoard, const DGtal::FreemanChain<TInteger> & );
242// FreemanChain
243
244
245// StabbingLineComputer
246template <typename TConstIterator>
248// StabbingLineComputer
249
250// StabbingCircleComputer
251template <typename TConstIterator>
253// StabbingCircleComputer
254
255
256//FrechetShortcut
257template <typename TIterator, typename TInteger>
259//FrechetShortcut
260
261
262// GridCurve
263template <typename TKSpace>
264static void draw( DGtal::Board2D & aBoard,
265 const GridCurve<TKSpace> & object );
266template <typename TKSpace>
267static void drawFill( DGtal::Board2D & aBoard, const GridCurve<TKSpace> & object );
268// GridCurve
269
270// SCellsRange
271template <typename TIterator, typename TSCell>
272static void draw( DGtal::Board2D & aBoard,
274// SCellsRange
275
276// PointsRange
277template <typename TIterator, typename TKSpace>
278static void draw( DGtal::Board2D & aBoard,
279 const ConstRangeAdapter<TIterator, functors::SCellToPoint<TKSpace>, typename TKSpace::Point> & object );
280// PointsRange
281
282// MidPointsRange
283template <typename TIterator, typename TKSpace>
284static void draw( DGtal::Board2D & aBoard,
286 typename TKSpace::Space::RealPoint> & object );
287// MidPointsRange
288
289// ArrowsRange
290template <typename TIterator, typename TKSpace>
291static void draw( DGtal::Board2D & aBoard,
293 std::pair<typename TKSpace::Point, typename TKSpace::Vector > > & object );
294// ArrowsRange
295
296// InnerPointsRange
297template <typename TIterator, typename TKSpace>
298static void draw( DGtal::Board2D & aBoard,
300 typename TKSpace::Point > & object );
301// InnerPointsRange
302
303// OuterPointsRange
304template <typename TIterator, typename TKSpace>
305static void draw( DGtal::Board2D & aBoard,
307 typename TKSpace::Point > & object );
308// OuterPointsRange
309
310// IncidentPointsRange
311template <typename TIterator, typename TKSpace>
312static void draw( DGtal::Board2D & aBoard,
314 std::pair<typename TKSpace::Point, typename TKSpace::Point> > & object );
315// IncidentPointsRange
316
317// HyperRectDomain
318template<typename TSpace>
320
321template<typename TSpace>
323
324template<typename TSpace>
325static void draw( DGtal::Board2D & board, const DGtal::HyperRectDomain<TSpace> & );
326// HyperRectDomain
327
328
329// ImageContainerByHashTree
330template <typename C, typename Domain, typename Value, typename HashKey>
331static 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
339template <typename C, typename Domain, typename Value, typename HashKey>
340static 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
348template <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
357template < Dimension dim, typename TInteger >
359// KhalimskyCell
360
361// KhalimskyPreCell
362template < Dimension dim, typename TInteger >
364// KhalimskyPreCell
365
366// Object
367template <typename TDigitalTopology, typename TDigitalSet>
369
370template <typename TDigitalTopology, typename TDigitalSet>
372// Object
373
374
375// CubicalComplex
376template < typename TKSpace, typename TCellContainer >
378// CubicalComplex
379
380
381
382// PointVector
383template<Dimension dim, typename TComponent, typename TContainer>
385
386template<Dimension dim, typename TComponent, typename TContainer>
388
389template<Dimension dim, typename TComponent, typename TContainer>
391
392//arrow drawing
393template<Dimension dim, typename TComponent1, typename TComponent2, typename TContainer1, typename TContainer2>
394 static void draw( DGtal::Board2D & board,
397// PointVector
398
399
400// Preimage2D
401template <typename Shape>
402static void draw( DGtal::Board2D & aBoard, const DGtal::Preimage2D<Shape> & );
403// Preimage2D
404
405
406// SignedKhalimskyCell
407template < Dimension dim, typename TInteger >
409// SignedKhalimskyCell
410
411// SignedKhalimskyPreCell
412template < Dimension dim, typename TInteger >
414// SignedKhalimskyPreCell
415
416// StraightLineFrom2Points
417template <typename TPoint>
419// StraightLineFrom2Points
420
421
422//
423
424
425static void draw( DGtal::Board2D & board, const DGtal::CustomStyle & );
426static void draw( DGtal::Board2D & board, const DGtal::SetMode & );
427
428
435 template <typename TSpace, typename TSequence>
436 static
437 void draw( DGtal::Board2D & aBoard,
439
440
441 }; // end of struct Display2DFactory
442
443} // namespace DGtal
444
445
447// Includes inline functions/methods
448#include "DGtal/io/Display2DFactory.ih"
449
450// //
452
453#endif // !defined Display2DFactory_h
454
455#undef Display2DFactory_RECURSES
456#endif // else defined(Display2DFactory_RECURSES)
Aim: This class is devoted to the recognition of alpha thick segments as described in ....
Aim: Used to minimize the angle variation between different angles while taking into accounts min and...
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Aim: This class represents a naive (resp. standard) digital straight segment (DSS),...
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:71
Aim: Represents a circle that passes through a given point and that is thus uniquely defined by two o...
Aim: Represents a circle uniquely defined by three 2D points and that is able to return for any given...
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space....
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: A container class for storing sets of digital points within some given domain.
Aim: Realizes the concept CDigitalSet by using the STL container std::vector.
Aim: DiscreteExteriorCalculus represents a calculus in the dec package. This is the main structure in...
Aim: Computes the faithful polygon (FP) of a range of 4/8-connected 2D Points.
Definition: FP.h:293
Aim: On-line computation Computation of the longest shortcut according to the Fr├ęchet distance for a ...
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
Definition: GridCurve.h:173
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:70
Aim: KForm represents discrete kforms in the dec package.
Definition: KForm.h:66
Aim: Represents a 2D polytope, i.e. a convex polygon, in the two-dimensional digital plane....
Aim: An object (or digital object) represents a set in some digital space associated with a digital t...
Definition: Object.h:120
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
Aim: Computes the preimage of the 2D Euclidean shapes crossing a sequence of n straigth segments in O...
Definition: Preimage2D.h:94
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edg...
Aim: On-line recognition of a digital straight segment (DSS) defined as a sequence of connected grid ...
Aim: Represents a straight line uniquely defined by two 2D points and that is able to return for any ...
Aim: VectorField represents a discrete vector field in the dec package. Vector field values are attac...
Definition: VectorField.h:68
Model of CImageContainer implementing the association key<->Value using a hash tree....
Aim: transforms a signed cell into an arrow, ie. a pair point-vector.
Aim: transforms a signed cell c into a pair of points corresponding to the signed cells of greater di...
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
Aim: transforms a scell into a point.
Class for EPS, FIG or SVG drawings.
Definition: Board.h:35
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
Factory for Display2D:
static void drawImage(DGtal::Board2D &board, const Image &i, const typename Image::Value &minV, const typename Image::Value &maxV)
static void draw(DGtal::Board2D &aBoard, const ConstRangeAdapter< TIterator, CanonicSCellEmbedder< TKSpace >, typename TKSpace::Space::RealPoint > &object)
static void drawAsBoundingBox(DGtal::Board2D &aBoard, const DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator > &)
static void draw(DGtal::Board2D &aBoard, const DGtal::FrechetShortcut< TIterator, TInteger > &)
static void drawFill(DGtal::Board2D &aBoard, const GridCurve< TKSpace > &object)
static void draw(DGtal::Board2D &board, const DGtal::FP< TIterator, TInteger, connectivity > &)
static void draw(DGtal::Board2D &board, const DGtal::PointVector< dim, TComponent1, TContainer1 > &shift, const DGtal::PointVector< dim, TComponent2, TContainer2 > &basepoint)
static void drawAsPaving(DGtal::Board2D &board, const DGtal::PointVector< dim, TComponent, TContainer > &)
static void draw(DGtal::Board2D &board, const DGtal::DigitalSetBySTLVector< Domain > &)
static void draw(DGtal::Board2D &board, const DGtal::DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > &calculus)
static void draw(DGtal::Board2D &aBoard, const DGtal::Preimage2D< Shape > &)
static void drawAsGrid(DGtal::Board2D &board, const DGtal::PointVector< dim, TComponent, TContainer > &)
static void draw(DGtal::Board2D &board, const DGtal::DigitalSetByAssociativeContainer< Domain, Container > &)
static void drawDECSignedKhalimskyCell(DGtal::Board2D &board, const DGtal::SignedKhalimskyPreCell< dim, TInteger > &cell)
static void draw(DGtal::Board2D &board, const DGtal::CustomStyle &)
static void drawSector(Board2D &aBoard, const DGtal::CircleFrom3Points< Point > &, const Point &, const Point &, bool anOrientation=true)
static void draw(DGtal::Board2D &board, const DGtal::KhalimskyCell< dim, TInteger > &)
static void draw(DGtal::Board2D &board, const DGtal::HyperRectDomain< TSpace > &)
static void draw(DGtal::Board2D &aBoard, const DGtal::StabbingLineComputer< TConstIterator > &)
static void draw(DGtal::Board2D &board, const DGtal::SignedKhalimskyCell< dim, TInteger > &)
static void drawAsDigitalPoints(DGtal::Board2D &aBoard, const DGtal::ArithmeticalDSS< TCoordinate, TInteger, adjacency > &)
static void draw(DGtal::Board2D &board, const DGtal::KForm< TCalculus, order, duality > &kform)
static void draw(DGtal::Board2D &board, const DGtal::VectorField< TCalculus, duality > &vector_field)
static void drawImageHashTree(Board2D &board, const DGtal::experimental::ImageContainerByHashTree< Domain, Value, HashKey > &, const Value &, const Value &)
static void draw(DGtal::Board2D &board, const DGtal::PointVector< dim, TComponent, TContainer > &)
static void draw(DGtal::Board2D &aBoard, const ConstRangeAdapter< TIterator, functors::SCellToIncidentPoints< TKSpace >, std::pair< typename TKSpace::Point, typename TKSpace::Point > > &object)
static void draw(Board2D &aBoard, const DGtal::CircleFrom2Points< TPoint > &)
static void draw(DGtal::Board2D &aBoard, const DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator > &)
static void drawWithColorMap(DGtal::Board2D &board, const DGtal::KForm< TCalculus, order, duality > &kform, const TColorMap &colormap)
static void draw(DGtal::Board2D &board, const DGtal::ArithmeticalDSS< TCoordinate, TInteger, adjacency > &)
static void draw(DGtal::Board2D &aBoard, const ConstRangeAdapter< TIterator, functors::SCellToInnerPoint< TKSpace >, typename TKSpace::Point > &object)
static void draw(DGtal::Board2D &aBoard, const ConstRangeAdapter< TIterator, functors::SCellToArrow< TKSpace >, std::pair< typename TKSpace::Point, typename TKSpace::Vector > > &object)
static void drawAsPolygon(DGtal::Board2D &aBoard, const DGtal::FP< TIterator, TInteger, connectivity > &)
static void draw(Board2D &aBoard, const DGtal::StraightLineFrom2Points< TPoint > &)
static void draw(DGtal::Board2D &board, const DGtal::DigitalSetBySTLSet< Domain, Compare > &)
static void draw(DGtal::Board2D &board, const DGtal::Object< TDigitalTopology, TDigitalSet > &)
static void draw(DGtal::Board2D &aBoard, const ConstRangeAdapter< TIterator, functors::SCellToOuterPoint< TKSpace >, typename TKSpace::Point > &object)
static void draw(DGtal::Board2D &aBoard, const GridCurve< TKSpace > &object)
static void draw(Board2D &aBoard, const DGtal::CircleFrom3Points< TPoint > &)
static void drawAsBoundingBox(DGtal::Board2D &aBoard, const DGtal::ArithmeticalDSS< TCoordinate, TInteger, adjacency > &)
static void drawAnnulus(Board2D &aBoard, const DGtal::CircleFrom3Points< Point > &, const Point &, const Point &, bool anOrientation=true, const double &w=1.0)
static void draw(Board2D &aBoard, const DGtal::CircleFrom3Points< Point > &, const Point &, const Point &, bool anOrientation=true)
static void drawAsDigitalPoints(DGtal::Board2D &aBoard, const DGtal::ArithmeticalDSSComputer< TIterator, TInteger, connectivity > &)
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)
static void drawAsGrid(DGtal::Board2D &aBoard, const DGtal::FreemanChain< TInteger > &)
static void draw(DGtal::Board2D &board, const DGtal::ArithmeticalDSSComputer< TIterator, TInteger, connectivity > &)
static void drawAsDigitalPoints(DGtal::Board2D &aBoard, const DGtal::AlphaThickSegmentComputer< TInputPoint, TConstIterator > &)
static void draw(DGtal::Board2D &board, const DGtal::CubicalComplex< TKSpace, TCellContainer > &)
static void draw(DGtal::Board2D &aBoard, const DGtal::LatticePolytope2D< TSpace, TSequence > &cip)
static void draw(DGtal::Board2D &board, const DGtal::SetMode &)
static void drawDECSignedKhalimskyCell(DGtal::Board2D &board, const DGtal::SignedKhalimskyCell< dim, TInteger > &cell)
static void draw(DGtal::Board2D &aBoard, const ConstRangeAdapter< TIterator, functors::SCellToPoint< TKSpace >, typename TKSpace::Point > &object)
static void drawWithAdjacencies(DGtal::Board2D &aBoard, const DGtal::Object< TDigitalTopology, TDigitalSet > &)
static void draw(DGtal::Board2D &board, const DGtal::KhalimskyPreCell< dim, TInteger > &)
static void drawAsGrid(DGtal::Board2D &aboard, const DGtal::HyperRectDomain< TSpace > &)
static void draw(DGtal::Board2D &board, const DGtal::SignedKhalimskyPreCell< dim, TInteger > &)
static void draw(DGtal::Board2D &board, const DGtal::AngleLinearMinimizer &)
static void drawAsInterGrid(DGtal::Board2D &aBoard, const DGtal::FreemanChain< TInteger > &)
static void drawAsPaving(DGtal::Board2D &aboard, const DGtal::HyperRectDomain< TSpace > &)
static void drawAsBoundingBox(DGtal::Board2D &aBoard, const DGtal::ArithmeticalDSSComputer< TIterator, TInteger, connectivity > &)
static void drawArc(Board2D &aBoard, const DGtal::CircleFrom3Points< Point > &, const Point &, const Point &, bool anOrientation=true)
static void draw(DGtal::Board2D &aBoard, const DGtal::StabbingCircleComputer< TConstIterator > &)
static void draw(DGtal::Board2D &aBoard, const ConstRangeAdapter< TIterator, functors::Identity, TSCell > &object)
static void draw(DGtal::Board2D &aBoard, const DGtal::FreemanChain< TInteger > &)
Represents an (unsigned) cell in a cellular grid space by its Khalimsky coordinates.
Represents an unsigned cell in an unbounded cellular grid space by its Khalimsky coordinates.
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
Definition: Board2D.h:247
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Represents a signed cell in an unbounded cellular grid space by its Khalimsky coordinates and a boole...
MyPointD Point
Definition: testClone2.cpp:383