Mantid
Loading...
Searching...
No Matches
WorkspaceTreeWidgetSimple.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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#pragma once
8
11
12#include <QMenu>
13#include <QWidget>
14
15class QTreeWidgetItem;
16class QSignalMapper;
17
18namespace Mantid::API {
19class Workspace;
20}
21
23class MantidDisplayBase;
24class MantidTreeWidget;
25
32 Q_OBJECT
33public:
34 explicit WorkspaceTreeWidgetSimple(bool viewOnly = false, QWidget *parent = nullptr);
36
37 // Context Menu Handlers
38 void popupContextMenu() override;
39 void setOverplotDisabled(bool disabled);
40
41signals:
42 void plotSpectrumClicked(const QStringList &workspaceNames);
43 void plotBinClicked(const QStringList &workspaceNames);
44 void overplotSpectrumClicked(const QStringList &workspaceNames);
45 void plotSpectrumWithErrorsClicked(const QStringList &workspaceNames);
46 void overplotSpectrumWithErrorsClicked(const QStringList &workspaceNames);
47 void plotColorfillClicked(const QStringList &workspaceNames);
48 void sampleLogsClicked(const QStringList &workspaceName);
49 void sliceViewerClicked(const QStringList &workspaceName);
50 void showInstrumentClicked(const QStringList &workspaceNames);
51 void showDataClicked(const QStringList &workspaceNames);
52 void showAlgorithmHistoryClicked(const QStringList &workspaceNames);
53 void showDetectorsClicked(const QStringList &workspaceNames);
54 void plotAdvancedClicked(const QStringList &workspaceNames);
55 void plotSurfaceClicked(const QStringList &workspaceNames);
56 void plotWireframeClicked(const QStringList &workspaceNames);
57 void plotContourClicked(const QStringList &workspaceNames);
58 void sampleMaterialClicked(const QStringList &workspaceNames);
59 void sampleShapeClicked(const QStringList &workspaceNames);
60 void superplotClicked(const QStringList &workspaceNames);
61 void superplotWithErrsClicked(const QStringList &workspaceNames);
62 void superplotBinsClicked(const QStringList &workspaceNames);
63 void superplotBinsWithErrsClicked(const QStringList &workspaceNames);
65
66 void workspaceDoubleClicked(const QString &workspaceName);
68
69 // Signal when plot MDHistogram clicked
70 void plotMDHistoClicked(const QStringList &workspaceNames);
71 void overplotMDHistoClicked(const QStringList &workspaceNames);
72 void plotMDHistoWithErrorsClicked(const QStringList &workspaceNames);
73 void overplotMDHistoWithErrorsClicked(const QStringList &workspaceNames);
74
75private slots:
76 void onPlotSpectrumClicked();
77 void onPlotBinClicked();
78 void onOverplotSpectrumClicked();
79 void onPlotSpectrumWithErrorsClicked();
80 void onOverplotSpectrumWithErrorsClicked();
81 void onPlotColorfillClicked();
82 void onSampleLogsClicked();
83 void onSliceViewerClicked();
84 void onShowInstrumentClicked();
85 void onShowDataClicked();
86 void onShowAlgorithmHistoryClicked();
87 void onShowDetectorsClicked();
88 void onPlotAdvancedClicked();
89 void onPlotSurfaceClicked();
90 void onPlotWireframeClicked();
91 void onPlotContourClicked();
92 void onPlotMDHistoWorkspaceClicked(); // Linked to plotMDHistoClicked
93 void onOverPlotMDHistoWorkspaceClicked();
94 void onPlotMDHistoWorkspaceWithErrorsClicked();
95 void onOverPlotMDHistoWorkspaceWithErrorsClicked();
96 void onSampleMaterialClicked();
97 void onSampleShapeClicked();
98 void onSuperplotClicked();
99 void onSuperplotWithErrsClicked();
100 void onSuperplotBinsClicked();
101 void onSuperplotBinsWithErrsClicked();
102
103private:
104 QMenu *createWorkspaceContextMenu(const Mantid::API::Workspace &workspace);
105
106 void addMatrixWorkspaceActions(QMenu *menu, const Mantid::API::MatrixWorkspace &workspace);
107 void addTableWorkspaceActions(QMenu *menu, const Mantid::API::ITableWorkspace &workspace);
108 void addMDWorkspaceActions(QMenu *menu, const Mantid::API::IMDWorkspace &workspace);
109 void addWorkspaceGroupActions(QMenu *menu, const Mantid::API::WorkspaceGroup &workspace);
110 void addGeneralWorkspaceActions(QMenu *menu) const;
111
112 QMenu *createMatrixWorkspacePlotMenu(QWidget *parent, bool hasMultipleBins);
113
114 QAction *m_plotSpectrum, *m_plotBin, *m_overplotSpectrum, *m_plotSpectrumWithErrs, *m_overplotSpectrumWithErrs,
115 *m_plotColorfill, *m_sampleLogs, *m_sliceViewer, *m_showInstrument, *m_showData, *m_showAlgorithmHistory,
116 *m_showDetectors, *m_plotAdvanced, *m_plotSurface, *m_plotWireframe, *m_plotContour, *m_plotMDHisto1D,
117 *m_overplotMDHisto1D, *m_plotMDHisto1DWithErrs, *m_overplotMDHisto1DWithErrs, *m_sampleMaterial, *m_sampleShape,
118 *m_superplot, *m_superplotWithErrs, *m_superplotBins, *m_superplotBinsWithErrs;
119};
120} // namespace MantidQt::MantidWidgets
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
WorkspaceTreeWidget implementation for the Workbench - required for some function overides.
void overplotMDHistoClicked(const QStringList &workspaceNames)
void plotBinClicked(const QStringList &workspaceNames)
void sliceViewerClicked(const QStringList &workspaceName)
void superplotClicked(const QStringList &workspaceNames)
void plotAdvancedClicked(const QStringList &workspaceNames)
void superplotWithErrsClicked(const QStringList &workspaceNames)
void plotMDHistoWithErrorsClicked(const QStringList &workspaceNames)
void showAlgorithmHistoryClicked(const QStringList &workspaceNames)
void overplotSpectrumClicked(const QStringList &workspaceNames)
void superplotBinsClicked(const QStringList &workspaceNames)
void plotMDHistoClicked(const QStringList &workspaceNames)
void overplotSpectrumWithErrorsClicked(const QStringList &workspaceNames)
void showDataClicked(const QStringList &workspaceNames)
void workspaceDoubleClicked(const QString &workspaceName)
void overplotMDHistoWithErrorsClicked(const QStringList &workspaceNames)
void plotSurfaceClicked(const QStringList &workspaceNames)
void plotSpectrumClicked(const QStringList &workspaceNames)
void sampleMaterialClicked(const QStringList &workspaceNames)
void superplotBinsWithErrsClicked(const QStringList &workspaceNames)
void plotColorfillClicked(const QStringList &workspaceNames)
void sampleLogsClicked(const QStringList &workspaceName)
void plotWireframeClicked(const QStringList &workspaceNames)
void showInstrumentClicked(const QStringList &workspaceNames)
void showDetectorsClicked(const QStringList &workspaceNames)
void plotContourClicked(const QStringList &workspaceNames)
void sampleShapeClicked(const QStringList &workspaceNames)
void plotSpectrumWithErrorsClicked(const QStringList &workspaceNames)
Basic MD Workspace Abstract Class.
Definition: IMDWorkspace.h:40
ITableWorkspace is an implementation of Workspace in which the data are organised in columns of same ...
Base MatrixWorkspace Abstract Class.
Class to hold a set of workspaces.
Base Workspace Abstract Class.
Definition: Workspace.h:30