DGtal  1.2.0
CDrawableWithBoard2D.h
1 
17 #pragma once
18 
33 #if defined(CDrawableWithBoard2D_RECURSES)
34 #error Recursive header files inclusion detected in CDrawableWithBoard2D.h
35 #else // defined(CDrawableWithBoard2D_RECURSES)
37 #define CDrawableWithBoard2D_RECURSES
38 
39 #if !defined CDrawableWithBoard2D_h
41 #define CDrawableWithBoard2D_h
42 
44 // Inclusions
45 
46 #include <iostream>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/io/Display2DFactory.h"
50 
51 namespace DGtal
52 {
54  class Board2D;
55  namespace concepts
56  {
57 
59  // class CDrawableWithBoard2D
103  template <typename T>
105  {
106  // ----------------------- Concept checks ------------------------------
107  public:
109  {
110  //Drawable model should have a className() returning a string
111  concepts::ConceptUtils::sameType( myS, myT.className() );
112 
113  //Drawable model should be associated to global functions draw and defaultStyle.
115  concepts::ConceptUtils::sameType( myD, defaultStyle( myT) );
116  }
117 
118  // ------------------------- Private Datas --------------------------------
119  private:
120  T myT;
123  std::string myS;
124 
125  // ------------------------- Internals ------------------------------------
126  private:
127 
128  }; // end of concept CDrawableWithBoard2D
129  }// namespace concepts
130 } // namespace DGtal
131 
132 
133 // //
135 
136 #endif // !defined CDrawableWithBoard2D_h
137 
138 #undef CDrawableWithBoard2D_RECURSES
139 #endif // else defined(CDrawableWithBoard2D_RECURSES)
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:71
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal is the top-level namespace which contains all DGtal functions and types.
static void draw(DGtal::Board2D &board, const DGtal::DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > &calculus)
Aim: The concept CDrawableWithBoard2D specifies what are the classes that admit an export with Board2...