DGtal  1.3.beta
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)
36 
37 #define CDrawableWithBoard2D_RECURSES
38 
39 #if !defined CDrawableWithBoard2D_h
40 
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)
DGtal::concepts::CDrawableWithBoard2D::myS
std::string myS
Definition: CDrawableWithBoard2D.h:123
DGtal::concepts::CDrawableWithBoard2D::myB
Board2D myB
Definition: CDrawableWithBoard2D.h:122
DGtal::concepts::CDrawableWithBoard2D::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CDrawableWithBoard2D)
Definition: CDrawableWithBoard2D.h:108
DGtal::concepts::CDrawableWithBoard2D
Aim: The concept CDrawableWithBoard2D specifies what are the classes that admit an export with Board2...
Definition: CDrawableWithBoard2D.h:104
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal::DrawableWithBoard2D
Definition: Common.h:221
DGtal::Board2D
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:70
DGtal::concepts::CDrawableWithBoard2D::myD
DrawableWithBoard2D * myD
Definition: CDrawableWithBoard2D.h:121
DGtal::concepts::CDrawableWithBoard2D::myT
T myT
Definition: CDrawableWithBoard2D.h:120
DGtal::Display2DFactory::draw
static void draw(DGtal::Board2D &board, const DGtal::DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > &calculus)