DGtal  0.9.2
Viewer3DFactory.h
1 
17 #pragma once
18 
31 #if defined(Viewer3DFactory_RECURSES)
32 #error Recursive header files inclusion detected in Viewer3DFactory.h
33 #else // defined(Viewer3DFactory_RECURSES)
34 
35 #define Viewer3DFactory_RECURSES
36 
37 #if !defined Viewer3DFactory_h
38 
39 #define Viewer3DFactory_h
40 
42 // Inclusions
43 
44 #include "DGtal/helpers/StdDefs.h"
45 #include "DGtal/base/Common.h"
46 
47 #include "DGtal/io/Display3DFactory.h"
48 #include "DGtal/io/viewers/DrawWithViewer3DModifier.h"
49 #include "DGtal/geometry/curves/StandardDSS6Computer.h"
50 #include "DGtal/geometry/curves/Naive3DDSSComputer.h"
51 #include "DGtal/kernel/sets/DigitalSetBySTLSet.h"
52 #include "DGtal/kernel/sets/DigitalSetBySTLVector.h"
53 #include "DGtal/kernel/sets/DigitalSetByAssociativeContainer.h"
54 #include "DGtal/kernel/domains/HyperRectDomain.h"
55 #include "DGtal/topology/KhalimskySpaceND.h"
56 #include "DGtal/topology/Object.h"
57 #include "DGtal/kernel/PointVector.h"
58 #include "DGtal/geometry/curves/GridCurve.h"
59 #include "DGtal/shapes/Mesh.h"
60 #include "DGtal/geometry/tools/SphericalAccumulator.h"
61 #include "DGtal/io/colormaps/HueShadeColorMap.h"
62 #include "DGtal/io/colormaps/CColorMap.h"
63 #include "DGtal/images/ImageContainerBySTLVector.h"
64 #include "DGtal/images/ImageContainerBySTLMap.h"
65 #include "DGtal/images/ConstImageAdapter.h"
66 #include "DGtal/images/ImageAdapter.h"
67 #include "DGtal/helpers/StdDefs.h"
69 
70 namespace DGtal
71 {
73  // struct Viewer3DFactory
78  template <typename TSpace = Z3i::Space, typename TKSpace = Z3i::KSpace>
79  struct Viewer3DFactory : public Display3DFactory<TSpace,TKSpace>
80  {
82  typedef TSpace Space;
83 
85  typedef TKSpace KSpace;
86 
92  static void
93  draw( Viewer3D<Space,KSpace> & board, const DGtal::CameraPosition & aThing );
94 
100  static void
101  draw( Viewer3D<Space,KSpace> & board, const DGtal::CameraDirection & aThing );
102 
108  static void
109  draw( Viewer3D<Space,KSpace> & board, const DGtal::CameraUpVector & aThing );
110 
116  static void
117  draw( Viewer3D<Space,KSpace> & board, const DGtal::CameraZNearFar & aThing );
118 
119  //---------------------------------------------------
120  // heritage
121  // SphericalAccumulator
133  template <typename TVector>
134  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::SphericalAccumulator<TVector> & accumulator,
135  const DGtal::Z3i::RealVector & shift = Z3i::RealVector(0,0,0),
136  const double radius=1.0);
137  // SphericalAccumulator
138 
139  // Mesh
145  template <typename TPoint>
146  static void drawAsFaces( Viewer3D<Space,KSpace> & viewer, const DGtal::Mesh<TPoint> & aMesh );
147 
153  template <typename TPoint>
154  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::Mesh<TPoint> & aMesh );
155  // Mesh
156 
157 
158 
159  // StandardDSS6Computer
166  template <typename TIterator, typename TInteger, int connectivity>
167  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::StandardDSS6Computer<TIterator,TInteger,connectivity> & arithm );
168 
174  template <typename TIterator, typename TInteger, int connectivity>
176 
182  template <typename TIterator, typename TInteger, int connectivity>
184 
190  template <typename TIterator, typename TInteger, int connectivity>
192  // StandardDSS6Computer
193 
194 
195  // naive3DDSSComputer
202  template <typename TIterator, typename TInteger, int connectivity>
203  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::Naive3DDSSComputer<TIterator,TInteger,connectivity> & arithm );
204 
210  template <typename TIterator, typename TInteger, int connectivity>
212 
218  template <typename TIterator, typename TInteger, int connectivity>
220 
226  template <typename TIterator, typename TInteger, int connectivity>
228  // Naive3DDSSComputer
229 
230 
231  // DigitalSetBySTLSet
238  template<typename Domain, typename Compare>
239  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::DigitalSetBySTLSet<Domain, Compare> & aSet );
240 
246  template<typename Domain, typename Compare>
248 
254  template<typename Domain, typename Compare>
256 
262  template<typename Domain, typename Compare>
264 
270  template<typename Domain, typename Compare>
271  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::DigitalSetBySTLSet<Domain, Compare> & aSet );
272  // DigitalSetBySTLSet
273 
274  // DigitalSetByAssociativeContainer
281  template<typename Domain, typename Container>
282  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::DigitalSetByAssociativeContainer<Domain, Container> & aSet );
283 
289  template<typename Domain, typename Container>
291 
297  template<typename Domain, typename Container>
299 
305  template<typename Domain, typename Container>
307 
313  template<typename Domain, typename Container>
315  // DigitalSetByAssociativeContainer
316 
317 
318  // DigitalSetBySTLVector
325  template<typename Domain>
326  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::DigitalSetBySTLVector<Domain> & aSet );
327 
333  template<typename Domain>
335 
341  template<typename Domain>
342  static void drawAsPaving( Viewer3D<Space,KSpace> & viewer, const DGtal::DigitalSetBySTLVector<Domain> & aSet );
343 
349  template<typename Domain>
350  static void drawAsGrid( Viewer3D<Space,KSpace> & viewer, const DGtal::DigitalSetBySTLVector<Domain> & aSet );
351 
357  template<typename Domain>
358  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::DigitalSetBySTLVector<Domain> & aSet );
359  // DigitalSetBySTLVector
360 
361 
362  // HyperRectDomain
369  template <typename SpaceDom>
370  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::HyperRectDomain<SpaceDom> & aDomain );
371 
377  template <typename SpaceDom>
378  static void drawAsBoundingBox( Viewer3D<Space,KSpace> & viewer, const DGtal::HyperRectDomain<SpaceDom> & aDomain );
379 
385  template <typename SpaceDom>
386  static void drawAsGrid( Viewer3D<Space,KSpace> & viewer, const DGtal::HyperRectDomain<SpaceDom> & aDomain );
387 
393  template <typename SpaceDom>
394  static void drawAsPavingBalls( Viewer3D<Space,KSpace> & viewer, const DGtal::HyperRectDomain<SpaceDom> & aDomain );
395 
401  template <typename SpaceDom>
402  static void drawAsPaving( Viewer3D<Space,KSpace> & viewer, const DGtal::HyperRectDomain<SpaceDom> & aDomain );
403 
409  template <typename SpaceDom>
410  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::HyperRectDomain<SpaceDom> & aDomain );
411  // HyperRectDomain
412 
413 
414  // KhalimskyCell
421  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const typename KSpace::Cell & aCell );
422 
428  static void draw( Viewer3D<Space,KSpace> & viewer, const typename KSpace::Cell & aCell );
429  // KhalimskyCell
430 
431 
432  // Object
439  template <typename TDigitalTopology, typename TDigitalSet>
440  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::Object<TDigitalTopology, TDigitalSet> & anObject );
441 
447  template <typename TDigitalTopology, typename TDigitalSet>
449 
455  template <typename TDigitalTopology, typename TDigitalSet>
456  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::Object<TDigitalTopology, TDigitalSet> & anObject );
457  // Object
458 
459 
460  // PointVector
467  template<Dimension dim, typename TComponent>
468  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const DGtal::PointVector<dim,TComponent> & aPoint );
469 
475  template<Dimension dim, typename TComponent>
476  static void drawAsGrid( Viewer3D<Space,KSpace> & viewer, const DGtal::PointVector<dim,TComponent> & aPoint );
477 
478  template<Dimension dim, typename TComponent>
484  static void drawAsPaving( Viewer3D<Space,KSpace> & viewer, const DGtal::PointVector<dim,TComponent> & aPoint );
485 
491  template<Dimension dim, typename TComponent>
492  static void drawAsPavingWired( Viewer3D<Space,KSpace> & viewer, const DGtal::PointVector<dim,TComponent> & aPoint );
493 
499  template<Dimension dim, typename TComponent>
500  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::PointVector<dim,TComponent> & aPoint );
501 
508  template<Dimension dim, typename TComponent>
509  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::PointVector<dim,TComponent> & aPoint, const DGtal::PointVector<dim,TComponent> & aPoint2 );
510  // PointVector
511 
512 
513  // SignedKhalimskyCell
520  static DGtal::DrawableWithViewer3D * defaultStyle( std::string str, const typename KSpace::SCell & aSCell );
521 
527  static void draw( Viewer3D<Space,KSpace> & viewer, const typename KSpace::SCell & aSCell );
528  // SignedKhalimskyCell
529 
530  // GridCurve
536  static void draw( Viewer3D<Space,KSpace> & viewer, const DGtal::GridCurve<KSpace> & aGrid );
537  // GridCurve
538 
539  // SCellsRange
545  template < typename TIterator, typename TSCell>
546  static void draw( DGtal::Viewer3D<Space, KSpace> & viewer,
548  // SCellsRange
549 
550  // PointsRange
556  template <typename TIterator>
557  static void draw( Viewer3D<Space,KSpace> & viewer,
558  const DGtal::ConstRangeAdapter<TIterator, functors::SCellToPoint<TKSpace>, typename TKSpace::Point> & aRangeAdapter );
559  // PointsRange
560 
561  // MidPointsRange
567  template <typename TIterator>
568  static void draw( Viewer3D<Space,KSpace> & viewer,
569  const DGtal::ConstRangeAdapter<TIterator, CanonicSCellEmbedder<TKSpace>, typename TKSpace::Space::RealPoint> & aRangeAdapter );
570  // MidPointsRange
571 
572  // ArrowsRange
578  template <typename TIterator>
579  static void draw( Viewer3D<Space, KSpace> & viewer,
580  const DGtal::ConstRangeAdapter<TIterator, functors::SCellToArrow<TKSpace>, std::pair<typename TKSpace::Point, typename TKSpace::Vector > > & aRangeAdapter );
581  // ArrowsRange
582 
583  // InnerPointsRange
589  template <typename TIterator>
590  static void draw( Viewer3D<Space,KSpace> & viewer,
591  const DGtal::ConstRangeAdapter<TIterator, functors::SCellToInnerPoint<TKSpace>, typename TKSpace::Point> & aRangeAdapter );
592  // InnerPointsRange
593 
594  // OuterPointsRange
600  template <typename TIterator>
601  static void draw( Viewer3D<Space,KSpace> & viewer,
602  const DGtal::ConstRangeAdapter<TIterator, functors::SCellToOuterPoint<TKSpace>, typename TKSpace::Point> & aRangeAdapter );
603  // OuterPointsRange
604 
605  // IncidentPointsRange
611  template <typename TIterator>
612  static void draw( Viewer3D<Space,KSpace> & viewer,
613  const DGtal::ConstRangeAdapter<TIterator, functors::SCellToIncidentPoints<TKSpace>,std::pair<typename TKSpace::Point, typename TKSpace::Point > > & aRangeAdapter );
614  // IncidentPointsRange
615 
616 
617  // ImageContainerBySTLVector (2D)
623  template <typename TValue>
625  // ImageContainerBySTLVector (2D)
626 
627  // ImageContainerBySTLMap (2D)
633  template <typename TValue>
635  // ImageContainerBySTLMap (2D)
636 
637  // ConstImageAdapter (2D)
643  template <typename TImageContainer, typename TFunctorD, typename TNewValue, typename TFunctorValue>
645  // ConstImageAdapter (2D)
646 
647  // ImageAdapter (2D)
653  template <typename TImageContainer, typename TFunctorD, typename TNewValue, typename TFunctorValue, typename TFunctorValueVm1>
654  static void draw( Viewer3D<Space,KSpace> & viewer, const ImageAdapter<TImageContainer, DGtal::Z2i::Domain, TFunctorD,
655  TNewValue, TFunctorValue, TFunctorValueVm1> & anImage );
656  // ImageAdapter (2D)
657 
658 
659  // ImageContainerBySTLVector (3D)
665  template <typename TValue>
667  // ImageContainerBySTLVector (3D)
668 
669 
670  // ImageContainerBySTLMap (3D)
676  template <typename TValue>
677  static void draw( Viewer3D<Space,KSpace> & viewer, const ImageContainerBySTLMap<DGtal::Z3i::Domain, TValue> & anImage );
678  // ImageContainerBySTLMap (3D)
679 
680  // ConstImageAdapter (3D)
686  template <typename TImageContainer, typename TFunctorD, typename TNewValue, typename TFunctorValue>
687  static void draw( Viewer3D<Space,KSpace> & viewer, const ConstImageAdapter<TImageContainer, DGtal::Z3i::Domain, TFunctorD,
688  TNewValue, TFunctorValue> & anImage );
689  // ConstImageAdapter (3D)
690 
691  // ImageAdapter (3D)
697  template <typename TImageContainer, typename TFunctorD, typename TNewValue, typename TFunctorValue, typename TFunctorValueVm1>
698  static void draw( Viewer3D<Space,KSpace> & viewer, const ImageAdapter<TImageContainer, DGtal::Z3i::Domain, TFunctorD,
699  TNewValue, TFunctorValue, TFunctorValueVm1> & anImage );
700  // ImageAdapter (3D)
701 
702 
710  template < typename TImageType2D, typename TFunctor>
711  static void
712  drawImage2D( Viewer3D<Space,KSpace> & viewer, const TImageType2D & anImage, const TFunctor & aFunctor,
713  typename Viewer3D<Space,KSpace>::TextureMode aTextureMode );
714 
722  template < typename TImageType3D, typename TFunctor>
723  static void
724  drawImage3D( Viewer3D<Space,KSpace> & viewer, const TImageType3D & anImage3D, const TFunctor & aFunctor,
725  typename Viewer3D<Space,KSpace>::TextureMode aTextureMode );
726 
732  static void
733  draw( Viewer3D<Space,KSpace> & viewer, const DGtal::SetMode3D & aMode);
734 
740  static void
741  draw( Viewer3D<Space,KSpace> & viewer, const DGtal::CustomStyle3D & aStyle);
742 
748  static void
749  draw( Viewer3D<Space,KSpace> & viewer, const DGtal::CustomColors3D & aColor);
750 
756  static void
757  draw( Viewer3D<Space,KSpace> & viewer, const DGtal::ClippingPlane & aClipping);
758 
759 
760  // AddTextureImage3DWithFunctor
766  template<typename TImageType, typename TFunctor>
767  static void
769  // AddTextureImage3DWithFunctor
770 
771  // AddTextureImage2DWithFunctor
777  template<typename TImageType, typename TFunctor>
778  static void
780  // AddTextureImage2DWithFunctor
781 
787  static void
789 
795  static void
797 
798 
804  static void
806 
812  static void
814 
820  static void
821  draw( Viewer3D<Space,KSpace> &viewer, const DGtal::Translate2DDomain & anTranslation);
822 
828  template<typename TImageType, typename TFunctor>
829  static void
831 
837  static void
838  draw( Viewer3D<Space,KSpace> & viewer, const DGtal::TransformedPrism & aTransformedPrism);
839 
845  static void
846  draw( Viewer3D<Space,KSpace> & viewer, const DGtal::SetName3D& aName3d );
847 
855  static void
856  draw( Viewer3D<Space,KSpace> & viewer, const DGtal::SetSelectCallback3D& aFct );
857 
858  // end heritage
859  //----------------------------------------------------------------------------------------------
860 
861  }; // end of struct Viewer3DFactory
862 
863 } // namespace DGtal
864 
865 
867 // Includes inline functions/methods
868 #include "DGtal/io/viewers/Viewer3DFactory.ih"
869 
870 
871 // //
873 
874 #endif // !defined Viewer3DFactory_h
875 
876 #undef Viewer3DFactory_RECURSES
877 #endif // else defined(Viewer3DFactory_RECURSES)
Aim: An object (or digital object) represents a set in some digital space associated with a digital t...
Definition: Object.h:119
CameraUpVector class to set camera up-vector.
static void drawWithAdjacencies(Viewer3D< Space, KSpace > &viewer, const DGtal::Object< TDigitalTopology, TDigitalSet > &anObject)
static void drawAsPavingWired(Viewer3D< Space, KSpace > &viewer, const DGtal::PointVector< dim, TComponent > &aPoint)
CameraZNearFar class to set near and far distance.
static DGtal::DrawableWithViewer3D * defaultStyle(std::string str, const DGtal::StandardDSS6Computer< TIterator, TInteger, connectivity > &arithm)
static void drawAsBoundingBox(Viewer3D< Space, KSpace > &viewer, const DGtal::StandardDSS6Computer< TIterator, TInteger, connectivity > &arithm)
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
static void draw(Viewer3D< Space, KSpace > &board, const DGtal::CameraPosition &aThing)
static void drawAsPaving(Viewer3D< Space, KSpace > &viewer, const DGtal::DigitalSetBySTLSet< Domain, Compare > &aSet)
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: This class is defined to represent a surface mesh through a set of vertices and faces...
Definition: Mesh.h:91
class to modify the position and orientation of an textured 2D image.
CameraDirection class to set camera direction.
Factory for GPL Display3D:
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
Modifier class in a Display3D stream. Useful to choose your own style for a given class...
Aim: transforms a signed cell into an arrow, ie. a pair point-vector.
TSpace Space
Space type.
Factory for GPL Viewer3D:
Aim: transforms a scell into a point.
Aim: implements an image adapter with a given domain (i.e. a subdomain) and 3 functors : g for domain...
Definition: ImageAdapter.h:109
static void drawAsPavingTransparent(Viewer3D< Space, KSpace > &viewer, const DGtal::DigitalSetBySTLSet< Domain, Compare > &aSet)
TKSpace KSpace
KSpace type.
CameraPosition class to set camera position.
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
class to insert a custom 3D textured image by using a conversion functor and allows to change the def...
class to modify the position and orientation of an textured 2D image.
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...
static void drawAsFaces(Viewer3D< Space, KSpace > &viewer, const DGtal::Mesh< TPoint > &aMesh)
Aim: implements an accumulator (as histograms for 1D scalars) adapted to spherical point samples...
class to modify the data of an given image and also the possibility to translate it (optional)...
class to modify the 3d embedding of the image (useful to display not only 2D slice images)...
static void drawImage3D(Viewer3D< Space, KSpace > &viewer, const TImageType3D &anImage3D, const TFunctor &aFunctor, typename Viewer3D< Space, KSpace >::TextureMode aTextureMode)
Aim: Realizes the concept CDigitalSet by using the STL container std::vector.
class to modify the position and orientation of an 2D domain.
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
static void drawAsGrid(Viewer3D< Space, KSpace > &viewer, const DGtal::DigitalSetBySTLSet< Domain, Compare > &aSet)
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
class to insert a custom 2D textured image by using a conversion functor and allows to change the def...
TextureMode
the modes of representation of an image
Definition: Viewer3D.h:311
static void drawImage2D(Viewer3D< Space, KSpace > &viewer, const TImageType2D &anImage, const TFunctor &aFunctor, typename Viewer3D< Space, KSpace >::TextureMode aTextureMode)
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
Definition: GridCurve.h:172
class to modify the data of an given image and also the possibility to translate it (optional)...
Class for adding a Clipping plane through the Viewer3D stream. Realizes the concept CDrawableWithView...
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
static void drawAsBalls(Viewer3D< Space, KSpace > &viewer, const DGtal::StandardDSS6Computer< TIterator, TInteger, connectivity > &arithm)
Aim: A container class for storing sets of digital points within some given domain.
static void drawAsPavingBalls(Viewer3D< Space, KSpace > &viewer, const DGtal::HyperRectDomain< SpaceDom > &aDomain)
class to modify the position and scale to construct better illustration mode.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.
Aim: transforms a signed cell c into a pair of points corresponding to the signed cells of greater di...