Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 1123:343887ac6766 spectrogram-minor-refactor
Some tidying
author | Chris Cannam |
---|---|
date | Fri, 22 Jul 2016 14:42:36 +0100 |
parents | 94370157b265 |
children | 50324fca1328 |
comparison
equal
deleted
inserted
replaced
1122:94370157b265 | 1123:343887ac6766 |
---|---|
1493 Colour3DPlotRenderer::RenderResult result; | 1493 Colour3DPlotRenderer::RenderResult result; |
1494 MagnitudeRange magRange; | 1494 MagnitudeRange magRange; |
1495 int viewId = v->getId(); | 1495 int viewId = v->getId(); |
1496 | 1496 |
1497 if (!renderer->geometryChanged(v)) { | 1497 if (!renderer->geometryChanged(v)) { |
1498 cerr << "geometry unchanged, extending view mag range" << endl; | |
1499 magRange = m_viewMags[viewId]; | 1498 magRange = m_viewMags[viewId]; |
1500 } else { | |
1501 cerr << "geometry changed!! creating new view mag range" << endl; | |
1502 } | 1499 } |
1503 | 1500 |
1504 if (m_synchronous) { | 1501 if (m_synchronous) { |
1505 | 1502 |
1506 result = renderer->render(v, paint, rect); | 1503 result = renderer->render(v, paint, rect); |
1511 | 1508 |
1512 cerr << "rect width from this paint: " << result.rendered.width() | 1509 cerr << "rect width from this paint: " << result.rendered.width() |
1513 << ", mag range in this paint: " << result.range.getMin() << " -> " | 1510 << ", mag range in this paint: " << result.range.getMin() << " -> " |
1514 << result.range.getMax() << endl; | 1511 << result.range.getMax() << endl; |
1515 | 1512 |
1516 //!!! | |
1517 | |
1518 QRect uncached = renderer->getLargestUncachedRect(v); | 1513 QRect uncached = renderer->getLargestUncachedRect(v); |
1519 if (uncached.width() > 0) { | 1514 if (uncached.width() > 0) { |
1520 cerr << "updating rect at " << uncached.x() << " width " | |
1521 << uncached.width() << endl; | |
1522 v->updatePaintRect(uncached); | 1515 v->updatePaintRect(uncached); |
1523 } | 1516 } |
1524 } | 1517 } |
1525 | 1518 |
1526 magRange.sample(result.range); | 1519 magRange.sample(result.range); |
1527 | 1520 |
1528 if (magRange.isSet()) { | 1521 if (magRange.isSet()) { |
1529 if (m_viewMags[viewId] == magRange) { | 1522 if (!(m_viewMags[viewId] == magRange)) { |
1530 cerr << "mag range unchanged" << endl; | |
1531 } else { | |
1532 cerr << "mag range changed!!" << endl; | |
1533 m_viewMags[viewId] = magRange; | 1523 m_viewMags[viewId] = magRange; |
1524 //!!! now need to do the normalise-visible thing | |
1534 } | 1525 } |
1535 } | 1526 } |
1536 | 1527 |
1537 cerr << "mag range in this view: " | 1528 cerr << "mag range in this view: " |
1538 << m_viewMags[viewId].getMin() | 1529 << m_viewMags[viewId].getMin() |