8 #ifndef FIELDS2COVER_UTILS_VISUALIZER_H_
9 #define FIELDS2COVER_UTILS_VISUALIZER_H_
14 #include <type_traits>
24 static void plot(
double x,
double y,
const std::vector<double>& color = {});
25 static void plot(
const F2CPoint& p,
const std::vector<double>& color = {});
27 const F2CSwath& s,
const std::vector<double>& color = {});
29 const std::vector<std::vector<double>>& color = {});
31 const std::vector<std::vector<double>>& color = {});
32 static void plot(
const std::vector<F2CSwathsByCells>& vs,
33 const std::vector<std::vector<double>>& color = {});
35 const std::vector<double>& color = {});
37 const std::vector<double>& color = {});
39 const std::vector<double>& color = {});
41 const std::vector<double>& color = {});
43 const std::vector<double>& color = {});
45 const std::vector<double>& color = {});
47 const std::vector<std::vector<double>>& color = {});
48 static void plot(
const std::vector<F2CRoute>&
route,
49 const std::vector<std::vector<double>>& color = {});
51 const std::vector<std::vector<double>>& color = {});
53 const std::vector<double>& color = {});
56 const std::vector<double>& color = {});
60 const std::vector<double>& poly_color,
61 const std::vector<double>& holes_color);
63 const std::vector<double>& poly_color,
64 const std::vector<double>& holes_color);
66 const std::vector<double>& color);
68 const std::vector<double>& poly_color);
70 static void plot(
const std::vector<double>& t,
71 const std::vector<double>& d,
const std::vector<double>& color);
75 static void plot(
const std::vector<T>& v_t,
const std::vector<double>& color);
78 const std::vector<T>& v_t,
79 const std::vector<std::vector<double>>& color = {});
96 static void save(
const std::string& file);
100 static void title(
const std::string& text);
102 static void xlim(
double min,
double max);
103 static void ylim(
double min,
double max);
107 static std::vector<F2CPoint>
data2vector(
const T& t);
110 const std::vector<F2CPoint>&
points);
112 static std::vector<double>
linspace(
double min,
double max,
size_t N);
114 const std::vector<int>& min,
115 const std::vector<int>& max,
121 if constexpr (std::is_same<T, F2CPoint>::value) {
122 return std::vector<F2CPoint>{t};
124 std::vector<F2CPoint> res;
127 res.insert(res.end(), v.begin(), v.end());
135 const std::vector<T>& v_t,
136 const std::vector<double>& color) {
137 if constexpr (std::is_same<T, F2CPoint>::value) {
139 plot(comp[0], comp[1], color);
140 }
else if constexpr (std::is_same<T, double>::value) {
141 std::vector<double> t(v_t.size());
142 std::iota(std::begin(t),
std::end(t), 0.0);
145 for (
auto&& t : v_t) {
154 #endif // FIELDS2COVER_UTILS_VISUALIZER_H_