Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
47fdedb2
Commit
47fdedb2
authored
Dec 12, 2016
by
Samuel Jackson
Browse files
Refs #18240 Add ability to drag & drop mask workspaces
parent
a514007b
Changes
4
Hide whitespace changes
Inline
Side-by-side
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/InstrumentWidget.h
View file @
47fdedb2
...
...
@@ -152,6 +152,7 @@ signals:
void
requestSelectComponent
(
const
QString
&
);
void
preDeletingHandle
();
void
clearingHandle
();
void
maskedWorkspaceOverlayed
();
protected:
/// Implements AlgorithmObserver's finish handler
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/InstrumentWidgetMaskTab.h
View file @
47fdedb2
...
...
@@ -109,7 +109,7 @@ protected slots:
void
saveExcludeGroupToFile
();
void
showSaveMenuTooltip
(
QAction
*
);
void
toggleMaskGroup
();
void
enableApplyButtons
();
void
doubleChanged
(
QtProperty
*
);
protected:
...
...
@@ -124,7 +124,6 @@ protected:
void
saveMaskingToCalFile
(
bool
invertMask
=
false
);
void
saveMaskingToTableWorkspace
(
bool
invertMask
=
false
);
std
::
string
generateMaskWorkspaceName
(
bool
temp
=
false
)
const
;
void
enableApplyButtons
();
void
setSelectActivity
();
Mode
getMode
()
const
;
/// Get mask/group border color
...
...
MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidget.cpp
View file @
47fdedb2
...
...
@@ -10,6 +10,7 @@
#include
"MantidAPI/Axis.h"
#include
"MantidAPI/IPeaksWorkspace.h"
#include
"MantidAPI/IMaskWorkspace.h"
#include
"MantidAPI/MatrixWorkspace.h"
#include
"MantidAPI/Workspace.h"
#include
"MantidKernel/Unit.h"
...
...
@@ -946,7 +947,9 @@ bool InstrumentWidget::overlay(const QString &wsName) {
auto
pws
=
boost
::
dynamic_pointer_cast
<
IPeaksWorkspace
>
(
workspace
);
auto
table
=
boost
::
dynamic_pointer_cast
<
ITableWorkspace
>
(
workspace
);
if
(
!
pws
&&
!
table
)
{
auto
maskedWs
=
boost
::
dynamic_pointer_cast
<
IMaskWorkspace
>
(
workspace
);
if
(
!
pws
&&
!
table
&&
!
maskedWs
)
{
QMessageBox
::
warning
(
this
,
"MantidPlot - Warning"
,
"Work space called '"
+
wsName
+
"' is not suitable."
...
...
@@ -970,6 +973,14 @@ bool InstrumentWidget::overlay(const QString &wsName) {
surface
->
loadShapesFromTableWorkspace
(
table
);
updateInstrumentView
();
success
=
true
;
}
else
if
(
maskedWs
&&
surface
)
{
auto
actor
=
getInstrumentActor
();
actor
->
setMaskMatrixWorkspace
(
boost
::
dynamic_pointer_cast
<
Mantid
::
API
::
MatrixWorkspace
>
(
maskedWs
));
actor
->
updateColors
();
updateInstrumentDetectors
();
emit
maskedWorkspaceOverlayed
();
}
return
success
;
...
...
MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp
View file @
47fdedb2
...
...
@@ -331,6 +331,9 @@ InstrumentWidgetMaskTab::InstrumentWidgetMaskTab(InstrumentWidget *instrWidget)
buttons
->
addWidget
(
m_applyToData
,
0
,
0
);
box
->
setLayout
(
buttons
);
layout
->
addWidget
(
box
);
connect
(
m_instrWidget
,
SIGNAL
(
maskedWorkspaceOverlayed
()),
this
,
SLOT
(
enableApplyButtons
()));
}
/**
...
...
@@ -1059,6 +1062,7 @@ void InstrumentWidgetMaskTab::enableApplyButtons() {
m_applyToData
->
setEnabled
(
false
);
m_applyToView
->
setEnabled
(
false
);
}
m_saveShapesToTable
->
setEnabled
(
hasMaskShapes
);
m_saveButton
->
setEnabled
(
hasDetectorMask
&&
(
!
enableBinMasking
));
m_clearAll
->
setEnabled
(
hasMask
);
setActivity
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment