Mantid
|
Model to support looking up information about a given point with a MatrixWorkspace. More...
#include <ImageInfoModelMatrixWS.h>
Public Member Functions | |
ImageInfoModelMatrixWS (Mantid::API::MatrixWorkspace_sptr workspace) | |
Constructor. More... | |
ImageInfoModel::ImageInfo | info (const double x, const double y, const double signal, const QMap< QString, QString > &extraValues) const override |
Creates information about the point at the given coordinates in the workspace. More... | |
Public Member Functions inherited from MantidQt::MantidWidgets::ImageInfoModel | |
virtual ImageInfoModel::ImageInfo | info (const double x, const double y, const double signal, const QMap< QString, QString > &extraValues) const =0 |
Creates information about the point at the given coordinates in the workspace. More... | |
virtual | ~ImageInfoModel ()=default |
Private Member Functions | |
void | cacheWorkspaceInfo () |
Cache metadata for the workspace for faster lookup. More... | |
void | createItemNames () |
Create a sequence of names for each item this model will produce and store it internally. More... | |
void | setUnitsInfo (ImageInfoModel::ImageInfo *info, int infoIndex, const size_t wsIndex, const double x) const |
Add the unit-related quantities to the info list. More... | |
Private Attributes | |
std::shared_ptr< const Mantid::Geometry::Instrument > | m_instrument |
ImageInfoModel::ImageInfo::StringItems | m_names |
std::shared_ptr< const Mantid::Geometry::IComponent > | m_sample |
std::shared_ptr< const Mantid::Geometry::IComponent > | m_source |
const Mantid::API::SpectrumInfo * | m_spectrumInfo |
Mantid::API::MatrixWorkspace_sptr | m_workspace |
bool | m_xIsTOF |
Mantid::Kernel::Unit_sptr | m_xunit |
Additional Inherited Members | |
Static Public Member Functions inherited from MantidQt::MantidWidgets::ImageInfoModel | |
static const QString | defaultFormat (const double x) |
static const QString | defaultFormat (const int x) |
Static Public Attributes inherited from MantidQt::MantidWidgets::ImageInfoModel | |
static constexpr auto | DecimalFormat = 'f' |
Default float format. More... | |
static constexpr auto | FourDigitPrecision = 4 |
Default float precision. More... | |
static const QString | MissingValue = QString("-") |
MissingValue identifier. More... | |
static constexpr auto | UnsetValue = std::numeric_limits<double>::max() |
Value to indicate that a MissingValue should be shown. More... | |
Model to support looking up information about a given point with a MatrixWorkspace.
Definition at line 34 of file ImageInfoModelMatrixWS.h.
MantidQt::MantidWidgets::ImageInfoModelMatrixWS::ImageInfoModelMatrixWS | ( | Mantid::API::MatrixWorkspace_sptr | workspace | ) |
Constructor.
workspace | A MatrixWorkspace to provide information for the model |
Definition at line 48 of file ImageInfoModelMatrixWS.cpp.
References cacheWorkspaceInfo().
|
private |
Cache metadata for the workspace for faster lookup.
Definition at line 147 of file ImageInfoModelMatrixWS.cpp.
References createItemNames(), Mantid::Kernel::Logger::debug(), Mantid::API::g_log, m_instrument, m_sample, m_source, m_spectrumInfo, m_workspace, m_xIsTOF, and m_xunit.
Referenced by ImageInfoModelMatrixWS().
|
private |
Create a sequence of names for each item this model will produce and store it internally.
Definition at line 173 of file ImageInfoModelMatrixWS.cpp.
References m_names, m_workspace, m_xunit, and MantidQt::API::toQStringInternal().
Referenced by cacheWorkspaceInfo().
|
overridevirtual |
Creates information about the point at the given coordinates in the workspace.
x | x data coordinate |
y | y data coordinate |
signal | the signal value at x, y |
extraValues | extra values to be displayed in the image info table |
Implements MantidQt::MantidWidgets::ImageInfoModel.
Definition at line 54 of file ImageInfoModelMatrixWS.cpp.
References Mantid::API::SpectrumInfo::azimuthal(), Mantid::Kernel::Logger::debug(), MantidQt::MantidWidgets::ImageInfoModel::defaultFormat(), Mantid::API::g_log, Mantid::API::SpectrumInfo::hasDetectors(), info(), Mantid::API::SpectrumInfo::l2(), m_instrument, m_names, m_sample, m_source, m_spectrumInfo, m_workspace, Mantid::Geometry::rad2deg, setUnitsInfo(), MantidQt::MantidWidgets::ImageInfoModel::ImageInfo::setValue(), Mantid::API::SpectrumInfo::signedTwoTheta(), MantidQt::MantidWidgets::ImageInfoModel::UnsetValue, Mantid::Geometry::x, and Mantid::Geometry::y.
Referenced by info(), and setUnitsInfo().
|
private |
Add the unit-related quantities to the info list.
info | Existing ImageInfo object |
infoIndex | The index to start at when adding units information |
wsIndex | The wsIndex whose spectrum is under the cursor |
x | The value from the cursor on the X axis |
Definition at line 97 of file ImageInfoModelMatrixWS.cpp.
References Mantid::Kernel::Logger::debug(), MantidQt::MantidWidgets::ImageInfoModel::defaultFormat(), Mantid::Kernel::efixed, Mantid::Kernel::DeltaEMode::Elastic, Mantid::API::g_log, Mantid::API::SpectrumInfo::getDetectorValues(), info(), Mantid::Kernel::SingletonHolder< T >::Instance(), Mantid::Kernel::Logger::is(), Mantid::API::SpectrumInfo::l1(), m_spectrumInfo, m_workspace, m_xIsTOF, m_xunit, MantidQt::MantidWidgets::ImageInfoModel::ImageInfo::setValue(), and Mantid::Geometry::x.
Referenced by info().
|
private |
Definition at line 50 of file ImageInfoModelMatrixWS.h.
Referenced by cacheWorkspaceInfo(), and info().
|
private |
Definition at line 53 of file ImageInfoModelMatrixWS.h.
Referenced by createItemNames(), and info().
|
private |
Definition at line 52 of file ImageInfoModelMatrixWS.h.
Referenced by cacheWorkspaceInfo(), and info().
|
private |
Definition at line 51 of file ImageInfoModelMatrixWS.h.
Referenced by cacheWorkspaceInfo(), and info().
|
private |
Definition at line 49 of file ImageInfoModelMatrixWS.h.
Referenced by cacheWorkspaceInfo(), info(), and setUnitsInfo().
|
private |
Definition at line 48 of file ImageInfoModelMatrixWS.h.
Referenced by cacheWorkspaceInfo(), createItemNames(), info(), and setUnitsInfo().
|
private |
Definition at line 55 of file ImageInfoModelMatrixWS.h.
Referenced by cacheWorkspaceInfo(), and setUnitsInfo().
|
private |
Definition at line 54 of file ImageInfoModelMatrixWS.h.
Referenced by cacheWorkspaceInfo(), createItemNames(), and setUnitsInfo().