Mantid
|
#include <MantidTreeWidget.h>
Public Member Functions | |
MantidWSIndexWidget::UserInput | chooseSpectrumFromSelected (bool showWaterfallOpt=true, bool showPlotAll=true, bool showTiledOpt=true, bool isAdvanced=false) const |
Allows users to choose spectra from the selected workspaces by presenting them with a dialog box. More... | |
void | disableNodes (bool) |
void | dropEvent (QDropEvent *de) override |
Accept a drag drop event and process the data appropriately. More... | |
QList< std::shared_ptr< const Mantid::API::MatrixWorkspace > > | getSelectedMatrixWorkspaces () const |
Filter the list of selected workspace names to account for any non-MatrixWorkspaces that may have been selected. More... | |
QStringList | getSelectedWorkspaceNames () const |
Returns a list of all selected workspaces. More... | |
Qt::SortOrder | getSortOrder () const |
MantidItemSortScheme | getSortScheme () const |
void | logWarningMessage (const std::string &) |
Log a warning message. More... | |
MantidTreeWidget (MantidDisplayBase *mui, QWidget *parent=nullptr) | |
void | mouseDoubleClickEvent (QMouseEvent *e) override |
void | mouseMoveEvent (QMouseEvent *e) override |
void | mousePressEvent (QMouseEvent *e) override |
void | setSortOrder (Qt::SortOrder) |
void | setSortScheme (MantidItemSortScheme) |
void | sort () |
Sort the items according to the current sort scheme and order. More... | |
Public Attributes | |
std::function< void(QString)> | m_doubleClickAction = nullptr |
Action that is executed when a workspace in the tree is double clicked. More... | |
Protected Member Functions | |
void | dragEnterEvent (QDragEnterEvent *de) override |
Accept a drag enter event and selects whether to accept the action. More... | |
void | dragMoveEvent (QDragMoveEvent *de) override |
Accept a drag move event and selects whether to accept the action. More... | |
Private Attributes | |
Mantid::API::AnalysisDataServiceImpl & | m_ads |
QPoint | m_dragStartPosition |
MantidDisplayBase * | m_mantidUI |
Qt::SortOrder | m_sortOrder |
MantidItemSortScheme | m_sortScheme |
Definition at line 24 of file MantidTreeWidget.h.
MantidQt::MantidWidgets::MantidTreeWidget::MantidTreeWidget | ( | MantidDisplayBase * | mui, |
QWidget * | parent = nullptr |
||
) |
Definition at line 31 of file MantidTreeWidget.cpp.
References MantidQt::MantidWidgets::MantidDisplayBase::importWorkspace(), m_doubleClickAction, m_mantidUI, and setSortOrder().
MantidWSIndexWidget::UserInput MantidQt::MantidWidgets::MantidTreeWidget::chooseSpectrumFromSelected | ( | bool | showWaterfallOpt = true , |
bool | showPlotAll = true , |
||
bool | showTiledOpt = true , |
||
bool | isAdvanced = false |
||
) | const |
Allows users to choose spectra from the selected workspaces by presenting them with a dialog box.
Skips showing the dialog box and automatically chooses workspace index 0 for all selected workspaces if one or more of the them are single-spectrum workspaces.
showWaterfallOpt | If true, show the waterfall option on the dialog |
showPlotAll | :: [input] If true, show the "Plot All" button on the dialog |
showTiledOpt | :: [input] If true, show the "Tiled" option on the dialog |
isAdvanced | :: [input] If true, advanced plotting being done |
Definition at line 215 of file MantidTreeWidget.cpp.
References MantidQt::MantidWidgets::MantidWSIndexWidget::UserInput::contour, MantidQt::MantidWidgets::MantidDisplayBase::createWorkspaceIndexDialog(), getSelectedMatrixWorkspaces(), MantidQt::MantidWidgets::MantidWSIndexDialog::getSelections(), m_mantidUI, MantidQt::MantidWidgets::MantidWSIndexWidget::UserInput::plots, MantidQt::MantidWidgets::MantidWSIndexWidget::UserInput::simple, MantidQt::MantidWidgets::MantidWSIndexWidget::UserInput::surface, MantidQt::MantidWidgets::MantidWSIndexWidget::UserInput::tiled, and MantidQt::MantidWidgets::MantidWSIndexWidget::UserInput::waterfall.
Referenced by MantidQt::MantidWidgets::WorkspaceTreeWidget::plotSpectrum().
void MantidQt::MantidWidgets::MantidTreeWidget::disableNodes | ( | bool | ) |
|
overrideprotected |
Accept a drag enter event and selects whether to accept the action.
de | :: The drag enter event |
Definition at line 55 of file MantidTreeWidget.cpp.
|
overrideprotected |
Accept a drag move event and selects whether to accept the action.
de | :: The drag move event |
Definition at line 45 of file MantidTreeWidget.cpp.
|
override |
Accept a drag drop event and process the data appropriately.
de | :: The drag drop event |
Definition at line 65 of file MantidTreeWidget.cpp.
References MantidQt::MantidWidgets::MantidDisplayBase::createAlgorithm(), error, MantidQt::MantidWidgets::MantidDisplayBase::executeAlgorithmAsync(), MantidQt::MantidWidgets::DropEventHelper::getFileNames(), and m_mantidUI.
Referenced by MantidQt::MantidWidgets::WorkspaceTreeWidget::dropEvent().
QList< MatrixWorkspace_const_sptr > MantidQt::MantidWidgets::MantidTreeWidget::getSelectedMatrixWorkspaces | ( | ) | const |
Filter the list of selected workspace names to account for any non-MatrixWorkspaces that may have been selected.
In particular WorkspaceGroups (the children of which are to be included if they are MatrixWorkspaces) and TableWorkspaces (which are implicitly excluded). We only want workspaces we can actually plot!
Definition at line 165 of file MantidTreeWidget.cpp.
References getSelectedWorkspaceNames(), m_ads, and Mantid::Kernel::DataService< T >::retrieve().
Referenced by chooseSpectrumFromSelected().
QStringList MantidQt::MantidWidgets::MantidTreeWidget::getSelectedWorkspaceNames | ( | ) | const |
Returns a list of all selected workspaces.
It does NOT extract child workspaces from groups - it only returns exactly what has been selected.
Definition at line 147 of file MantidTreeWidget.cpp.
Referenced by getSelectedMatrixWorkspaces(), mouseDoubleClickEvent(), and mouseMoveEvent().
Qt::SortOrder MantidQt::MantidWidgets::MantidTreeWidget::getSortOrder | ( | ) | const |
Definition at line 265 of file MantidTreeWidget.cpp.
References m_sortOrder.
Referenced by MantidQt::MantidWidgets::MantidTreeWidgetItem::operator<().
MantidItemSortScheme MantidQt::MantidWidgets::MantidTreeWidget::getSortScheme | ( | ) | const |
Definition at line 267 of file MantidTreeWidget.cpp.
References m_sortScheme.
Referenced by MantidQt::MantidWidgets::MantidTreeWidgetItem::operator<().
void MantidQt::MantidWidgets::MantidTreeWidget::logWarningMessage | ( | const std::string & | msg | ) |
Log a warning message.
msg | :: A message to log. |
Definition at line 278 of file MantidTreeWidget.cpp.
Referenced by MantidQt::MantidWidgets::MantidTreeWidgetItem::operator<().
|
override |
Definition at line 121 of file MantidTreeWidget.cpp.
References getSelectedWorkspaceNames(), m_ads, m_doubleClickAction, and Mantid::Kernel::DataService< T >::retrieve().
|
override |
Definition at line 101 of file MantidTreeWidget.cpp.
References getSelectedWorkspaceNames(), and m_dragStartPosition.
|
override |
Definition at line 91 of file MantidTreeWidget.cpp.
References m_dragStartPosition.
void MantidQt::MantidWidgets::MantidTreeWidget::setSortOrder | ( | Qt::SortOrder | sortOrder | ) |
Definition at line 263 of file MantidTreeWidget.cpp.
References m_sortOrder.
Referenced by MantidTreeWidget(), and MantidQt::MantidWidgets::WorkspaceTreeWidget::sortWorkspaces().
void MantidQt::MantidWidgets::MantidTreeWidget::setSortScheme | ( | MantidItemSortScheme | sortScheme | ) |
Definition at line 261 of file MantidTreeWidget.cpp.
References m_sortScheme.
Referenced by MantidQt::MantidWidgets::WorkspaceTreeWidget::sortWorkspaces().
void MantidQt::MantidWidgets::MantidTreeWidget::sort | ( | ) |
Sort the items according to the current sort scheme and order.
Definition at line 272 of file MantidTreeWidget.cpp.
References m_sortOrder.
Referenced by MantidQt::MantidWidgets::WorkspaceTreeWidget::handleUpdateTree(), and MantidQt::MantidWidgets::WorkspaceTreeWidget::sortWorkspaces().
|
private |
Definition at line 56 of file MantidTreeWidget.h.
Referenced by getSelectedMatrixWorkspaces(), and mouseDoubleClickEvent().
std::function<void(QString)> MantidQt::MantidWidgets::MantidTreeWidget::m_doubleClickAction = nullptr |
Action that is executed when a workspace in the tree is double clicked.
Definition at line 47 of file MantidTreeWidget.h.
Referenced by MantidTreeWidget(), mouseDoubleClickEvent(), and MantidQt::MantidWidgets::WorkspaceTreeWidgetSimple::WorkspaceTreeWidgetSimple().
|
private |
Definition at line 54 of file MantidTreeWidget.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
private |
Definition at line 55 of file MantidTreeWidget.h.
Referenced by chooseSpectrumFromSelected(), dropEvent(), and MantidTreeWidget().
|
private |
Definition at line 58 of file MantidTreeWidget.h.
Referenced by getSortOrder(), setSortOrder(), and sort().
|
private |
Definition at line 57 of file MantidTreeWidget.h.
Referenced by getSortScheme(), and setSortScheme().