17 #include "qcustomplot.h"
23 QCPColorMap* find_colormap(QCustomPlot* custom_plot)
25 for (
int i = 0; i < custom_plot->plottableCount(); ++i) {
26 if (
auto plottable =
dynamic_cast<QCPColorMap*
>(custom_plot->plottable()); plottable)
41 std::string compose_string(
const Context& context)
43 std::ostringstream ostr;
46 ostr <<
"[binx: " << context.nx <<
", ";
47 ostr <<
"biny: " << context.ny <<
"] ";
57 auto color_map = find_colormap(custom_plot);
58 Context context{x, y};
60 color_map->data()->coordToCell(x, y, &context.nx, &context.ny);
61 context.value = color_map->data()->cell(context.nx, context.ny);
63 return compose_string(context);
MVVM_MODEL_EXPORT std::string ScientificDoubleToString(double input, int precision=6)
Returns string representation of scientific double.
MVVM_MODEL_EXPORT std::string DoubleToString(double input, int precision=12)
Returns string representation of double with given precision.
materialitems.h Collection of materials to populate MaterialModel.