Mantid
Loading...
Searching...
No Matches
ImageInfoModelMD.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7
9#include <climits>
10
12
14ImageInfoModel::ImageInfo ImageInfoModelMD::info(const double x, const double y, const double signal,
15 const QMap<QString, QString> &extraValues) const {
16 ImageInfo info({"x", "y", "Signal"});
17 for (auto &extraName : extraValues.keys())
18 info.m_names.push_back(extraName);
19
20 auto valueOrMissing = [](double value) { return value == UnsetValue ? MissingValue : defaultFormat(value); };
21 info.setValue(0, valueOrMissing(x));
22 info.setValue(1, valueOrMissing(y));
23 info.setValue(2, valueOrMissing(signal));
24 for (auto &extraValue : extraValues.values())
25 info.m_values.push_back(extraValue);
26
27 return info;
28}
29
30} // namespace MantidQt::MantidWidgets
double value
The value of the point.
Definition: FitMW.cpp:51
ImageInfoModel::ImageInfo info(const double x, const double y, const double signal, const QMap< QString, QString > &extraValues) const override
Creates a list with information about the coordinates in the workspace.
void setValue(int index, const QString &value) noexcept
static constexpr auto UnsetValue
Value to indicate that a MissingValue should be shown.
static const QString MissingValue
MissingValue identifier.
static const QString defaultFormat(const double x)