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
679610c7
Commit
679610c7
authored
Aug 16, 2016
by
Samuel Jackson
Browse files
Refs #16962 Refactoring and updating documentation
parent
ec4a1027
Changes
22
Hide whitespace changes
Inline
Side-by-side
MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp
View file @
679610c7
...
...
@@ -40,61 +40,68 @@ InstrumentWindow::InstrumentWindow(const QString &wsName, const QString &label,
InstrumentWindow
::~
InstrumentWindow
()
{}
/**
* Load instrument window state from a Mantid project file
* @param lines :: lines from the project file to load state from
* @return handle to the created instrument window
*/
IProjectSerialisable
*
InstrumentWindow
::
loadFromProject
(
const
std
::
string
&
lines
,
ApplicationWindow
*
app
,
const
int
fileVersion
)
{
Q_UNUSED
(
fileVersion
);
TSVSerialiser
tsv
(
lines
);
if
(
tsv
.
selectLine
(
"WorkspaceName"
))
{
std
::
string
wsName
=
tsv
.
asString
(
1
);
QString
name
=
QString
::
fromStdString
(
wsName
);
if
(
!
Mantid
::
API
::
AnalysisDataService
::
Instance
().
doesExist
(
wsName
))
return
nullptr
;
MatrixWorkspace_const_sptr
ws
=
boost
::
dynamic_pointer_cast
<
const
MatrixWorkspace
>
(
app
->
mantidUI
->
getWorkspace
(
QString
::
fromStdString
(
wsName
)));
if
(
!
ws
)
return
nullptr
;
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
Mantid
::
Geometry
::
Instrument_const_sptr
instr
=
ws
->
getInstrument
();
if
(
!
instr
||
instr
->
getName
().
empty
())
{
QApplication
::
restoreOverrideCursor
();
QMessageBox
::
critical
(
app
,
"MantidPlot - Error"
,
"Instrument view cannot be opened"
);
return
nullptr
;
}
// Need a new window
const
QString
windowName
(
QString
(
"InstrumentWindow:"
)
+
QString
::
fromStdString
(
wsName
));
auto
iw
=
new
InstrumentWindow
(
name
,
QString
(
"Instrument"
),
app
,
windowName
);
try
{
if
(
tsv
.
hasLine
(
"geometry"
))
{
const
QString
geometry
=
QString
::
fromStdString
(
tsv
.
lineAsString
(
"geometry"
));
app
->
restoreWindowGeometry
(
app
,
iw
,
geometry
);
}
iw
->
m_instrumentWidget
->
loadFromProject
(
lines
);
app
->
addMdiSubWindow
(
iw
);
QApplication
::
restoreOverrideCursor
();
return
iw
;
}
catch
(
const
std
::
exception
&
e
)
{
QApplication
::
restoreOverrideCursor
();
QString
errorMessage
=
"Instrument view cannot be created:
\n\n
"
+
QString
(
e
.
what
());
QMessageBox
::
critical
(
app
,
"MantidPlot - Error"
,
errorMessage
);
if
(
!
tsv
.
selectLine
(
"WorkspaceName"
))
return
nullptr
;
const
auto
name
=
tsv
.
asQString
(
1
);
const
auto
workspace
=
app
->
mantidUI
->
getWorkspace
(
name
);
const
auto
ws
=
boost
::
dynamic_pointer_cast
<
const
MatrixWorkspace
>
(
workspace
);
if
(
!
ws
)
return
nullptr
;
QApplication
::
setOverrideCursor
(
QCursor
(
Qt
::
WaitCursor
));
auto
instr
=
ws
->
getInstrument
();
if
(
!
instr
||
instr
->
getName
().
empty
())
{
QApplication
::
restoreOverrideCursor
();
QMessageBox
::
critical
(
app
,
"MantidPlot - Error"
,
"Instrument view cannot be opened"
);
return
nullptr
;
}
// Create a new window
const
QString
windowName
(
"InstrumentWindow:"
+
name
);
auto
iw
=
new
InstrumentWindow
(
name
,
"Instrument"
,
app
,
windowName
);
// Populate window properties
try
{
if
(
tsv
.
hasLine
(
"geometry"
))
{
const
auto
geometry
=
tsv
.
lineAsQString
(
"geometry"
);
app
->
restoreWindowGeometry
(
app
,
iw
,
geometry
);
}
iw
->
m_instrumentWidget
->
loadFromProject
(
lines
);
app
->
addMdiSubWindow
(
iw
);
QApplication
::
restoreOverrideCursor
();
return
iw
;
}
catch
(
const
std
::
exception
&
e
)
{
QApplication
::
restoreOverrideCursor
();
QString
errorMessage
=
"Instrument view cannot be created:
\n\n
"
+
QString
(
e
.
what
());
QMessageBox
::
critical
(
app
,
"MantidPlot - Error"
,
errorMessage
);
}
return
nullptr
;
}
/**
* Save the state of the instrument window to a Mantid project file
* @param app :: handle to the current application window instance
* @return a string representing the state of the instrument window
*/
std
::
string
InstrumentWindow
::
saveToProject
(
ApplicationWindow
*
app
)
{
TSVSerialiser
tsv
,
window
;
window
.
writeRaw
(
app
->
windowGeometryInfo
(
this
));
...
...
MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.h
View file @
679610c7
...
...
@@ -28,9 +28,11 @@ public:
const
QString
&
name
=
QString
());
~
InstrumentWindow
()
override
;
/// Load the state of the instrument window for a Mantid project file
static
IProjectSerialisable
*
loadFromProject
(
const
std
::
string
&
lines
,
ApplicationWindow
*
app
,
const
int
fileVersion
);
/// Save the state of the instrument window to a Mantid project file
std
::
string
saveToProject
(
ApplicationWindow
*
app
)
override
;
void
selectTab
(
int
tab
);
MantidQt
::
MantidWidgets
::
InstrumentWidgetTab
*
...
...
MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h
View file @
679610c7
...
...
@@ -57,6 +57,7 @@ public:
std
::
vector
<
std
::
string
>
sections
(
const
std
::
string
&
name
)
const
;
std
::
string
lineAsString
(
const
std
::
string
&
name
,
const
size_t
i
=
0
)
const
;
QString
lineAsQString
(
const
std
::
string
&
name
,
const
size_t
i
=
0
)
const
;
bool
selectLine
(
const
std
::
string
&
name
,
const
size_t
i
=
0
);
bool
selectSection
(
const
std
::
string
&
name
,
const
size_t
i
=
0
);
...
...
@@ -66,6 +67,7 @@ public:
double
asDouble
(
const
size_t
i
)
const
;
float
asFloat
(
const
size_t
i
)
const
;
std
::
string
asString
(
const
size_t
i
)
const
;
QString
asQString
(
const
size_t
i
)
const
;
bool
asBool
(
const
size_t
i
)
const
;
QRect
asQRect
(
const
size_t
i
)
const
;
QColor
asQColor
(
const
size_t
i
)
const
;
...
...
MantidQt/API/src/TSVSerialiser.cpp
View file @
679610c7
...
...
@@ -149,6 +149,11 @@ std::string TSVSerialiser::lineAsString(const std::string &name,
return
lines
[
i
];
}
QString
TSVSerialiser
::
lineAsQString
(
const
std
::
string
&
name
,
const
size_t
i
)
const
{
return
QString
::
fromStdString
(
lineAsString
(
name
,
i
));
}
bool
TSVSerialiser
::
selectLine
(
const
std
::
string
&
name
,
const
size_t
i
)
{
if
(
!
hasLine
(
name
))
return
false
;
...
...
@@ -278,6 +283,13 @@ std::string TSVSerialiser::asString(const size_t i) const {
return
m_curValues
.
at
(
i
);
}
QString
TSVSerialiser
::
asQString
(
const
size_t
i
)
const
{
if
(
i
>=
m_curValues
.
size
())
return
""
;
return
QString
::
fromStdString
(
m_curValues
.
at
(
i
));
}
TSVSerialiser
&
TSVSerialiser
::
operator
>>
(
int
&
val
)
{
val
=
asInt
(
m_curIndex
++
);
return
*
this
;
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/InstrumentWidgetPickTab.h
View file @
679610c7
...
...
@@ -83,9 +83,9 @@ public:
bool
addToDisplayContextMenu
(
QMenu
&
)
const
override
;
void
selectTool
(
const
ToolType
tool
);
boost
::
shared_ptr
<
ProjectionSurface
>
getSurface
()
const
;
/// Load settings for the
widget
tab from a project file
/// Load settings for the
pick
tab from a project file
virtual
void
loadFromProject
(
const
std
::
string
&
lines
)
override
;
/// Save settings for the
widget
tab to a project file
/// Save settings for the
pick
tab to a project file
virtual
std
::
string
saveToProject
()
const
override
;
public
slots
:
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/InstrumentWidgetTab.h
View file @
679610c7
...
...
@@ -38,9 +38,9 @@ public:
virtual
bool
addToDisplayContextMenu
(
QMenu
&
)
const
{
return
false
;
}
/// Get the projection surface
boost
::
shared_ptr
<
ProjectionSurface
>
getSurface
()
const
;
/// Load s
ettings
for the widget tab from a project file
/// Load s
tate
for the widget tab from a project file
virtual
void
loadFromProject
(
const
std
::
string
&
lines
)
=
0
;
/// Save s
ettings
for the widget tab to a project file
/// Save s
tate
for the widget tab to a project file
virtual
std
::
string
saveToProject
()
const
=
0
;
protected:
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/InstrumentWidgetTreeTab.h
View file @
679610c7
...
...
@@ -19,10 +19,10 @@ class EXPORT_OPT_MANTIDQT_MANTIDWIDGETS InstrumentWidgetTreeTab
public:
explicit
InstrumentWidgetTreeTab
(
InstrumentWidget
*
instrWidget
);
void
initSurface
()
override
;
/// Load settings for the widget tab from a project file
/// Load settings for the
tree
widget tab from a project file
virtual
void
loadFromProject
(
const
std
::
string
&
lines
)
override
;
;
/// Save settings for the widget tab to a project file
/// Save settings for the
tree
widget tab to a project file
virtual
std
::
string
saveToProject
()
const
override
;
;
public
slots
:
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/Projection3D.h
View file @
679610c7
...
...
@@ -44,9 +44,9 @@ public:
void
getMaskedDetectors
(
QList
<
int
>
&
dets
)
const
override
;
void
resize
(
int
,
int
)
override
;
QString
getInfoText
()
const
override
;
/// Load settings for the
widget tab
from a project file
/// Load settings for the
3D projection
from a project file
virtual
void
loadFromProject
(
const
std
::
string
&
lines
)
override
;
/// Save settings for the
widget tab
to a project file
/// Save settings for the
3D projection
to a project file
virtual
std
::
string
saveToProject
()
const
override
;
signals:
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/ProjectionSurface.h
View file @
679610c7
...
...
@@ -136,9 +136,9 @@ public:
void
requestRedraw
(
bool
resetPeakVisibility
=
false
);
/// Enable lighting if the implementation allows it
void
enableLighting
(
bool
on
);
/// Load settings for the
widget tab
from a project file
/// Load settings for the
projection surface
from a project file
virtual
void
loadFromProject
(
const
std
::
string
&
lines
);
/// Save settings for the
widget tab
to a project file
/// Save settings for the
projection surface
to a project file
virtual
std
::
string
saveToProject
()
const
;
//-----------------------------------
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/Shape2D.h
View file @
679610c7
...
...
@@ -180,9 +180,9 @@ protected:
bool
m_visible
;
///< flag to show or hide the shape
private:
static
S
hape
2D
*
loadShape2DRectangle
(
const
std
::
string
&
lines
);
static
Shape2D
*
loadShape2D
Ring
(
const
std
::
string
&
lines
);
static
Shape2D
*
loadShape2DFree
(
const
std
::
string
&
lines
);
/// In
sta
n
ti
ate specif
c
s
hape
s from a type string
static
Shape2D
*
loadShape2D
FromType
(
const
std
::
string
&
type
,
const
std
::
string
&
lines
);
};
/**
...
...
@@ -207,9 +207,9 @@ public:
QStringList
getPointNames
()
const
override
{
return
QStringList
(
"center"
);
}
QPointF
getPoint
(
const
QString
&
prop
)
const
override
;
void
setPoint
(
const
QString
&
prop
,
const
QPointF
&
value
)
override
;
/// Load s
ettings
for the shape from a project file
/// Load s
tate
for the shape from a project file
static
Shape2D
*
loadFromProject
(
const
std
::
string
&
lines
);
/// Save s
ettings
for the
widget tab
to a project file
/// Save s
tate
for the
shape
to a project file
virtual
std
::
string
saveToProject
()
const
override
;
protected:
...
...
@@ -233,9 +233,9 @@ public:
return
m_boundingRect
.
contains
(
p
);
}
void
addToPath
(
QPainterPath
&
path
)
const
override
;
/// Load s
ettings
for the shape from a project file
/// Load s
tate
for the shape from a project file
static
Shape2D
*
loadFromProject
(
const
std
::
string
&
lines
);
/// Save s
ettings
for the
widget tab
to a project file
/// Save s
tate
for the
shape
to a project file
virtual
std
::
string
saveToProject
()
const
override
;
protected:
...
...
@@ -269,9 +269,9 @@ public:
void
setColor
(
const
QColor
&
color
)
override
;
QColor
getColor
()
const
override
{
return
m_outer_shape
->
getColor
();
}
const
Shape2D
*
getOuterShape
()
const
{
return
m_outer_shape
;
}
/// Load s
ettings
for the shape from a project file
/// Load s
tate
for the shape from a project file
static
Shape2D
*
loadFromProject
(
const
std
::
string
&
lines
);
/// Save s
ettings
for the
widget tab
to a project file
/// Save s
tate
for the
shape
to a project file
virtual
std
::
string
saveToProject
()
const
override
;
protected:
...
...
@@ -304,9 +304,9 @@ public:
void
addToPath
(
QPainterPath
&
path
)
const
override
;
void
addPolygon
(
const
QPolygonF
&
polygon
);
void
subtractPolygon
(
const
QPolygonF
&
polygon
);
/// Load s
ettings
for the shape from a project file
/// Load s
tate
for the shape from a project file
static
Shape2D
*
loadFromProject
(
const
std
::
string
&
lines
);
/// Save s
ettings
for the
widget tab
to a project file
/// Save s
tate
for the
shape
to a project file
virtual
std
::
string
saveToProject
()
const
override
;
protected:
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/Shape2DCollection.h
View file @
679610c7
...
...
@@ -85,9 +85,9 @@ public:
/// Change border color of all shapes.
void
changeBorderColor
(
const
QColor
&
color
);
/// Load settings for the
widget tab
from a project file
/// Load settings for the
shape 2D collection
from a project file
virtual
void
loadFromProject
(
const
std
::
string
&
lines
);
/// Save settings for the
widget tab
to a project file
/// Save settings for the
shape 2D collection
to a project file
virtual
std
::
string
saveToProject
()
const
override
;
signals:
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/UnwrappedSurface.h
View file @
679610c7
...
...
@@ -123,9 +123,9 @@ public:
/// Zoom into an area of the screen
void
zoom
(
const
QRectF
&
area
);
//@}
/// Load settings for the
widget tab
from a project file
/// Load settings for the
unwrapped surface
from a project file
virtual
void
loadFromProject
(
const
std
::
string
&
lines
)
override
;
/// Save settings for the
widget tab
to a project file
/// Save settings for the
unwrapped surface
to a project file
virtual
std
::
string
saveToProject
()
const
override
;
/// Get a handle to a peaks workspace from a name
boost
::
shared_ptr
<
Mantid
::
API
::
IPeaksWorkspace
>
...
...
MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp
View file @
679610c7
...
...
@@ -36,23 +36,23 @@
#endif
#endif
#include
<QVBoxLayout>
#include
<QHBoxLayout>
#include
<QGridLayout>
#include
<QPushButton>
#include
<QRadioButton>
#include
<QTextEdit>
#include
<QMenu>
#include
<QAction>
#include
<QLabel>
#include
<QMessageBox>
#include
<QApplication>
#include
<QCheckBox>
#include
<QFileDialog>
#include
<QToolTip>
#include
<QTemporaryFile>
#include
<QGridLayout>
#include
<QGroupBox>
#include
<QCheckBox>
#include
<QHBoxLayout>
#include
<QLabel>
#include
<QMenu>
#include
<QMessageBox>
#include
<QPushButton>
#include
<QRadioButton>
#include
<QSettings>
#include
<QTemporaryFile>
#include
<QTextEdit>
#include
<QToolTip>
#include
<QVBoxLayout>
#include
"MantidQtAPI/FileDialogHandler.h"
...
...
@@ -1182,46 +1182,46 @@ void InstrumentWidgetMaskTab::changedIntegrationRange(double, double) {
enableApplyButtons
();
}
/** Load mask tab settings from a Mantid project file
*
/** Load mask tab state from a Mantid project file
* @param lines :: lines from the project file to load state from
*/
void
InstrumentWidgetMaskTab
::
loadFromProject
(
const
std
::
string
&
lines
)
{
TSVSerialiser
tsv
(
lines
);
if
(
tsv
.
selectSection
(
"masktab"
))
{
std
::
string
tabLines
;
tsv
>>
tabLines
;
TSVSerialiser
tab
(
tabLines
);
if
(
!
tsv
.
selectSection
(
"masktab"
))
return
;
std
::
vector
<
QPushButton
*>
buttons
{
m_move
,
m_pointer
,
m_ellipse
,
m_rectangle
,
m_ring_el
li
p
se
,
m_ring_rectangle
,
m_free_draw
}
;
std
::
string
tabLines
;
tsv
>>
tabLines
;
TSVSeria
lise
r
tab
(
tabLines
)
;
tab
.
selectLine
(
"ActiveTools"
);
for
(
auto
button
:
buttons
)
{
bool
value
;
tab
>>
value
;
button
->
setChecked
(
value
);
}
std
::
vector
<
QPushButton
*>
buttons
{
m_move
,
m_pointer
,
m_ellipse
,
m_rectangle
,
m_ring_ellipse
,
m_ring_rectangle
,
m_free_draw
};
std
::
vector
<
QRadioButton
*>
typeButtons
{
m_masking_on
,
m_grouping_on
,
m_roi_on
};
tab
.
selectLine
(
"ActiveTools"
);
for
(
auto
button
:
buttons
)
{
bool
value
;
tab
>>
value
;
button
->
setChecked
(
value
);
}
tab
.
selectLine
(
"ActiveType"
);
for
(
auto
type
:
typeButtons
)
{
bool
value
;
tab
>>
value
;
type
->
setChecked
(
value
);
}
std
::
vector
<
QRadioButton
*>
typeButtons
{
m_masking_on
,
m_grouping_on
,
m_roi_on
};
if
(
tab
.
selectLine
(
"MaskViewWorkspace"
))
{
// the view was masked. We should load reapply this from a cached
// workspace in the project folder
std
::
string
maskWSName
;
tab
>>
maskWSName
;
loadMaskViewFromProject
(
maskWSName
);
}
tab
.
selectLine
(
"ActiveType"
);
for
(
auto
type
:
typeButtons
)
{
bool
value
;
tab
>>
value
;
type
->
setChecked
(
value
);
}
if
(
tab
.
selectLine
(
"MaskViewWorkspace"
))
{
// the view was masked. We should load reapply this from a cached
// workspace in the project folder
std
::
string
maskWSName
;
tab
>>
maskWSName
;
loadMaskViewFromProject
(
maskWSName
);
}
}
...
...
@@ -1294,7 +1294,6 @@ InstrumentWidgetMaskTab::loadMask(const std::string &fileName) {
}
/** Save the state of the mask tab to a Mantid project file
*
* @return a string representing the state of the mask tab
*/
std
::
string
InstrumentWidgetMaskTab
::
saveToProject
()
const
{
...
...
MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
View file @
679610c7
...
...
@@ -696,6 +696,55 @@ void InstrumentWidgetPickTab::savePlotToWorkspace() {
m_plotController
->
savePlotToWorkspace
();
}
/** Load pick tab state from a Mantid project file
* @param lines :: lines from the project file to load state from
*/
void
InstrumentWidgetPickTab
::
loadFromProject
(
const
std
::
string
&
lines
)
{
TSVSerialiser
tsv
(
lines
);
if
(
!
tsv
.
selectSection
(
"picktab"
))
return
;
std
::
string
tabLines
;
tsv
>>
tabLines
;
TSVSerialiser
tab
(
tabLines
);
// load active push button
std
::
vector
<
QPushButton
*>
buttons
{
m_zoom
,
m_edit
,
m_ellipse
,
m_rectangle
,
m_ring_ellipse
,
m_ring_rectangle
,
m_free_draw
,
m_one
,
m_tube
,
m_peak
,
m_peakSelect
};
tab
.
selectLine
(
"ActiveTools"
);
for
(
auto
button
:
buttons
)
{
bool
value
;
tab
>>
value
;
button
->
setChecked
(
value
);
}
}
/** Save the state of the pick tab to a Mantid project file
* @return a string representing the state of the pick tab
*/
std
::
string
InstrumentWidgetPickTab
::
saveToProject
()
const
{
TSVSerialiser
tsv
;
TSVSerialiser
tab
;
// save active push button
std
::
vector
<
QPushButton
*>
buttons
{
m_zoom
,
m_edit
,
m_ellipse
,
m_rectangle
,
m_ring_ellipse
,
m_ring_rectangle
,
m_free_draw
,
m_one
,
m_tube
,
m_peak
,
m_peakSelect
};
tab
.
writeLine
(
"ActiveTools"
);
for
(
auto
button
:
buttons
)
{
tab
<<
button
->
isChecked
();
}
tsv
.
writeSection
(
"picktab"
,
tab
.
outputLines
());
return
tsv
.
outputLines
();
}
//=====================================================================================//
/**
...
...
@@ -1631,49 +1680,5 @@ void DetectorPlotController::addPeak(double x, double y) {
}
}
void
MantidQt
::
MantidWidgets
::
InstrumentWidgetPickTab
::
loadFromProject
(
const
std
::
string
&
lines
)
{
TSVSerialiser
tsv
(
lines
);
if
(
tsv
.
selectSection
(
"picktab"
))
{
std
::
string
tabLines
;
tsv
>>
tabLines
;
TSVSerialiser
tab
(
tabLines
);
// load active push button
std
::
vector
<
QPushButton
*>
buttons
{
m_zoom
,
m_edit
,
m_ellipse
,
m_rectangle
,
m_ring_ellipse
,
m_ring_rectangle
,
m_free_draw
,
m_one
,
m_tube
,
m_peak
,
m_peakSelect
};
tab
.
selectLine
(
"ActiveTools"
);
for
(
auto
button
:
buttons
)
{
bool
value
;
tab
>>
value
;
button
->
setChecked
(
value
);
}
}
}
std
::
string
MantidQt
::
MantidWidgets
::
InstrumentWidgetPickTab
::
saveToProject
()
const
{
TSVSerialiser
tsv
;
TSVSerialiser
tab
;
// save active push button
std
::
vector
<
QPushButton
*>
buttons
{
m_zoom
,
m_edit
,
m_ellipse
,
m_rectangle
,
m_ring_ellipse
,
m_ring_rectangle
,
m_free_draw
,
m_one
,
m_tube
,
m_peak
,
m_peakSelect
};
tab
.
writeLine
(
"ActiveTools"
);
for
(
auto
button
:
buttons
)
{
tab
<<
button
->
isChecked
();
}
tsv
.
writeSection
(
"picktab"
,
tab
.
outputLines
());
return
tsv
.
outputLines
();
}
}
// MantidWidgets
}
// MantidQt
MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp
View file @
679610c7
...
...
@@ -769,63 +769,64 @@ MantidQt::MantidWidgets::InstrumentWidgetRenderTab::saveToProject() const {
void
InstrumentWidgetRenderTab
::
loadFromProject
(
const
std
::
string
&
lines
)
{
TSVSerialiser
tsv
(
lines
);
if
(
tsv
.
selectSection
(
"rendertab"
))
{
std
::
string
tabLines
;
tsv
>>
tabLines
;
TSVSerialiser
tab
(
tabLines
);
bool
autoScaling
,
displayAxes
,
flipView
,
displayDetectorsOnly
,
displayWireframe
,
displayLighting
,
useOpenGL
,
useUCorrection
;
int
axesView
;
tab
.
selectLine
(
"AxesView"
);
tab
>>
axesView
;
tab
.
selectLine
(
"AutoScaling"
);
tab
>>
autoScaling
;
tab
.
selectLine
(
"DisplayAxes"
);
tab
>>
displayAxes
;
tab
.
selectLine
(
"FlipView"
);
tab
>>
flipView
;
tab
.
selectLine
(
"DisplayDetectorsOnly"
);
tab
>>
displayDetectorsOnly
;
tab
.
selectLine
(
"DisplayWireframe"
);
tab
>>
displayWireframe
;
tab
.
selectLine
(
"DisplayLighting"
);
tab
>>
displayLighting
;
tab
.
selectLine
(
"UseOpenGL"
);
tab
>>
useOpenGL
;
tab
.
selectLine
(
"UseUCorrection"
);