Mercurial > hg > svgui
comparison layer/SliceLayer.cpp @ 316:c0b9eec70639
* Make XmlExportable::toXml the function that is universally overridden (and
pure virtual) instead of toXmlString. Tidies up some classes, notably the
model classes, significantly. Closes #1794561.
author | Chris Cannam |
---|---|
date | Thu, 18 Oct 2007 10:15:07 +0000 |
parents | 3101c68a00c1 |
children | 984c1975f1ff |
comparison
equal
deleted
inserted
replaced
315:c30a7cd29f4a | 316:c0b9eec70639 |
---|---|
25 | 25 |
26 #include "PaintAssistant.h" | 26 #include "PaintAssistant.h" |
27 | 27 |
28 #include <QPainter> | 28 #include <QPainter> |
29 #include <QPainterPath> | 29 #include <QPainterPath> |
30 #include <QTextStream> | |
31 | |
30 | 32 |
31 SliceLayer::SliceLayer() : | 33 SliceLayer::SliceLayer() : |
32 m_sliceableModel(0), | 34 m_sliceableModel(0), |
33 m_colourMap(0), | 35 m_colourMap(0), |
34 m_energyScale(dBScale), | 36 m_energyScale(dBScale), |
868 impose = false; | 870 impose = false; |
869 return ColourDatabase::getInstance()->getColourIndex | 871 return ColourDatabase::getInstance()->getColourIndex |
870 (QString(darkbg ? "Bright Blue" : "Blue")); | 872 (QString(darkbg ? "Bright Blue" : "Blue")); |
871 } | 873 } |
872 | 874 |
873 QString | 875 void |
874 SliceLayer::toXmlString(QString indent, QString extraAttributes) const | 876 SliceLayer::toXml(QTextStream &stream, |
877 QString indent, QString extraAttributes) const | |
875 { | 878 { |
876 QString s; | 879 QString s; |
877 | 880 |
878 s += QString("colourScheme=\"%1\" " | 881 s += QString("colourScheme=\"%1\" " |
879 "energyScale=\"%2\" " | 882 "energyScale=\"%2\" " |
884 .arg(m_energyScale) | 887 .arg(m_energyScale) |
885 .arg(m_samplingMode) | 888 .arg(m_samplingMode) |
886 .arg(m_gain) | 889 .arg(m_gain) |
887 .arg(m_normalize ? "true" : "false"); | 890 .arg(m_normalize ? "true" : "false"); |
888 | 891 |
889 return SingleColourLayer::toXmlString(indent, extraAttributes + " " + s); | 892 SingleColourLayer::toXml(stream, indent, extraAttributes + " " + s); |
890 } | 893 } |
891 | 894 |
892 void | 895 void |
893 SliceLayer::setProperties(const QXmlAttributes &attributes) | 896 SliceLayer::setProperties(const QXmlAttributes &attributes) |
894 { | 897 { |