-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVisualizer.h
86 lines (82 loc) · 2.47 KB
/
Visualizer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef _VISUALIZER_H
#define _VISUALIZER_H
#include <iostream>
#include <string>
#include "Location.h"
class Visualizer {
public:
void setLineWidth(float width) const
{
#ifdef VISUALIZER
std::cout << "v setLineWidth " << width << std::endl;
#endif
}
void setLineColor(int r, int g, int b, float a = 1.0) const
{
#ifdef VISUALIZER
std::cout << "v setLineColor " << r << " " << g << " " << b << " " << a << std::endl;
#endif
}
void setFillColor(int r, int g, int b, float a = 0.5) const
{
#ifdef VISUALIZER
std::cout << "v setFillColor " << r << " " << g << " " << b << " " << a << std::endl;
#endif
}
void arrow(const Location &a, const Location &b) const
{
#ifdef VISUALIZER
std::cout << "v arrow " << a.row << " " << a.col << " " << b.row << " " << b.col << std::endl;
#endif
}
void line(const Location &a, const Location &b) const
{
#ifdef VISUALIZER
std::cout << "v line " << a.row << " " << a.col << " " << b.row << " " << b.col << std::endl;
#endif
}
void rect(const Location &a, const Location &b, bool fill) const
{
#ifdef VISUALIZER
std::cout << "v rect " << a.row << " " << a.col << " " << b.row << " " << b.col << " " << fill << std::endl;
#endif
}
void circle(const Location &a, float radius, bool fill) const
{
#ifdef VISUALIZER
std::cout << "v circle " << a.row << " " << a.col << " " << radius << " " << fill << std::endl;
#endif
}
void star(const Location &a, float r1, float r2, int points, bool fill) const
{
#ifdef VISUALIZER
std::cout << "v star " << a.row << " " << a.col << " " << r1 << " " << r2 << " " << points << " " << fill << std::endl;
#endif
}
void tile(const Location &a) const
{
#ifdef VISUALIZER
std::cout << "v tile " << a.row << " " << a.col << std::endl;
#endif
}
// TL, TM, TR, ML, MM, MR, BL, BM, BR
void tileBorder(const Location &a, const char *subtile) const
{
#ifdef VISUALIZER
std::cout << "v tileBorder " << a.row << " " << a.col << " " << subtile << std::endl;
#endif
}
void tileSubTile(const Location &a, const char *subtile) const
{
#ifdef VISUALIZER
std::cout << "v tileSubTile " << a.row << " " << a.col << " " << subtile << std::endl;
#endif
}
void info(const Location &a, const std::string &info) const
{
#ifdef VISUALIZER
std::cout << "i " << a.row << " " << a.col << " " << info << std::endl;
#endif
}
};
#endif /* _VISUALIZER_H */