comparison layer/Colour3DPlotLayer.cpp @ 1123:343887ac6766 spectrogram-minor-refactor

Some tidying
author Chris Cannam
date Fri, 22 Jul 2016 14:42:36 +0100
parents d930ff725f64
children ee98d587cd1a
comparison
equal deleted inserted replaced
1122:94370157b265 1123:343887ac6766
1084 QPainter &paint, QRect rect) const 1084 QPainter &paint, QRect rect) const
1085 { 1085 {
1086 Colour3DPlotRenderer *renderer = getRenderer(v); 1086 Colour3DPlotRenderer *renderer = getRenderer(v);
1087 1087
1088 Colour3DPlotRenderer::RenderResult result; 1088 Colour3DPlotRenderer::RenderResult result;
1089 MagnitudeRange magRange;
1090 int viewId = v->getId();
1091
1092 if (!renderer->geometryChanged(v)) {
1093 magRange = m_viewMags[viewId];
1094 }
1089 1095
1090 if (m_synchronous) { 1096 if (m_synchronous) {
1091 1097
1092 result = renderer->render(v, paint, rect); 1098 result = renderer->render(v, paint, rect);
1093 1099
1094 } else { 1100 } else {
1095 1101
1096 result = renderer->renderTimeConstrained(v, paint, rect); 1102 result = renderer->renderTimeConstrained(v, paint, rect);
1097
1098 //!!! + mag range
1099 1103
1100 QRect uncached = renderer->getLargestUncachedRect(v); 1104 QRect uncached = renderer->getLargestUncachedRect(v);
1101 if (uncached.width() > 0) { 1105 if (uncached.width() > 0) {
1102 cerr << "updating rect at " << uncached.x() << " width "
1103 << uncached.width() << endl;
1104 v->updatePaintRect(uncached); 1106 v->updatePaintRect(uncached);
1105 } 1107 }
1106 } 1108 }
1107 1109
1108 //!!! at the mo this measures the range of the whole thing, not 1110 magRange.sample(result.range);
1109 //!!! just the view - need to reset it when view extents change 1111
1110 1112 if (magRange.isSet()) {
1111 m_viewMags[v->getId()].sample(result.range); 1113 if (!(m_viewMags[viewId] == magRange)) {
1114 m_viewMags[viewId] = magRange;
1115 //!!! now need to do the normalise-visible thing
1116 }
1117 }
1112 1118
1113 cerr << "mag range in this view: " 1119 cerr << "mag range in this view: "
1114 << m_viewMags[v->getId()].getMin() 1120 << m_viewMags[v->getId()].getMin()
1115 << " -> " 1121 << " -> "
1116 << m_viewMags[v->getId()].getMax() 1122 << m_viewMags[v->getId()].getMax()