22 #include "qcustomplot.h"
27 QCustomPlot* custom_plot{
nullptr};
29 std::unique_ptr<StatusStringReporter>
reporter;
34 viewport_controller = std::make_unique<ColorMapViewportPlotController>(custom_plot);
36 auto on_mouse_move = [
this](
const std::string& str) {
37 status_label->setText(QString::fromStdString(str));
46 : QWidget(parent), p_impl(
std::make_unique<ColorMapCanvasImpl>())
48 auto layout =
new QVBoxLayout(
this);
50 layout->setSpacing(0);
51 layout->addWidget(
p_impl->custom_plot);
52 layout->addWidget(
p_impl->status_label);
55 p_impl->customPlot()->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
56 p_impl->customPlot()->axisRect()->setupFullAxesBox(
true);
63 p_impl->viewport_controller->setItem(viewport_item);
71 return std::make_unique<CustomPlotSceneAdapter>(
p_impl->customPlot());
ColorMapCanvas(QWidget *parent=nullptr)
~ColorMapCanvas() override
void setItem(ColorMapViewportItem *viewport_item)
std::unique_ptr< SceneAdapterInterface > createSceneAdapter() const
Creates adapter to convert widget coordinates, to QCustomPlot internal coordinate system (defined by ...
std::unique_ptr< ColorMapCanvasImpl > p_impl
Container with viewport and collection of ColorMapItem's to plot.
Shows a single line of text on a white background.
materialitems.h Collection of materials to populate MaterialModel.
std::unique_ptr< StatusStringReporter > CreateColorMapReporter(QCustomPlot *custom_plot, std::function< void(const std::string &)> callback)
Creates reporter for status string in QCustomPlot containing QCPColorMap.
std::unique_ptr< ColorMapViewportPlotController > viewport_controller
std::unique_ptr< StatusStringReporter > reporter
QCustomPlot * customPlot()