comparison layer/Colour3DPlotLayer.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 cd2492c5fe45
children 984c1975f1ff
comparison
equal deleted inserted replaced
315:c30a7cd29f4a 316:c0b9eec70639
21 #include "base/ColourMapper.h" 21 #include "base/ColourMapper.h"
22 22
23 #include <QPainter> 23 #include <QPainter>
24 #include <QImage> 24 #include <QImage>
25 #include <QRect> 25 #include <QRect>
26 #include <QTextStream>
26 27
27 #include <iostream> 28 #include <iostream>
28 29
29 #include <cassert> 30 #include <cassert>
30 31
777 } 778 }
778 779
779 return true; 780 return true;
780 } 781 }
781 782
782 QString 783 void
783 Colour3DPlotLayer::toXmlString(QString indent, QString extraAttributes) const 784 Colour3DPlotLayer::toXml(QTextStream &stream,
784 { 785 QString indent, QString extraAttributes) const
785 QString s; 786 {
786 787 QString s = QString("scale=\"%1\" "
787 s += QString("scale=\"%1\" " 788 "colourScheme=\"%2\" "
788 "colourScheme=\"%2\" " 789 "normalizeColumns=\"%3\" "
789 "normalizeColumns=\"%3\" " 790 "normalizeVisibleArea=\"%4\"")
790 "normalizeVisibleArea=\"%4\"")
791 .arg((int)m_colourScale) 791 .arg((int)m_colourScale)
792 .arg(m_colourMap) 792 .arg(m_colourMap)
793 .arg(m_normalizeColumns ? "true" : "false") 793 .arg(m_normalizeColumns ? "true" : "false")
794 .arg(m_normalizeVisibleArea ? "true" : "false"); 794 .arg(m_normalizeVisibleArea ? "true" : "false");
795 795
796 return Layer::toXmlString(indent, extraAttributes + " " + s); 796 Layer::toXml(stream, indent, extraAttributes + " " + s);
797 } 797 }
798 798
799 void 799 void
800 Colour3DPlotLayer::setProperties(const QXmlAttributes &attributes) 800 Colour3DPlotLayer::setProperties(const QXmlAttributes &attributes)
801 { 801 {