Commit 80acdb50 authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Refs #16962 Correct namespaces for non-clang builds

We need to add the export macro to TSVSerialiser's class definition and
update the namespaces
parent ae5d900e
......@@ -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();
......
......@@ -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) {
......
......@@ -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();
......
......@@ -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();
......
......@@ -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");
......
......@@ -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());
}
......
......@@ -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");
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment