DGtal  0.9.2
Common.h
1 
17 #pragma once
18 
33 #if defined(Common_RECURSES)
34 #error Recursive header files inclusion detected in Common.h
35 #else // defined(Common_RECURSES)
36 
37 #define Common_RECURSES
38 
39 #if !defined Common_h
40 #define Common_h
41 
43 // Inclusions
44 
45 #ifdef WITH_VISU3D_QGLVIEWER
46 #include <QGLViewer/qglviewer.h>
47 #include <QGLWidget>
48 #include <QKeyEvent>
49 #endif
50 
51 #include <iostream>
52 #include <exception>
53 #include <algorithm>
54 #include <boost/version.hpp>
55 #include <boost/concept_check.hpp>
56 #include <boost/static_assert.hpp>
57 #include <boost/concept/assert.hpp>
58 #include <boost/concept/requires.hpp>
59 #include <boost/iterator/iterator_concepts.hpp>
60 #include <boost/concept_archetype.hpp>
61 #include <boost/static_assert.hpp>
62 
63 #ifdef _MSC_VER
64 #define NOMINMAX
65 #include <windows.h>
66 #ifdef M_PI
67 #undef M_PI
68 #endif
69 //C++ exception specification ignored except
70 //to indicate a function is not __declspec(nothrow)
71 #pragma warning(disable : 4290)
72 //C++ Perf Warning int <- bool
73 #pragma warning(disable : 4800)
74 #endif
75 
76 
77 #if defined( WIN32 )
78 #define _USE_MATH_DEFINES
79 #include <math.h>
80 #else
81 #include <cmath>
82 #endif //win32
83 
84 
85 #if defined( WIN32 )
86 #define secured_sprintf sprintf_s
87 #else
88 #include <stdio.h>
89 #define secured_sprintf snprintf
90 #endif // defined( WIN32 )
91 
92 #include "DGtal/base/Config.h"
93 #include "DGtal/base/Trace.h"
94 #include "DGtal/base/TraceWriterTerm.h"
95 #include "DGtal/base/TraceWriterFile.h"
96 #include "DGtal/base/Assert.h"
97 #include "DGtal/base/ConceptUtils.h"
98 #include "DGtal/base/BasicTypes.h"
99 #include "DGtal/base/BasicFunctors.h"
100 #include "DGtal/base/BasicArchetypes.h"
101 #include "DGtal/base/Exceptions.h"
102 
103 
105 
107 namespace DGtal
108 {
109 
114 
118  enum Orientation { INSIDE = 0, ON = 1, OUTSIDE = 2};
119 
124 
125 
130  extern Trace trace;
131 
132  class Board2D;
133 
134  template < class Space, class KSpace> class Display3D;
135 
136 
137 #if defined( WITH_CAIRO )
138  template < class Space, class KSpace> class Board3DTo2D;
139 #endif
140 #if defined( WITH_VISU3D_QGLVIEWER )
141  template < class Space, class KSpace> class Viewer3D;
142 #endif
143 
144 
145 #if defined( WITH_CAIRO )
146 
155  template < typename S, typename KS>
156 
157 void setStyle( Board3DTo2D< S, KS> & ) const {}
159  };
160 #endif
161 
162 #if defined( WITH_VISU3D_QGLVIEWER )
163 
168  struct DrawableWithViewer3D {
172  template < typename S, typename KS>
173  void setStyle( Viewer3D< S, KS> & ) const {}
174  virtual ~DrawableWithViewer3D() {}
175  };
176 #endif
177 
187  template < typename Sp, typename KSp>
188  void setStyle( Display3D< Sp, KSp> & ) const {}
190  };
191 
202  virtual void setStyle( Board2D & ) const {}
203  virtual ~DrawableWithBoard2D() {}
204  };
205 
206 } // namespace DGtal
207 
208 
209 // //
211 
212 #endif // !defined Common_h
213 
214 #undef Common_RECURSES
215 #endif // else defined(Common_RECURSES)
boost::uint32_t uint32_t
unsigned 32-bit integer.
Definition: BasicTypes.h:63
Trace trace
Definition: Common.h:130
Class for PDF, PNG, PS, EPS, SVG export drawings with Cairo with 3D->2D projection.
Definition: Common.h:138
TraceWriterTerm traceWriterTerm(std::cerr)
Definition: Common.h:129
virtual ~DrawableWithBoard2D()
Definition: Common.h:203
virtual ~DrawableWithBoard3DTo2D()
Definition: Common.h:158
DGtal::uint32_t Dimension
Definition: Common.h:113
virtual void setStyle(Board2D &) const
Definition: Common.h:202
virtual ~DrawableWithDisplay3D()
Definition: Common.h:189
Orientation
Definition: Common.h:118
Implements trace prefix for color terminals.
void setStyle(Board3DTo2D< S, KS > &) const
Definition: Common.h:157
DGtal is the top-level namespace which contains all DGtal functions and types.
void setStyle(Display3D< Sp, KSp > &) const
Definition: Common.h:188
implementation of basic methods to trace out messages with indentation levels.
Definition: Trace.h:73
Aim: This semi abstract class defines the stream mechanism to display 3d primitive (like BallVector...
Definition: Common.h:134
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...
Definition: Board2D.h:70
Closest
Definition: Common.h:123