Arty
debug.h
1 #ifndef DEBUG_H
2 #define DEBUG_H
3 
4 #include <vector>
5 #include <functional>
6 
7 #include "intersect.h"
8 #include "color.h"
9 #include "common.h"
10 
11 #ifdef NDEBUG
12 inline void debug_raster(int, int) {}
13 inline bool debug_flag() { return false; }
14 inline void debug_path(const std::vector<float3>&) {}
15 template <typename... Args>
16 void debug_print(Args... args) {}
17 #else
18 extern int debug_xmin, debug_xmax;
19 extern int debug_ymin, debug_ymax;
20 
22 void debug_raster(int x, int y);
24 bool debug_flag();
26 void debug_path(const std::vector<float3>& path);
28 template <typename... Args>
29 void debug_print(Args... args) {
30  if (debug_flag()) {
31  #pragma omp critical
32  info(args...);
33  }
34 }
35 #endif // NDEBUG
36 
37 #endif // DEBUG_H