23#include <QSignalMapper>
35 for (
size_t i = 0; i < numHist; ++i) {
36 if (ws.
y(i).size() > 1) {
49 m_plotBin(new QAction(
"Bin", this)), m_overplotSpectrum(new QAction(
"Overplot spectrum...", this)),
50 m_plotSpectrumWithErrs(new QAction(
"Spectrum with errors...", this)),
51 m_overplotSpectrumWithErrs(new QAction(
"Overplot spectrum with errors...", this)),
52 m_plotColorfill(new QAction(
"Colorfill", this)), m_sampleLogs(new QAction(
"Show Sample Logs", this)),
53 m_sliceViewer(new QAction(
"Show Slice Viewer", this)), m_showInstrument(new QAction(
"Show Instrument", this)),
54 m_showData(new QAction(
"Show Data", this)), m_showAlgorithmHistory(new QAction(
"Show History", this)),
55 m_showDetectors(new QAction(
"Show Detectors", this)), m_plotAdvanced(new QAction(
"Advanced...", this)),
56 m_plotSurface(new QAction(
"Surface", this)), m_plotWireframe(new QAction(
"Wireframe", this)),
57 m_plotContour(new QAction(
"Contour", this)), m_plotMDHisto1D(new QAction(
"Plot 1D MDHistogram...", this)),
58 m_overplotMDHisto1D(new QAction(
"Overplot 1D MDHistogram...", this)),
59 m_plotMDHisto1DWithErrs(new QAction(
"Plot 1D MDHistogram with errors...", this)),
60 m_overplotMDHisto1DWithErrs(new QAction(
"Overplot 1D MDHistogram with errors...", this)),
61 m_sampleMaterial(new QAction(
"Show Sample Material", this)),
62 m_sampleShape(new QAction(
"Show Sample Shape", this)), m_superplot(new QAction(
"Superplot...", this)),
63 m_superplotWithErrs(new QAction(
"Superplot with errors...", this)),
64 m_superplotBins(new QAction(
"Superplot bins...", this)),
65 m_superplotBinsWithErrs(new QAction(
"Superplot bins with errors...", this)) {
115 m_tree->selectionModel()->clear();
117 QMenu *menu(
nullptr);
133 menu->popup(QCursor::pos());
230 auto menu =
new QMenu(
this);
231 menu->setAttribute(Qt::WA_DeleteOnClose,
true);
232 menu->setObjectName(
"WorkspaceContextMenu");
257 menu->addSeparator();
266 if (
m_tree->selectedItems().size() == 1) {
285 bool addSliceViewer =
false;
286 bool add1DPlot =
false;
291 auto num_dims =
workspace.getNumNonIntegratedDims();
296 }
else if (num_dims > 1) {
299 addSliceViewer =
true;
302 addSliceViewer =
true;
305 if (addSliceViewer) {
307 }
else if (add1DPlot) {
308 auto *plotSubMenu =
new QMenu(
"Plot", menu);
313 menu->addMenu(plotSubMenu);
318 auto workspaces =
workspace.getAllItems();
319 bool containsMatrixWorkspace{
false};
320 bool containsPeaksWorkspace{
false};
321 for (
const auto &ws : workspaces) {
322 if (std::dynamic_pointer_cast<MatrixWorkspace>(ws)) {
323 containsMatrixWorkspace =
true;
325 }
else if (std::dynamic_pointer_cast<IPeaksWorkspace>(ws)) {
326 containsPeaksWorkspace =
true;
332 if (containsMatrixWorkspace) {
334 menu->addSeparator();
337 if (containsMatrixWorkspace || containsPeaksWorkspace) {
343 menu->addSeparator();
346 menu->addSeparator();
351 auto *plotSubMenu =
new QMenu(
"Plot", parent);
352 if (hasMultipleBins) {
360 plotSubMenu->addSeparator();
363 auto *plot3DSubMenu =
new QMenu(
"3D", plotSubMenu);
367 plotSubMenu->addMenu(plot3DSubMenu);
373 plotSubMenu->addSeparator();
IPeaksWorkspace_sptr workspace
Basic MD Workspace Abstract Class.
Interface to the class Mantid::DataObjects::PeaksWorkspace.
ITableWorkspace is an implementation of Workspace in which the data are organised in columns of same ...
Base MatrixWorkspace Abstract Class.
virtual std::size_t blocksize() const =0
Returns the size of each block of data returned by the dataY accessors.
virtual std::size_t getNumberHistograms() const =0
Returns the number of histograms in the workspace.
const HistogramData::HistogramY & y(const size_t index) const
Class to hold a set of workspaces.
Base Workspace Abstract Class.
Exception for when an item is not found in a collection.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace