DGtal  1.5.beta
Display3DFactory.h
1 
17 #pragma once
18 
31 #if defined(Display3DFactory_RECURSES)
32 #error Recursive header files inclusion detected in Display3DFactory.h
33 #else // defined(Display3DFactory_RECURSES)
35 #define Display3DFactory_RECURSES
36 
37 #if !defined Display3DFactory_h
39 #define Display3DFactory_h
40 
42 // Inclusions
43 
44 #include "DGtal/helpers/StdDefs.h"
45 #include "DGtal/base/Common.h"
46 
47 #include "DGtal/io/DrawWithDisplay3DModifier.h"
48 #include "DGtal/geometry/curves/StandardDSS6Computer.h"
49 #include "DGtal/geometry/curves/Naive3DDSSComputer.h"
50 #include "DGtal/kernel/sets/DigitalSetBySTLSet.h"
51 #include "DGtal/kernel/sets/DigitalSetBySTLVector.h"
52 #include "DGtal/kernel/domains/HyperRectDomain.h"
53 #include "DGtal/topology/KhalimskySpaceND.h"
54 #include "DGtal/topology/Object.h"
55 #include "DGtal/kernel/PointVector.h"
56 #include "DGtal/geometry/curves/GridCurve.h"
57 #include "DGtal/shapes/Mesh.h"
58 #include "DGtal/geometry/tools/SphericalAccumulator.h"
59 #include "DGtal/io/colormaps/GradientColorMap.h"
60 #include "DGtal/io/colormaps/HueShadeColorMap.h"
61 #include "DGtal/io/colormaps/CColorMap.h"
62 #include "DGtal/images/ImageContainerBySTLVector.h"
63 #include "DGtal/images/ImageContainerBySTLMap.h"
64 #include "DGtal/images/ConstImageAdapter.h"
65 #include "DGtal/images/ImageAdapter.h"
66 #include "DGtal/helpers/StdDefs.h"
67 #include "DGtal/topology/CanonicSCellEmbedder.h"
68 #include "DGtal/dec/VectorField.h"
69 #include "DGtal/dec/KForm.h"
70 #include "DGtal/dec/DiscreteExteriorCalculus.h"
71 
72 #include "DGtal/kernel/sets/DigitalSetByAssociativeContainer.h"
73 
74 //
76 
77 namespace DGtal
78 {
80  // struct Display3DFactory
85  template <typename TSpace=Z3i::Space, typename TKSpace=Z3i::KSpace>
87  {
88 
90  BOOST_STATIC_CONSTANT(unsigned int, POINT_AS_BALL_RADIUS = 5);
92  BOOST_STATIC_CONSTANT(unsigned int, POINT_AS_BALL_RES = 5);
93 
94  typedef TSpace Space;
95  typedef TKSpace KSpace;
98  typedef typename Display::RealPoint RealPoint;
99  typedef typename Display::RealVector RealVector;
100 
101  // DiscreteExteriorCalculus
102  template <Dimension dimEmbedded, Dimension dimAmbient, typename TLinearAlgebraBackend, typename TInteger>
103  static
104  void
106  // DiscreteExteriorCalculus
107 
108  // KForm
109  template <typename Calculus, DGtal::Order order, DGtal::Duality duality>
110  static
111  void
112  draw(Display3D<Space, KSpace>& display, const DGtal::KForm<Calculus, order, duality>& kform, double cmap_min = 0, double cmap_max = 0);
113 
114  template <typename Calculus, DGtal::Order order, DGtal::Duality duality, typename ColorMap>
115  static
116  void
118  // KForm
119 
120  // VectorField
121  template <typename Calculus, DGtal::Duality duality>
122  static
123  void
124  draw(Display3D<Space, KSpace>& display, const DGtal::VectorField<Calculus, duality>& vector_field, const double& scale = 0.5, const double& epsilon = 1e-5, const DGtal::Color color = DGtal::Color::Black);
125  // VectorField
126 
127  // SphericalAccumulator
139  template <typename TVector>
140  static void draw( Display & display, const DGtal::SphericalAccumulator<TVector> & accumulator,
141  const DGtal::Z3i::RealVector &shift = DGtal::Z3i::RealVector(0,0,0),
142  const double radius=1.0);
143  // SphericalAccumulator
144 
145  // Mesh
151  template <typename TPoint>
152  static void drawAsFaces( Display & display, const DGtal::Mesh<TPoint> & aMesh);
153 
159  template <typename TPoint>
160  static void draw( Display & display, const DGtal::Mesh<TPoint> & aMesh);
161  // Mesh
162 
163 
164  // StandardDSS6Computer
171  template <typename TIterator, typename TInteger, int connectivity>
173 
179  template <typename TIterator, typename TInteger, int connectivity>
181 
187  template <typename TIterator, typename TInteger, int connectivity>
189 
195  template <typename TIterator, typename TInteger, int connectivity>
197  // StandardDSS6Computer
198 
199  // Naive3DDSSComputer
207  template <typename TIterator, typename TInteger, int connectivity>
209 
215  template <typename TIterator, typename TInteger, int connectivity>
217 
223  template <typename TIterator, typename TInteger, int connectivity>
225 
231  template <typename TIterator, typename TInteger, int connectivity>
233  // Naive3DDSSComputer
234 
235 
236  // DigitalSetByAssociativeContainer
243  template<typename Domain, typename Container>
245 
251  template<typename Domain, typename Container>
253 
259  template<typename Domain, typename Container>
261 
267  template<typename Domain, typename Container>
269 
275  template<typename Domain, typename Container>
277  // DigitalSetByAssociativeContainer
278 
279 
280  // DigitalSetBySTLSet
287  template<typename Domain, typename Compare>
289 
295  template<typename Domain, typename Compare>
297 
303  template<typename Domain, typename Compare>
305 
311  template<typename Domain, typename Compare>
313 
319  template<typename Domain, typename Compare>
321  // DigitalSetBySTLSet
322 
323 
324  // DigitalSetBySTLVector
331  template<typename Domain>
333 
339  template<typename Domain>
341 
347  template<typename Domain>
349 
355  template<typename Domain>
357 
363  template<typename Domain>
364  static void draw( Display & display, const DGtal::DigitalSetBySTLVector<Domain> & anObject );
365  // DigitalSetBySTLVector
366 
367 
368  // HyperRectDomain
375  template <typename SpaceDom>
376  static DGtal::DrawableWithDisplay3D * defaultStyle( std::string str, const DGtal::HyperRectDomain<SpaceDom> & anObject );
377 
383  template <typename SpaceDom>
385 
391  template <typename SpaceDom>
392  static void drawAsGrid( Display & display, const DGtal::HyperRectDomain<SpaceDom> & anObject );
393 
399  template <typename SpaceDom>
401 
407  template <typename SpaceDom>
408  static void drawAsPaving( Display & display, const DGtal::HyperRectDomain<SpaceDom> & anObject );
409 
410 
416  template <typename SpaceDom>
417  static void draw( Display & display, const DGtal::HyperRectDomain<SpaceDom> & anObject );
418 
419 
420  // HyperRectDomain
421 
422 
423  // KhalimskyCell
430  static DGtal::DrawableWithDisplay3D * defaultStyle( std::string str, const typename KSpace::Cell & anObject );
431 
437  static void draw( Display & display, const typename KSpace::Cell & anObject );
438 
453  static void drawUnorientedSurfelWithNormal( Display & display, const typename KSpace::Cell & anObject,
454  const RealVector & aNormal,
455  const bool enableDoubleFace = false);
456  // KhalimskyCell
457 
458  // SignedKhalimskyCell
465  static DGtal::DrawableWithDisplay3D * defaultStyle( std::string str, const typename KSpace::SCell & anObject );
466 
472  static void draw( Display & display, const typename KSpace::SCell & anObject );
473 
486  const typename KSpace::SCell & aSignedCell,
487  const RealVector & aNormal,
488  const bool enableDoubleFace = false);
489  // SignedKhalimskyCell
490 
491  // Object
498  template <typename TDigitalTopology, typename TDigitalSet>
500 
506  template <typename TDigitalTopology, typename TDigitalSet>
508 
514  template <typename TDigitalTopology, typename TDigitalSet>
516  // Object
517 
518 
519  // PointVector
526  template<Dimension dim, typename TComponent, typename TContainer>
528 
534  template<Dimension dim, typename TComponent, typename TContainer>
536 
542  template<Dimension dim, typename TComponent, typename TContainer>
544 
550  template<Dimension dim, typename TComponent, typename TContainer>
552 
558  template<Dimension dim, typename TComponent, typename TContainer>
560 
566  template<Dimension dim, typename TComponent1, typename TComponent2, typename TContainer1, typename TContainer2>
568  // PointVector
569 
570  // GridCurve
576  static void draw( Display & display, const DGtal::GridCurve<KSpace> & anObject );
577  // GridCurve
578 
579  // SCellsRange
585  template < typename TIterator, typename TSCell>
586  static void draw( Display & display,
588  // SCellsRange
589 
590  // PointsRange
596  template <typename TIterator>
597  static void draw( Display & display,
598  const DGtal::ConstRangeAdapter<TIterator, DGtal::functors::SCellToPoint<KSpace>, typename TKSpace::Point> & anObject );
599  // PointsRange
600 
601  // MidPointsRange
602  template <typename TIterator>
608  static void draw( Display & display,
610  typename TKSpace::Space::RealPoint> & anObject );
611  // MidPointsRange
612 
613  // ArrowsRange
619  template <typename TIterator>
620  static void draw( Display & display,
622  std::pair<typename TKSpace::Point, typename TKSpace::Vector > > & anObject );
623  // ArrowsRange
624 
625  // InnerPointsRange
631  template <typename TIterator>
632  static void draw( Display & display,
634  // InnerPointsRange
635 
636  // OuterPointsRange
642  template <typename TIterator>
643  static void draw( Display & display,
645  // OuterPointsRange
646 
647  // IncidentPointsRange
653  template <typename TIterator>
654  static void draw( Display & display,
656  std::pair<typename KSpace::Point, typename KSpace::Point > > & anObject );
657  // IncidentPointsRange
658 
665  static void
666  draw( Display & display, const DGtal::SetMode3D & anObject );
667 
674  static void
675  draw( Display & display, const DGtal::CustomStyle3D & anObject );
676 
683  static void
684  draw( Display & display, const DGtal::CustomColors3D & anObject );
685 
691  static void
692  draw( Display & display, const DGtal::ClippingPlane & anObject );
693 
694 
700  static void
701  draw( Display & display, const DGtal::TransformedPrism & aTransformedPrism);
702 
708  static void
709  draw( Display & display, const DGtal::SetName3D& aName3d );
710 
718  static void
720 
721  }; // end of struct Display3DFactory
722 
723 } // namespace DGtal
724 
726 // Includes inline functions/methods
727 
728 #include "DGtal/io/Display3DFactory.ih"
729 
730 // //
732 
733 #endif // !defined Display3DFactory_h
734 
735 #undef Display3DFactory_RECURSES
736 #endif // else defined(Display3DFactory_RECURSES)
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
static const Color Black
Definition: Color.h:413
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
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...
Space::RealPoint RealPoint
RealPoint type.
Definition: Display3D.h:101
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: KForm represents discrete kforms in the dec package.
Definition: KForm.h:66
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition: Mesh.h:92
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
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: implements an accumulator (as histograms for 1D scalars) adapted to spherical point samples.
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Aim: VectorField represents a discrete vector field in the dec package. Vector field values are attac...
Definition: VectorField.h:68
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.
PolyCalculus * calculus
DGtal is the top-level namespace which contains all DGtal functions and types.
Class for adding a Clipping plane through the Viewer3D stream. Realizes the concept CDrawableWithView...
Modifier class in a Display3D stream. Useful to choose your own style for a given class....
Factory for GPL Display3D:
BOOST_STATIC_CONSTANT(unsigned int, POINT_AS_BALL_RADIUS=5)
The ball radius (the actual radius being 1/POINT_AS_BALL_RADIUS )when used to display a 3D point.
static void draw(Display &display, const DGtal::ConstRangeAdapter< TIterator, DGtal::functors::SCellToPoint< KSpace >, typename TKSpace::Point > &anObject)
draw
static void draw(Display &display, const DGtal::TransformedPrism &aTransformedPrism)
static void drawAsPaving(Display &display, const DGtal::DigitalSetByAssociativeContainer< Domain, Container > &anObject)
drawAsPaving
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::DigitalSetBySTLVector< Domain > &anObject)
Default drawing style object.
static void draw(Display &display, const DGtal::HyperRectDomain< SpaceDom > &anObject)
draw
static void drawWithAdjacencies(Display &display, const DGtal::Object< TDigitalTopology, TDigitalSet > &anObject)
drawWithAdjacencies
static void drawAsPavingTransparent(Display &display, const DGtal::DigitalSetByAssociativeContainer< Domain, Container > &anObject)
drawAsPavingTransparent
static void draw(Display &display, const DGtal::ClippingPlane &anObject)
draw
static void drawAsFaces(Display &display, const DGtal::Mesh< TPoint > &aMesh)
drawAsFaces
static void drawAsGrid(Display &display, const DGtal::PointVector< dim, TComponent, TContainer > &anObject)
drawAsGrid
static void draw(Display &display, const DGtal::ConstRangeAdapter< TIterator, DGtal::functors::SCellToArrow< KSpace >, std::pair< typename TKSpace::Point, typename TKSpace::Vector > > &anObject)
draw
static void drawAsBoundingBox(Display &display, const DGtal::HyperRectDomain< SpaceDom > &anObject)
drawAsBoundingBox
static void draw(Display &display, const DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity > &anObject)
draw
Display3D< Space, KSpace > Display
static void drawAsBalls(Display &display, const DGtal::StandardDSS6Computer< TIterator, TInteger, connectivity > &anObject)
drawAsBalls
static void draw(Display &display, const DGtal::ConstRangeAdapter< TIterator, DGtal::functors::Identity, TSCell > &anObject)
draw
static void drawAsGrid(Display &display, const DGtal::DigitalSetBySTLVector< Domain > &anObject)
drawAsGrid
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const typename KSpace::Cell &anObject)
Display::RealVector RealVector
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::Object< TDigitalTopology, TDigitalSet > &anObject)
static void drawWithColorMap(Display3D< Space, KSpace > &display, const DGtal::KForm< Calculus, order, duality > &kform, const ColorMap &colormap)
static void drawAsPaving(Display &display, const DGtal::PointVector< dim, TComponent, TContainer > &anObject)
drawAsPaving
static void draw(Display &display, const DGtal::PointVector< dim, TComponent, TContainer > &anObject)
draw
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::PointVector< dim, TComponent, TContainer > &anObject)
static void draw(Display &display, const DGtal::ConstRangeAdapter< TIterator, DGtal::functors::SCellToIncidentPoints< KSpace >, std::pair< typename KSpace::Point, typename KSpace::Point > > &anObject)
draw
static void drawAsGrid(Display &display, const DGtal::HyperRectDomain< SpaceDom > &anObject)
drawAsGrid
static void draw(Display &display, const typename KSpace::SCell &anObject)
draw
static void drawAsPaving(Display &display, const DGtal::DigitalSetBySTLVector< Domain > &anObject)
drawAsPaving
static void draw(Display &display, const DGtal::CustomColors3D &anObject)
static void draw(Display &display, const DGtal::StandardDSS6Computer< TIterator, TInteger, connectivity > &anObject)
draw
static void draw(Display &display, const DGtal::Mesh< TPoint > &aMesh)
draw
static void drawAsPavingWired(Display &display, const DGtal::PointVector< dim, TComponent, TContainer > &anObject)
drawAsPavingWired
static void drawAsBalls(Display &display, const DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity > &anObject)
drawAsBalls
static void draw(Display3D< Space, KSpace > &display, const DGtal::DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > &calculus)
static void draw(Display &display, const DGtal::ConstRangeAdapter< TIterator, CanonicSCellEmbedder< KSpace >, typename TKSpace::Space::RealPoint > &anObject)
draw
static void drawAsPaving(Display &display, const DGtal::DigitalSetBySTLSet< Domain, Compare > &anObject)
drawAsPaving
static void drawAsPaving(Display &display, const DGtal::HyperRectDomain< SpaceDom > &anObject)
drawAsPaving
static void draw(Display &display, const DGtal::DigitalSetBySTLVector< Domain > &anObject)
draw
static void draw(Display &display, const DGtal::GridCurve< KSpace > &anObject)
draw
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const typename KSpace::SCell &anObject)
static void drawOrientedSurfelWithNormal(Display &display, const typename KSpace::SCell &aSignedCell, const RealVector &aNormal, const bool enableDoubleFace=false)
static void drawAsGrid(Display &display, const DGtal::DigitalSetBySTLSet< Domain, Compare > &anObject)
drawAsGrid
static void drawAsBoundingBox(Display &display, const DGtal::StandardDSS6Computer< TIterator, TInteger, connectivity > &anObject)
drawAsBoundingBox
static void draw(Display &display, const DGtal::SetMode3D &anObject)
static void draw(Display &display, const DGtal::ConstRangeAdapter< TIterator, DGtal::functors::SCellToOuterPoint< KSpace >, typename TKSpace::Point > &anObject)
draw
static void drawAsPavingBalls(Display &display, const DGtal::HyperRectDomain< SpaceDom > &anObject)
drawAsPavingBalls
static void draw(Display &display, const DGtal::PointVector< dim, TComponent1, TContainer1 > &, const DGtal::PointVector< dim, TComponent2, TContainer2 > &anObject)
draw
static void draw(Display3D< Space, KSpace > &display, const DGtal::KForm< Calculus, order, duality > &kform, double cmap_min=0, double cmap_max=0)
static void draw(Display &display, const DGtal::DigitalSetByAssociativeContainer< Domain, Container > &anObject)
draw
static void draw(Display &display, const DGtal::ConstRangeAdapter< TIterator, DGtal::functors::SCellToInnerPoint< KSpace >, typename TKSpace::Point > &anObject)
draw
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::StandardDSS6Computer< TIterator, TInteger, connectivity > &anObject)
Display3DFactory< Space, KSpace > Self
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::HyperRectDomain< SpaceDom > &anObject)
static void draw(Display &display, const DGtal::DigitalSetBySTLSet< Domain, Compare > &anObject)
draw
static void drawUnorientedSurfelWithNormal(Display &display, const typename KSpace::Cell &anObject, const RealVector &aNormal, const bool enableDoubleFace=false)
static void draw(Display &display, const DGtal::CustomStyle3D &anObject)
static void draw(Display &display, const DGtal::SphericalAccumulator< TVector > &accumulator, const DGtal::Z3i::RealVector &shift=DGtal::Z3i::RealVector(0, 0, 0), const double radius=1.0)
static void drawAsGrid(Display &display, const DGtal::DigitalSetByAssociativeContainer< Domain, Container > &anObject)
drawAsGrid
static void draw(Display &display, const typename KSpace::Cell &anObject)
draw
static void draw(Display3D< Space, KSpace > &display, const DGtal::VectorField< Calculus, duality > &vector_field, const double &scale=0.5, const double &epsilon=1e-5, const DGtal::Color color=DGtal::Color::Black)
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::DigitalSetBySTLSet< Domain, Compare > &anObject)
defaultStyle
static void drawAsPavingTransparent(Display &display, const DGtal::DigitalSetBySTLSet< Domain, Compare > &anObject)
drawAsPavingTransparent
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::DigitalSetByAssociativeContainer< Domain, Container > &anObject)
defaultStyle
Display::RealPoint RealPoint
static void drawAsPavingTransparent(Display &display, const DGtal::DigitalSetBySTLVector< Domain > &anObject)
drawAsPavingTransparent
static void draw(Display &display, const DGtal::Object< TDigitalTopology, TDigitalSet > &anObject)
draw
BOOST_STATIC_CONSTANT(unsigned int, POINT_AS_BALL_RES=5)
The ball resolution when used to display a point.
static DGtal::DrawableWithDisplay3D * defaultStyle(std::string str, const DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity > &anObject)
defaultStyle Default drawing style object.
static void drawAsBoundingBox(Display &display, const DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity > &anObject)
drawAsBoundingBox
static void draw(Display &display, const DGtal::SetSelectCallback3D &aFct)
static void draw(Display &display, const DGtal::SetName3D &aName3d)
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
class to modify the position and scale to construct better illustration mode.
MyPointD Point
Definition: testClone2.cpp:383
void display(ostream &out, const AContainer &C)
PointVector< 3, double > RealPoint