diff --git a/MantidPlot/src/Graph.cpp b/MantidPlot/src/Graph.cpp index 5caf29ec857079c15f55871de3eaaf09318defa4..9c03c6a77532c43df51f04c9f3d4160c54552343 100644 --- a/MantidPlot/src/Graph.cpp +++ b/MantidPlot/src/Graph.cpp @@ -5642,7 +5642,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app, enableAutoscaling(app->autoscale2DPlots); - TSVSerialiser tsv(lines); + MantidQt::API::TSVSerialiser tsv(lines); if (tsv.selectSection("Antialiasing")) { int aa; @@ -6183,7 +6183,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app, std::vector<std::string> specSections = tsv.sections("spectrogram"); for (auto it = specSections.begin(); it != specSections.end(); ++it) { - TSVSerialiser specTSV(*it); + MantidQt::API::TSVSerialiser specTSV(*it); if (specTSV.selectLine("workspace")) { std::string wsName; @@ -6308,7 +6308,7 @@ void Graph::loadFromProject(const std::string &lines, ApplicationWindow *app, } std::string Graph::saveToProject() { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeLine("ggeometry") << pos().x() << pos().y() << frameGeometry().width() @@ -6620,7 +6620,7 @@ std::string Graph::saveCurve(int i) { } std::string Graph::saveScale() { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; for (int i = 0; i < 4; i++) { tsv.writeLine("scale") << i; @@ -6664,7 +6664,7 @@ std::string Graph::saveScale() { } std::string Graph::saveMarkers() { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; for (int i = 0; i < d_images.size(); ++i) { auto mrkI = dynamic_cast<ImageMarker *>(d_plot->marker(d_images[i])); if (!mrkI) diff --git a/MantidPlot/src/Graph3D.cpp b/MantidPlot/src/Graph3D.cpp index da3a323c7357730dfabe3ef346e115ab7aaf0da0..abf4e4f3641df75bf8da7102b4caebe41ae0a2b5 100644 --- a/MantidPlot/src/Graph3D.cpp +++ b/MantidPlot/src/Graph3D.cpp @@ -2516,7 +2516,7 @@ IProjectSerialisable *Graph3D::loadFromProject(const std::string &lines, const std::string tsvLines = boost::algorithm::join(lineVec, "\n"); - TSVSerialiser tsv(tsvLines); + MantidQt::API::TSVSerialiser tsv(tsvLines); if (tsv.selectLine("SurfaceFunction")) { auto params = graph->readSurfaceFunction(tsv); @@ -2784,7 +2784,7 @@ void Graph3D::setupMatrixPlot3D(ApplicationWindow *app, const QString &caption, } void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app, - TSVSerialiser &tsv) { + MantidQt::API::TSVSerialiser &tsv) { using MantidQt::API::PlotAxis; MantidMatrix *matrix = readWorkspaceForPlot(app, tsv); int style = read3DPlotStyle(tsv); @@ -2835,7 +2835,7 @@ void Graph3D::setupMantidMatrixPlot3D(ApplicationWindow *app, } MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app, - TSVSerialiser &tsv) { + MantidQt::API::TSVSerialiser &tsv) { MantidMatrix *m = nullptr; if (tsv.selectLine("title")) { std::string wsName = tsv.asString(1); @@ -2851,7 +2851,7 @@ MantidMatrix *Graph3D::readWorkspaceForPlot(ApplicationWindow *app, return m; } -int Graph3D::read3DPlotStyle(TSVSerialiser &tsv) { +int Graph3D::read3DPlotStyle(MantidQt::API::TSVSerialiser &tsv) { int style = Qwt3D::WIREFRAME; if (tsv.selectLine("Style")) tsv >> style; @@ -2859,7 +2859,7 @@ int Graph3D::read3DPlotStyle(TSVSerialiser &tsv) { } Graph3D::SurfaceFunctionParams -Graph3D::readSurfaceFunction(TSVSerialiser &tsv) { +Graph3D::readSurfaceFunction(MantidQt::API::TSVSerialiser &tsv) { SurfaceFunctionParams params; tsv >> params.formula; params.type = readSurfaceFunctionType(params.formula); @@ -2928,7 +2928,7 @@ Graph3D::readSurfaceFunctionType(const std::string &formula) { } std::string Graph3D::saveToProject(ApplicationWindow *app) { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeRaw("<SurfacePlot>"); tsv.writeLine(name().toStdString()) << birthDate(); tsv.writeRaw(app->windowGeometryInfo(this)); diff --git a/MantidPlot/src/Graph3D.h b/MantidPlot/src/Graph3D.h index 565cb62a570bfdf1a998bf5f017a23110aa84553..108b3658b9bb280cb6929faa6074fa005d742d49 100644 --- a/MantidPlot/src/Graph3D.h +++ b/MantidPlot/src/Graph3D.h @@ -416,13 +416,15 @@ signals: void modified(); private: - Graph3D::SurfaceFunctionParams readSurfaceFunction(TSVSerialiser &tsv); + Graph3D::SurfaceFunctionParams + readSurfaceFunction(MantidQt::API::TSVSerialiser &tsv); Graph3D::SurfaceFunctionType readSurfaceFunctionType(const std::string &formula); MantidMatrix *readWorkspaceForPlot(ApplicationWindow *app, - TSVSerialiser &tsv); - int read3DPlotStyle(TSVSerialiser &tsv); - void setupMantidMatrixPlot3D(ApplicationWindow *app, TSVSerialiser &tsv); + MantidQt::API::TSVSerialiser &tsv); + int read3DPlotStyle(MantidQt::API::TSVSerialiser &tsv); + void setupMantidMatrixPlot3D(ApplicationWindow *app, + MantidQt::API::TSVSerialiser &tsv); void setupPlot3D(ApplicationWindow *app, const QString &caption, const SurfaceFunctionParams ¶ms); void setupPlotXYZ(ApplicationWindow *app, const QString &caption, diff --git a/MantidPlot/src/Grid.cpp b/MantidPlot/src/Grid.cpp index 94f7095353a193d1acdcef022dffb89bd58677fb..e8b2969547a2833f10f50f5b660baf242cbf611a 100644 --- a/MantidPlot/src/Grid.cpp +++ b/MantidPlot/src/Grid.cpp @@ -261,7 +261,7 @@ void Grid::copy(Grid *grid) { } std::string Grid::saveToString() { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeLine("grid"); tsv << xEnabled() << xMinEnabled(); diff --git a/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp b/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp index afd8b4b583b1b0068664562f450db69a3f94b6b0..b46452ba5810335f5e28151d9e8b86e3bb62b36d 100644 --- a/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp +++ b/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp @@ -49,7 +49,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject( const std::string &lines, ApplicationWindow *app, const int fileVersion) { Q_UNUSED(fileVersion); - TSVSerialiser tsv(lines); + MantidQt::API::TSVSerialiser tsv(lines); if (!tsv.selectLine("WorkspaceName")) return nullptr; @@ -103,7 +103,7 @@ IProjectSerialisable *InstrumentWindow::loadFromProject( * @return a string representing the state of the instrument window */ std::string InstrumentWindow::saveToProject(ApplicationWindow *app) { - TSVSerialiser tsv, window; + MantidQt::API::TSVSerialiser tsv, window; window.writeRaw(app->windowGeometryInfo(this)); auto widgetContents = m_instrumentWidget->saveToProject(); window.writeRaw(widgetContents); diff --git a/MantidPlot/src/Matrix.cpp b/MantidPlot/src/Matrix.cpp index fb3b7fdd6925c55f5885026f1de42f042e4fff99..e574a618d054ff604280e0d66de5d7bd53dfe116 100644 --- a/MantidPlot/src/Matrix.cpp +++ b/MantidPlot/src/Matrix.cpp @@ -1534,7 +1534,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines, Mantid::Kernel::Strings::convert<int>(values[1], rows); Mantid::Kernel::Strings::convert<int>(values[2], cols); - TSVSerialiser tsv(newLines); + MantidQt::API::TSVSerialiser tsv(newLines); std::string gStr; if (tsv.hasLine("geometry")) { gStr = tsv.lineAsString("geometry"); @@ -1642,7 +1642,7 @@ IProjectSerialisable *Matrix::loadFromProject(const std::string &lines, } std::string Matrix::saveToProject(ApplicationWindow *app) { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeRaw("<matrix>"); tsv.writeLine(objectName().toStdString()) << numRows() << numCols() diff --git a/MantidPlot/src/MatrixModel.cpp b/MantidPlot/src/MatrixModel.cpp index 81fa3fddeeb5db4cce6fe2adc968e4b4548fc527..041461401c973e44e5254c93fe989e3900796bd1 100644 --- a/MantidPlot/src/MatrixModel.cpp +++ b/MantidPlot/src/MatrixModel.cpp @@ -1014,7 +1014,7 @@ void MatrixModel::pasteData(double *clipboardBuffer, int topRow, int leftCol, MatrixModel::~MatrixModel() { free(d_data); } std::string MatrixModel::saveToProject() { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; for (int row = 0; row < d_rows; ++row) { // Index to the first element of each row diff --git a/MantidPlot/src/MultiLayer.cpp b/MantidPlot/src/MultiLayer.cpp index b576628f5f0c3c3dc91e968ae8d8624a0b3d9f4b..a8d7523ed450a7a03311f3b37f1b750ee25c2725 100644 --- a/MantidPlot/src/MultiLayer.cpp +++ b/MantidPlot/src/MultiLayer.cpp @@ -1758,7 +1758,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines, auto multiLayer = new MultiLayer(app, 0, rows, cols); - TSVSerialiser tsv(lines); + MantidQt::API::TSVSerialiser tsv(lines); multiLayer->blockSignals(true); @@ -1805,7 +1805,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines, for (auto it = graphSections.cbegin(); it != graphSections.cend(); ++it) { auto graphLines = *it; - TSVSerialiser gtsv(graphLines); + MantidQt::API::TSVSerialiser gtsv(graphLines); if (gtsv.selectLine("ggeometry")) { int x = 0, y = 0, w = 0, h = 0; @@ -1833,7 +1833,7 @@ IProjectSerialisable *MultiLayer::loadFromProject(const std::string &lines, } std::string MultiLayer::saveToProject(ApplicationWindow *app) { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeRaw("<multiLayer>"); diff --git a/MantidPlot/src/Note.cpp b/MantidPlot/src/Note.cpp index 2ba8c91c19c12652098bdba3cba0afe218ecf299..6b4533f249324cd65f0ffdefa32140da0d2cd266 100644 --- a/MantidPlot/src/Note.cpp +++ b/MantidPlot/src/Note.cpp @@ -155,7 +155,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines, app->setListViewDate(name, date); note->setBirthDate(date); - TSVSerialiser tsv(lines); + MantidQt::API::TSVSerialiser tsv(lines); if (tsv.hasLine("geometry")) { const QString geometry = @@ -186,7 +186,7 @@ IProjectSerialisable *Note::loadFromProject(const std::string &lines, } std::string Note::saveToProject(ApplicationWindow *app) { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeRaw("<note>"); tsv.writeLine(name().toStdString()) << birthDate(); tsv.writeRaw(app->windowGeometryInfo(this)); diff --git a/MantidPlot/src/ScriptingWindow.cpp b/MantidPlot/src/ScriptingWindow.cpp index db7d991673ff173f24315bbd3a6aa3c3d53dfce3..39000594e54561a9031b621f3bd1b36c9e98c535 100644 --- a/MantidPlot/src/ScriptingWindow.cpp +++ b/MantidPlot/src/ScriptingWindow.cpp @@ -435,7 +435,7 @@ void ScriptingWindow::loadFromProject(const std::string &lines, const int fileVersion) { Q_UNUSED(fileVersion); - TSVSerialiser sTSV(lines); + MantidQt::API::TSVSerialiser sTSV(lines); QStringList files; setWindowTitle("MantidPlot: " + app->scriptingEnv()->languageName() + diff --git a/MantidPlot/src/Spectrogram.cpp b/MantidPlot/src/Spectrogram.cpp index 20fb1e87ae79793edd91dcc4f4d16beb7c5c11c7..125a7ccf5287e5fcf6fe3eb0c2644534b0e047ff 100644 --- a/MantidPlot/src/Spectrogram.cpp +++ b/MantidPlot/src/Spectrogram.cpp @@ -1015,7 +1015,7 @@ QImage Spectrogram::renderImage(const QwtScaleMap &xMap, void Spectrogram::loadFromProject(const std::string &lines) { using namespace Mantid::Kernel; - TSVSerialiser tsv(lines); + MantidQt::API::TSVSerialiser tsv(lines); if (tsv.hasSection("ColorPolicy")) { std::string policyStr = tsv.sections("ColorPolicy").front(); @@ -1027,7 +1027,7 @@ void Spectrogram::loadFromProject(const std::string &lines) { setDefaultColorMap(); } else if (tsv.hasSection("ColorMap")) { const std::string cmStr = tsv.sections("ColorMap").front(); - TSVSerialiser cm(cmStr); + MantidQt::API::TSVSerialiser cm(cmStr); std::string filename; if (cm.selectLine("FileName")) @@ -1073,7 +1073,7 @@ void Spectrogram::loadFromProject(const std::string &lines) { if (tsv.hasSection("ColorBar")) { const std::string cbStr = tsv.sections("ColorBar").front(); - TSVSerialiser cb(cbStr); + MantidQt::API::TSVSerialiser cb(cbStr); std::string axisStr = cb.sections("axis")[0]; std::string widthStr = cb.sections("width")[0]; @@ -1105,7 +1105,7 @@ void Spectrogram::loadFromProject(const std::string &lines) { std::string Spectrogram::saveToProject() { using namespace Mantid::Kernel; - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeRaw("<spectrogram>"); if (!d_wsName.empty()) tsv.writeLine("workspace") << d_wsName; @@ -1116,7 +1116,7 @@ std::string Spectrogram::saveToProject() { tsv.writeInlineSection("ColorPolicy", Strings::toString<int>(color_map_policy)); else { - TSVSerialiser cm; + MantidQt::API::TSVSerialiser cm; if (!mCurrentColorMap.isEmpty()) cm.writeLine("FileName") << mCurrentColorMap.toStdString(); cm.writeInlineSection("Mode", Strings::toString<int>(color_map.mode())); @@ -1143,7 +1143,7 @@ std::string Spectrogram::saveToProject() { QwtScaleWidget *colorAxis = plot()->axisWidget(color_axis); if (colorAxis && colorAxis->isColorBarEnabled()) { - TSVSerialiser cb; + MantidQt::API::TSVSerialiser cb; cb.writeInlineSection("axis", Strings::toString<int>(color_axis)); cb.writeInlineSection("width", Strings::toString<int>(colorAxis->colorBarWidth())); diff --git a/MantidPlot/src/Table.cpp b/MantidPlot/src/Table.cpp index 2ee301d7842918ee5e62221e3aec2114014edc1b..578e5f265400122c47cb17e4ebaa469684d9d2c6 100644 --- a/MantidPlot/src/Table.cpp +++ b/MantidPlot/src/Table.cpp @@ -638,7 +638,7 @@ void Table::updateValues(Table *t, const QString &columnName) { } std::string Table::saveToProject(ApplicationWindow *app) { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeRaw("<table>"); tsv.writeLine(objectName().toStdString()) @@ -3036,7 +3036,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines, } } - TSVSerialiser tsv(lines); + MantidQt::API::TSVSerialiser tsv(lines); if (tsv.selectLine("geometry")) app->restoreWindowGeometry( @@ -3176,7 +3176,7 @@ IProjectSerialisable *Table::loadFromProject(const std::string &lines, } std::string Table::saveTableMetadata() { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeLine("header"); for (int j = 0; j < d_table->columnCount(); j++) { QString val = colLabel(j); diff --git a/MantidPlot/src/TableStatistics.cpp b/MantidPlot/src/TableStatistics.cpp index c694c51c5b8332b4225f9854a4dc4e25adaa5a5c..dbd20622a4f02c231a5b2abcdb3c474dac2248a7 100644 --- a/MantidPlot/src/TableStatistics.cpp +++ b/MantidPlot/src/TableStatistics.cpp @@ -293,7 +293,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines, const std::string type = firstLineVec[2]; QString birthDate = QString::fromStdString(firstLineVec[3]); - TSVSerialiser tsv(lines); + MantidQt::API::TSVSerialiser tsv(lines); if (!tsv.hasLine("Targets")) return nullptr; @@ -406,7 +406,7 @@ IProjectSerialisable *TableStatistics::loadFromProject(const std::string &lines, } std::string TableStatistics::saveToProject(ApplicationWindow *app) { - TSVSerialiser tsv; + MantidQt::API::TSVSerialiser tsv; tsv.writeRaw("<TableStatistics>"); tsv.writeLine(objectName().toStdString()); diff --git a/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h b/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h index a261f219fac1fa5c77b60f8bad1d235578606bbf..314bd4f44724f4893d9aa72b13c3c52a8292741a 100644 --- a/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h +++ b/MantidQt/API/inc/MantidQtAPI/TSVSerialiser.h @@ -1,6 +1,7 @@ #ifndef MANTID_TSVSERIALISER_H_ #define MANTID_TSVSERIALISER_H_ +#include "DllOption.h" #include "MantidKernel/CaseInsensitiveMap.h" #include <map> @@ -39,7 +40,10 @@ File change history is stored at: <https://github.com/mantidproject/mantid> */ -class TSVSerialiser { +namespace MantidQt { +namespace API { + +class EXPORT_OPT_MANTIDQT_API TSVSerialiser { public: TSVSerialiser(); @@ -108,5 +112,7 @@ private: std::stringstream m_output; bool m_midLine; }; +} +} #endif diff --git a/MantidQt/API/src/TSVSerialiser.cpp b/MantidQt/API/src/TSVSerialiser.cpp index db5f268e722b988e69f912da9ab836e4c975923f..986142edae8950230c476e22422a1fa40abcda16 100644 --- a/MantidQt/API/src/TSVSerialiser.cpp +++ b/MantidQt/API/src/TSVSerialiser.cpp @@ -10,6 +10,8 @@ namespace { Mantid::Kernel::Logger g_log("TSVSerialiser"); } +using namespace MantidQt::API; + TSVSerialiser::TSVSerialiser() : m_curIndex(0), m_midLine(false) {} TSVSerialiser::TSVSerialiser(const std::string &lines) diff --git a/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp b/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp index b8e7f33aedd4b949bf8656a468197f604d7cd6f1..7b6f82756479471ab0ae1d61cdd3f50f9a6a3924 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/ColorMapWidget.cpp @@ -327,7 +327,7 @@ void ColorMapWidget::mouseReleaseEvent(QMouseEvent * /*e*/) { * @return string representing the current state of the color map widget. */ std::string ColorMapWidget::saveToProject() const { - TSVSerialiser tsv, cm; + API::TSVSerialiser tsv, cm; cm.writeLine("ScaleType") << getScaleType(); cm.writeLine("Power") << getNth_power(); cm.writeLine("MinValue") << getMinValue(); @@ -342,11 +342,11 @@ std::string ColorMapWidget::saveToProject() const { * widget. */ void ColorMapWidget::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (tsv.selectSection("colormap")) { std::string colorMapLines; tsv >> colorMapLines; - TSVSerialiser cm(colorMapLines); + API::TSVSerialiser cm(colorMapLines); int scaleType; double min, max, power; diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp index 363eb68e4ef6b996a39375d2be0cb75608e3ad73..2d46267da8af43d62a76a908ce9687094c135c04 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp @@ -1289,7 +1289,7 @@ bool FindComponentVisitor::visit(GLActor *actor) { * @return string representing the current state of the instrumet actor. */ std::string InstrumentActor::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; const std::string currentColorMap = getCurrentColorMap().toStdString(); if (!currentColorMap.empty()) @@ -1304,7 +1304,7 @@ std::string InstrumentActor::saveToProject() const { * @param lines :: string representing the current state of the instrumet actor. */ void InstrumentActor::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (tsv.selectLine("FileName")) { QString filename; tsv >> filename; diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp index c6afbda0932b7bdc38f2012e3a5466c4643874a8..24d926a82f94cd5c5f9b764e6b650152279e6e77 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp @@ -1186,14 +1186,14 @@ void InstrumentWidgetMaskTab::changedIntegrationRange(double, double) { * @param lines :: lines from the project file to load state from */ void InstrumentWidgetMaskTab::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (!tsv.selectSection("masktab")) return; std::string tabLines; tsv >> tabLines; - TSVSerialiser tab(tabLines); + API::TSVSerialiser tab(tabLines); std::vector<QPushButton *> buttons{ m_move, m_pointer, m_ellipse, m_rectangle, @@ -1297,8 +1297,8 @@ InstrumentWidgetMaskTab::loadMask(const std::string &fileName) { * @return a string representing the state of the mask tab */ std::string InstrumentWidgetMaskTab::saveToProject() const { - TSVSerialiser tsv; - TSVSerialiser tab; + API::TSVSerialiser tsv; + API::TSVSerialiser tab; std::vector<QPushButton *> buttons{ m_move, m_pointer, m_ellipse, m_rectangle, diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp index 571bfc049539ac6a43d36dc485395a29920cbaa5..f604ed4bc0bd01e29a4b60a062cf91b49ac36be6 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp @@ -700,14 +700,14 @@ void InstrumentWidgetPickTab::savePlotToWorkspace() { * @param lines :: lines from the project file to load state from */ void InstrumentWidgetPickTab::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (!tsv.selectSection("picktab")) return; std::string tabLines; tsv >> tabLines; - TSVSerialiser tab(tabLines); + API::TSVSerialiser tab(tabLines); // load active push button std::vector<QPushButton *> buttons{ @@ -726,8 +726,7 @@ void InstrumentWidgetPickTab::loadFromProject(const std::string &lines) { * @return a string representing the state of the pick tab */ std::string InstrumentWidgetPickTab::saveToProject() const { - TSVSerialiser tsv; - TSVSerialiser tab; + API::TSVSerialiser tsv, tab; // save active push button std::vector<QPushButton *> buttons{ diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp index 1a8e6167024da64459d68c08738b34b6b38f1129..abb0a2e9ac5c902b0c7bfebe69309d5e821ae0bc 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetRenderTab.cpp @@ -734,7 +734,7 @@ QPointF InstrumentWidgetRenderTab::getUCorrection() const { */ std::string MantidQt::MantidWidgets::InstrumentWidgetRenderTab::saveToProject() const { - TSVSerialiser tab; + API::TSVSerialiser tab; tab.writeLine("AxesView") << mAxisCombo->currentIndex(); tab.writeLine("AutoScaling") << m_autoscaling->isChecked(); @@ -757,7 +757,7 @@ MantidQt::MantidWidgets::InstrumentWidgetRenderTab::saveToProject() const { const auto colorMap = m_colorMapWidget->saveToProject(); tab.writeRaw(colorMap); - TSVSerialiser tsv; + API::TSVSerialiser tsv; tsv.writeSection("rendertab", tab.outputLines()); return tsv.outputLines(); } @@ -767,14 +767,14 @@ MantidQt::MantidWidgets::InstrumentWidgetRenderTab::saveToProject() const { * @param lines :: lines defining the state of the render tab */ void InstrumentWidgetRenderTab::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (!tsv.selectSection("rendertab")) return; std::string tabLines; tsv >> tabLines; - TSVSerialiser tab(tabLines); + API::TSVSerialiser tab(tabLines); bool autoScaling, displayAxes, flipView, displayDetectorsOnly, displayWireframe, displayLighting, useOpenGL, useUCorrection; diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp index 49a8788988702018d97e8c19c073dd5d4312f6c3..21e2c8be065cbe3e3a5c30af2cd6f3250144eee4 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetTreeTab.cpp @@ -65,14 +65,14 @@ void InstrumentWidgetTreeTab::showEvent(QShowEvent *) { * @param lines :: lines from the project file to load state from */ void InstrumentWidgetTreeTab::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (!tsv.selectSection("treetab")) return; std::string tabLines; tsv >> tabLines; - TSVSerialiser tab(tabLines); + API::TSVSerialiser tab(tabLines); std::string componentName; if (tab.selectLine("SelectedComponent")) { @@ -85,8 +85,7 @@ void InstrumentWidgetTreeTab::loadFromProject(const std::string &lines) { * @return a string representing the state of the tree tab */ std::string InstrumentWidgetTreeTab::saveToProject() const { - TSVSerialiser tsv; - TSVSerialiser tab; + API::TSVSerialiser tsv, tab; auto index = m_instrumentTree->currentIndex(); auto model = index.model(); diff --git a/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp b/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp index 2e69849a1f7ca7e31e6acb7b071579b79a042690..02fbfed1c51e8391c2320e64b23e17fdf1f7c6bc 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/MaskBinsData.cpp @@ -62,9 +62,9 @@ void MaskBinsData::clear() { m_masks.clear(); } * @param lines :: lines from the project file to load state from */ void MaskBinsData::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); for (auto &maskLines : tsv.sections("Mask")) { - TSVSerialiser mask(maskLines); + API::TSVSerialiser mask(maskLines); mask.selectLine("Range"); double start, end; mask >> start >> end; @@ -85,9 +85,9 @@ void MaskBinsData::loadFromProject(const std::string &lines) { * @return a string representing the state of the mask bins */ std::string MaskBinsData::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; for (const auto &binMask : m_masks) { - TSVSerialiser mask; + API::TSVSerialiser mask; mask.writeLine("Range") << binMask.start << binMask.end; mask.writeLine("Spectra"); for (const int spectrum : binMask.spectra) { diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp index 43a732e4e9b12f38a2345b7ca2c79905196ec33b..a7ecee99229cdacc972f9de58056d78161daecc8 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp @@ -467,7 +467,7 @@ void Projection3D::setLightingModel(bool picking) const { */ void Projection3D::loadFromProject(const std::string &lines) { ProjectionSurface::loadFromProject(lines); - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (tsv.selectSection("Viewport")) { std::string viewportLines; @@ -480,7 +480,7 @@ void Projection3D::loadFromProject(const std::string &lines) { * @return a string representing the state of the 3D projection */ std::string Projection3D::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; tsv.writeRaw(ProjectionSurface::saveToProject()); tsv.writeSection("Viewport", m_viewport.saveToProject()); return tsv.outputLines(); diff --git a/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp b/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp index 6349bce5cbf3ead4b09469e811d510bcb74f21e3..b440b32c6ddba00da0c774e817dd20d8e1e39432 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp @@ -722,7 +722,7 @@ QStringList ProjectionSurface::getPeaksWorkspaceNames() const { * @param lines :: lines from the project file to load state from */ void ProjectionSurface::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (tsv.selectLine("BackgroundColor")) { tsv >> m_backgroundColor; @@ -739,7 +739,7 @@ void ProjectionSurface::loadFromProject(const std::string &lines) { * @return a string representing the state of the projection surface */ std::string ProjectionSurface::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; tsv.writeLine("BackgroundColor") << m_backgroundColor; tsv.writeSection("shapes", m_maskShapes.saveToProject()); return tsv.outputLines(); diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp index c1e08874c9c41ae59361d9d38aac0653fd1e93fa..07e6f3ba7f92a5ffcd74894271dc4f3470d7650c 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/Shape2D.cpp @@ -160,7 +160,7 @@ bool Shape2D::isMasked(const QPointF &p) const { * @return a new shape2D with old state applied */ Shape2D *Shape2D::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (!tsv.selectLine("Type")) return nullptr; @@ -225,7 +225,7 @@ Shape2D *Shape2D::loadShape2DFromType(const std::string &type, * @return a string representing the state of the shape 2D */ std::string Shape2D::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; bool props[]{m_scalable, m_editing, m_selected, m_visible}; tsv.writeLine("Properties"); @@ -353,7 +353,7 @@ void Shape2DEllipse::setPoint(const QString &prop, const QPointF &value) { * @return a new shape2D in the shape of a ellipse */ Shape2D *Shape2DEllipse::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); tsv.selectLine("Parameters"); double radius1, radius2, x, y; tsv >> radius1 >> radius2 >> x >> y; @@ -364,7 +364,7 @@ Shape2D *Shape2DEllipse::loadFromProject(const std::string &lines) { * @return a string representing the state of the shape 2D */ std::string Shape2DEllipse::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; double radius1 = getDouble("radius1"); double radius2 = getDouble("radius2"); auto centre = getPoint("centre"); @@ -417,7 +417,7 @@ void Shape2DRectangle::addToPath(QPainterPath &path) const { * @return a new shape2D in the shape of a rectangle */ Shape2D *Shape2DRectangle::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); tsv.selectLine("Parameters"); double x0, y0, x1, y1; tsv >> x0 >> y0 >> x1 >> y1; @@ -430,7 +430,7 @@ Shape2D *Shape2DRectangle::loadFromProject(const std::string &lines) { * @return a string representing the state of the shape 2D */ std::string Shape2DRectangle::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; auto x0 = m_boundingRect.x0(); auto x1 = m_boundingRect.x1(); auto y0 = m_boundingRect.y0(); @@ -586,7 +586,7 @@ void Shape2DRing::setColor(const QColor &color) { * @return a new shape2D in the shape of a ring */ Shape2D *Shape2DRing::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); tsv.selectLine("Parameters"); double xWidth, yWidth; tsv >> xWidth >> yWidth; @@ -603,7 +603,7 @@ Shape2D *Shape2DRing::loadFromProject(const std::string &lines) { * @return a string representing the state of the shape 2D */ std::string Shape2DRing::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; auto xWidth = getDouble("xwidth"); auto yWidth = getDouble("ywidth"); auto baseShape = getOuterShape(); @@ -754,7 +754,7 @@ void Shape2DFree::subtractPolygon(const QPolygonF &polygon) { * @return a new freefrom shape2D */ Shape2D *Shape2DFree::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); QPolygonF polygon; size_t paramCount = tsv.values("Parameters").size() - 1; @@ -773,7 +773,7 @@ Shape2D *Shape2DFree::loadFromProject(const std::string &lines) { * @return a string representing the state of the shape 2D */ std::string Shape2DFree::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; tsv.writeLine("Type") << "free"; tsv.writeLine("Parameters"); diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp index 0abbe62468c4bc074401198ff95d05847319e381..e9240f8787d1accc77a95a276b3adf059e83ff27 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp @@ -669,7 +669,7 @@ void Shape2DCollection::eraseFree(const QPolygonF &polygon) { * @param lines :: lines from the project file to load state from */ void Shape2DCollection::loadFromProject(const std::string &lines) { - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); for (auto shapeLines : tsv.sections("shape")) { Shape2D *shape = Shape2D::loadFromProject(shapeLines); addShape(shape, false); @@ -680,7 +680,7 @@ void Shape2DCollection::loadFromProject(const std::string &lines) { * @return a string representing the state of the shape 2D collection */ std::string Shape2DCollection::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; for (auto shape : m_shapes) { tsv.writeSection("shape", shape->saveToProject()); } diff --git a/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp b/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp index ebec8df729802ed917e76bf5177ebe6900b13bee..930732bec1e34e61f486de23a3e0a4747133c534 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp @@ -722,7 +722,7 @@ void UnwrappedSurface::calcSize(UnwrappedDetector &udet) { */ void UnwrappedSurface::loadFromProject(const std::string &lines) { ProjectionSurface::loadFromProject(lines); - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); if (tsv.selectLine("Zoom")) { double x0, y0, x1, y1; @@ -772,7 +772,7 @@ UnwrappedSurface::retrievePeaksWorkspace(const std::string &name) const { * @return a string representing the state of the surface */ std::string UnwrappedSurface::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; tsv.writeRaw(ProjectionSurface::saveToProject()); tsv.writeLine("Zoom"); diff --git a/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp b/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp index efe2f53695ade7c5037c7d06428f135fd9cd6540..a6ce37776f379d5f1ef0ef19e16b858ca3423190 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/Viewport.cpp @@ -471,7 +471,7 @@ void Viewport::transform(Mantid::Kernel::V3D &pos) const { void Viewport::loadFromProject(const std::string &lines) { reset(); - TSVSerialiser tsv(lines); + API::TSVSerialiser tsv(lines); tsv.selectLine("Translation"); double xTrans, yTrans; @@ -491,7 +491,7 @@ void Viewport::loadFromProject(const std::string &lines) { } std::string Viewport::saveToProject() const { - TSVSerialiser tsv; + API::TSVSerialiser tsv; tsv.writeLine("Translation") << m_xTrans << m_yTrans; tsv.writeLine("Zoom") << m_zoomFactor;