完成热力图,等待测试吧
This commit is contained in:
@@ -8,50 +8,66 @@
|
||||
#include "modern-qt/utility/theme/theme.hh"
|
||||
#include "modern-qt/utility/wrapper/pimpl.hh"
|
||||
#include "qcustomplot/qcustomplot.h"
|
||||
#include <qcontainerfwd.h>
|
||||
|
||||
struct point_data {
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
};
|
||||
using PointData = struct point_data;
|
||||
namespace creeper {
|
||||
class heatmap;
|
||||
class heatmap;
|
||||
|
||||
namespace plot_widget::internal {
|
||||
class BasicPlot : public QCustomPlot {
|
||||
CREEPER_PIMPL_DEFINITION(BasicPlot);
|
||||
friend heatmap;
|
||||
class BasicPlot : public QCustomPlot {
|
||||
CREEPER_PIMPL_DEFINITION(BasicPlot);
|
||||
friend heatmap;
|
||||
|
||||
public:
|
||||
struct ColorSpace {
|
||||
public:
|
||||
struct ColorSpace {};
|
||||
|
||||
};
|
||||
void init_plot();
|
||||
|
||||
void load_theme_manager(ThemeManager&);
|
||||
void load_theme_manager(ThemeManager&);
|
||||
|
||||
void set_xlabel_text(const QString&);
|
||||
void set_xlabel_text(const QString&);
|
||||
|
||||
void set_ylabel_text(const QString&);
|
||||
void set_ylabel_text(const QString&);
|
||||
|
||||
void set_matrix_size(const QSize&);
|
||||
void set_matrix_size(const QSize&);
|
||||
|
||||
private:
|
||||
friend class Impl;
|
||||
};
|
||||
}
|
||||
void set_matrix_size(const int& w, const int& h);
|
||||
|
||||
public slots:
|
||||
void update_dynamic_heatmap(QVector<PointData>& map);
|
||||
private:
|
||||
QSize get_matrix_size();
|
||||
private:
|
||||
friend class Impl;
|
||||
QSize matrix_size;
|
||||
};
|
||||
} // namespace plot_widget::internal
|
||||
|
||||
namespace plot_widget::pro {
|
||||
using Token = common::Token<internal::BasicPlot>;
|
||||
using XLabelText = common::pro::String<Token, [](auto& self, const auto& string) {
|
||||
using Token = common::Token<internal::BasicPlot>;
|
||||
using XLabelText =
|
||||
common::pro::String<Token, [](auto& self, const auto& string) {
|
||||
self.set_xlabel_text(string);
|
||||
}>;
|
||||
using YLabelText = common::pro::String<Token, [](auto& self, const auto& string) {
|
||||
using YLabelText =
|
||||
common::pro::String<Token, [](auto& self, const auto& string) {
|
||||
self.set_ylabel_text(string);
|
||||
}>;
|
||||
|
||||
struct MatrixSize : Token {
|
||||
QSize size;
|
||||
explicit MatrixSize(const int& w, const int& h) : size {w, h} {}
|
||||
void apply(auto& self) const {
|
||||
|
||||
}
|
||||
struct MatrixSize : Token {
|
||||
QSize size;
|
||||
explicit MatrixSize(const int& w, const int& h) : size{w, h} {}
|
||||
void apply(auto& self) const {
|
||||
self.set_matrix_size(size.width(), size.height());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}; // namespace plot_widget::pro
|
||||
} // namespace creeper
|
||||
|
||||
#endif //TOUCHSENSOR_HEATMAP_H
|
||||
#endif // TOUCHSENSOR_HEATMAP_H
|
||||
|
||||
Reference in New Issue
Block a user