Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::ImageInfoModelMatrixWS Class Reference

Model to support looking up information about a given point with a MatrixWorkspace. More...

#include <ImageInfoModelMatrixWS.h>

Inheritance diagram for MantidQt::MantidWidgets::ImageInfoModelMatrixWS:
MantidQt::MantidWidgets::ImageInfoModel

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::Instrumentm_instrument
 
ImageInfoModel::ImageInfo::StringItems m_names
 
std::shared_ptr< const Mantid::Geometry::IComponentm_sample
 
std::shared_ptr< const Mantid::Geometry::IComponentm_source
 
const Mantid::API::SpectrumInfom_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...
 

Detailed Description

Model to support looking up information about a given point with a MatrixWorkspace.

Definition at line 34 of file ImageInfoModelMatrixWS.h.

Constructor & Destructor Documentation

◆ ImageInfoModelMatrixWS()

MantidQt::MantidWidgets::ImageInfoModelMatrixWS::ImageInfoModelMatrixWS ( Mantid::API::MatrixWorkspace_sptr  workspace)

Constructor.

Parameters
workspaceA MatrixWorkspace to provide information for the model

Definition at line 48 of file ImageInfoModelMatrixWS.cpp.

References cacheWorkspaceInfo().

Member Function Documentation

◆ cacheWorkspaceInfo()

void MantidQt::MantidWidgets::ImageInfoModelMatrixWS::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().

◆ createItemNames()

void MantidQt::MantidWidgets::ImageInfoModelMatrixWS::createItemNames ( )
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().

◆ info()

ImageInfoModel::ImageInfo MantidQt::MantidWidgets::ImageInfoModelMatrixWS::info ( const double  x,
const double  y,
const double  signal,
const QMap< QString, QString > &  extraValues 
) const
overridevirtual

◆ setUnitsInfo()

void MantidQt::MantidWidgets::ImageInfoModelMatrixWS::setUnitsInfo ( ImageInfoModel::ImageInfo info,
int  infoIndex,
const size_t  wsIndex,
const double  x 
) const
private

Add the unit-related quantities to the info list.

Parameters
infoExisting ImageInfo object
infoIndexThe index to start at when adding units information
wsIndexThe wsIndex whose spectrum is under the cursor
xThe 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().

Member Data Documentation

◆ m_instrument

std::shared_ptr<const Mantid::Geometry::Instrument> MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_instrument
private

Definition at line 50 of file ImageInfoModelMatrixWS.h.

Referenced by cacheWorkspaceInfo(), and info().

◆ m_names

ImageInfoModel::ImageInfo::StringItems MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_names
private

Definition at line 53 of file ImageInfoModelMatrixWS.h.

Referenced by createItemNames(), and info().

◆ m_sample

std::shared_ptr<const Mantid::Geometry::IComponent> MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_sample
private

Definition at line 52 of file ImageInfoModelMatrixWS.h.

Referenced by cacheWorkspaceInfo(), and info().

◆ m_source

std::shared_ptr<const Mantid::Geometry::IComponent> MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_source
private

Definition at line 51 of file ImageInfoModelMatrixWS.h.

Referenced by cacheWorkspaceInfo(), and info().

◆ m_spectrumInfo

const Mantid::API::SpectrumInfo* MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_spectrumInfo
private

Definition at line 49 of file ImageInfoModelMatrixWS.h.

Referenced by cacheWorkspaceInfo(), info(), and setUnitsInfo().

◆ m_workspace

Mantid::API::MatrixWorkspace_sptr MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_workspace
private

Definition at line 48 of file ImageInfoModelMatrixWS.h.

Referenced by cacheWorkspaceInfo(), createItemNames(), info(), and setUnitsInfo().

◆ m_xIsTOF

bool MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_xIsTOF
private

Definition at line 55 of file ImageInfoModelMatrixWS.h.

Referenced by cacheWorkspaceInfo(), and setUnitsInfo().

◆ m_xunit

Mantid::Kernel::Unit_sptr MantidQt::MantidWidgets::ImageInfoModelMatrixWS::m_xunit
private

Definition at line 54 of file ImageInfoModelMatrixWS.h.

Referenced by cacheWorkspaceInfo(), createItemNames(), and setUnitsInfo().


The documentation for this class was generated from the following files: