Mercurial > hg > svgui
comparison layer/TimeValueLayer.cpp @ 445:4a14499fb184
* Save & reload vertical scale extents from note, time/value & colour 3d
plot layers
* Fix display of vertical scale in zoomed colour 3d plot layer
author | Chris Cannam |
---|---|
date | Wed, 12 Nov 2008 15:51:41 +0000 |
parents | 681542f0c8c5 |
children | 747a58d45d56 |
comparison
equal
deleted
inserted
replaced
444:e5800f4490c4 | 445:4a14499fb184 |
---|---|
1614 TimeValueLayer::toXml(QTextStream &stream, | 1614 TimeValueLayer::toXml(QTextStream &stream, |
1615 QString indent, QString extraAttributes) const | 1615 QString indent, QString extraAttributes) const |
1616 { | 1616 { |
1617 SingleColourLayer::toXml(stream, indent, | 1617 SingleColourLayer::toXml(stream, indent, |
1618 extraAttributes + | 1618 extraAttributes + |
1619 QString(" colourMap=\"%1\" plotStyle=\"%2\" verticalScale=\"%3\"") | 1619 QString(" colourMap=\"%1\" plotStyle=\"%2\" verticalScale=\"%3\" scaleMinimum=\"%4\" scaleMaximum=\"%5\" ") |
1620 .arg(m_colourMap) | 1620 .arg(m_colourMap) |
1621 .arg(m_plotStyle) | 1621 .arg(m_plotStyle) |
1622 .arg(m_verticalScale)); | 1622 .arg(m_verticalScale) |
1623 .arg(m_scaleMinimum) | |
1624 .arg(m_scaleMaximum)); | |
1623 } | 1625 } |
1624 | 1626 |
1625 void | 1627 void |
1626 TimeValueLayer::setProperties(const QXmlAttributes &attributes) | 1628 TimeValueLayer::setProperties(const QXmlAttributes &attributes) |
1627 { | 1629 { |
1628 SingleColourLayer::setProperties(attributes); | 1630 SingleColourLayer::setProperties(attributes); |
1629 | 1631 |
1630 bool ok; | 1632 bool ok, alsoOk; |
1631 | 1633 |
1632 int cmap = attributes.value("colourMap").toInt(&ok); | 1634 int cmap = attributes.value("colourMap").toInt(&ok); |
1633 if (ok) setFillColourMap(cmap); | 1635 if (ok) setFillColourMap(cmap); |
1634 | 1636 |
1635 PlotStyle style = (PlotStyle) | 1637 PlotStyle style = (PlotStyle) |
1637 if (ok) setPlotStyle(style); | 1639 if (ok) setPlotStyle(style); |
1638 | 1640 |
1639 VerticalScale scale = (VerticalScale) | 1641 VerticalScale scale = (VerticalScale) |
1640 attributes.value("verticalScale").toInt(&ok); | 1642 attributes.value("verticalScale").toInt(&ok); |
1641 if (ok) setVerticalScale(scale); | 1643 if (ok) setVerticalScale(scale); |
1642 } | 1644 |
1643 | 1645 float min = attributes.value("scaleMinimum").toFloat(&ok); |
1646 float max = attributes.value("scaleMaximum").toFloat(&alsoOk); | |
1647 if (ok && alsoOk) setDisplayExtents(min, max); | |
1648 } | |
1649 |