Mantid
Loading...
Searching...
No Matches
ImageInfoPresenter.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
11
13
15
20ImageInfoPresenter::ImageInfoPresenter(IImageInfoWidget *view) : m_model(), m_view(view) { m_view->setRowCount(2); }
21
28void ImageInfoPresenter::cursorAt(const double x, const double y, const double signal,
29 const QMap<QString, QString> extraValues) {
30 assert(m_model);
31 m_view->showInfo(m_model->info(x, y, signal, extraValues));
32}
33
39 if (auto matrixWS = std::dynamic_pointer_cast<MatrixWorkspace>(workspace))
40 m_model = std::make_unique<ImageInfoModelMatrixWS>(matrixWS);
41 else {
42 m_model = std::make_unique<ImageInfoModelMD>();
43 }
44}
45
46} // namespace MantidQt::MantidWidgets
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
virtual void showInfo(const ImageInfoModel::ImageInfo &info)=0
void setWorkspace(const Mantid::API::Workspace_sptr &ws)
Set a new workspace for the view to display.
void cursorAt(const double x, const double y, const double signal, const QMap< QString, QString > extraValues)
std::unique_ptr< ImageInfoModel > m_model
ImageInfoPresenter(IImageInfoWidget *view)
Constructor.
Base MatrixWorkspace Abstract Class.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20