/** Save the state of the mask bins to a Mantid project file * @return a string representing the state of the mask bins */ std::string MaskBinsData::saveToProject() const { API::TSVSerialiser tsv; for (const auto &binMask : m_masks) { API::TSVSerialiser mask; mask.writeLine("Range") << binMask.start << binMask.end; mask.writeLine("Spectra"); for (const int spectrum : binMask.spectra) { mask << spectrum; } tsv.writeSection("Mask", mask.outputLines()); } return tsv.outputLines(); }
/** * Save the state of the color map widget to a project file. * @return string representing the current state of the color map widget. */ std::string ColorMapWidget::saveToProject() const { API::TSVSerialiser tsv; tsv.writeLine("ScaleType") << getScaleType(); tsv.writeLine("Power") << getNth_power(); tsv.writeLine("MinValue") << getMinValue(); tsv.writeLine("MaxValue") << getMaxValue(); return tsv.outputLines(); }
/** Save the state of the mask bins to a Mantid project file * @return a string representing the state of the mask bins */ std::string MaskBinsData::saveToProject() const { #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) API::TSVSerialiser tsv; for (const auto &binMask : m_masks) { API::TSVSerialiser mask; mask.writeLine("Range") << binMask.start << binMask.end; mask.writeLine("Spectra"); for (auto spectrum : binMask.spectra) { mask << spectrum; } tsv.writeSection("Mask", mask.outputLines()); } return tsv.outputLines(); #else throw std::runtime_error( "MaskBinsData::saveToProject() not implemented for Qt >= 5"); #endif }
std::string LineOverlay::saveToProject() const { API::TSVSerialiser tsv; tsv.writeLine("PointA") << getPointA(); tsv.writeLine("PointB") << getPointB(); tsv.writeLine("Width") << getWidth(); tsv.writeLine("Shown") << isShown(); return tsv.outputLines(); }