Mercurial > hg > svgui
comparison layer/Colour3DPlotRenderer.cpp @ 1113:261a00010918 spectrogram-minor-refactor
Consts and willRenderOpaque
author | Chris Cannam |
---|---|
date | Tue, 19 Jul 2016 14:49:46 +0100 |
parents | d578b685d912 |
children | ee8e73dc5c8b |
comparison
equal
deleted
inserted
replaced
1112:d578b685d912 | 1113:261a00010918 |
---|---|
31 //#define DEBUG_SPECTROGRAM_REPAINT 1 | 31 //#define DEBUG_SPECTROGRAM_REPAINT 1 |
32 | 32 |
33 using namespace std; | 33 using namespace std; |
34 | 34 |
35 Colour3DPlotRenderer::RenderResult | 35 Colour3DPlotRenderer::RenderResult |
36 Colour3DPlotRenderer::render(LayerGeometryProvider *v, QPainter &paint, QRect rect) | 36 Colour3DPlotRenderer::render(const LayerGeometryProvider *v, QPainter &paint, QRect rect) |
37 { | 37 { |
38 return render(v, paint, rect, false); | 38 return render(v, paint, rect, false); |
39 } | 39 } |
40 | 40 |
41 Colour3DPlotRenderer::RenderResult | 41 Colour3DPlotRenderer::RenderResult |
42 Colour3DPlotRenderer::renderTimeConstrained(LayerGeometryProvider *v, | 42 Colour3DPlotRenderer::renderTimeConstrained(const LayerGeometryProvider *v, |
43 QPainter &paint, QRect rect) | 43 QPainter &paint, QRect rect) |
44 { | 44 { |
45 return render(v, paint, rect, true); | 45 return render(v, paint, rect, true); |
46 } | 46 } |
47 | 47 |
60 return areaLeft; | 60 return areaLeft; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 Colour3DPlotRenderer::RenderResult | 64 Colour3DPlotRenderer::RenderResult |
65 Colour3DPlotRenderer::render(LayerGeometryProvider *v, | 65 Colour3DPlotRenderer::render(const LayerGeometryProvider *v, |
66 QPainter &paint, QRect rect, bool timeConstrained) | 66 QPainter &paint, QRect rect, bool timeConstrained) |
67 { | 67 { |
68 RenderType renderType = decideRenderType(v); | 68 RenderType renderType = decideRenderType(v); |
69 | 69 |
70 if (renderType != DrawBufferPixelResolution) { | 70 if (renderType != DrawBufferPixelResolution) { |
221 | 221 |
222 //!!! should we own the Dense3DModelPeakCache here? or should it persist | 222 //!!! should we own the Dense3DModelPeakCache here? or should it persist |
223 } | 223 } |
224 | 224 |
225 Colour3DPlotRenderer::RenderType | 225 Colour3DPlotRenderer::RenderType |
226 Colour3DPlotRenderer::decideRenderType(LayerGeometryProvider *v) const | 226 Colour3DPlotRenderer::decideRenderType(const LayerGeometryProvider *v) const |
227 { | 227 { |
228 const DenseThreeDimensionalModel *model = m_sources.source; | 228 const DenseThreeDimensionalModel *model = m_sources.source; |
229 if (!model || !v || !(v->getViewManager())) { | 229 if (!model || !v || !(v->getViewManager())) { |
230 return DrawBufferPixelResolution; // or anything | 230 return DrawBufferPixelResolution; // or anything |
231 } | 231 } |
259 return DrawBufferPixelResolution; | 259 return DrawBufferPixelResolution; |
260 } | 260 } |
261 } | 261 } |
262 | 262 |
263 void | 263 void |
264 Colour3DPlotRenderer::renderDirectTranslucent(LayerGeometryProvider *v, | 264 Colour3DPlotRenderer::renderDirectTranslucent(const LayerGeometryProvider *v, |
265 QPainter &paint, | 265 QPainter &paint, |
266 QRect rect) | 266 QRect rect) |
267 { | 267 { |
268 //!!! QPoint illuminatePos; | 268 //!!! QPoint illuminatePos; |
269 // bool illuminate = v->shouldIlluminateLocalFeatures | 269 // bool illuminate = v->shouldIlluminateLocalFeatures |
419 } | 419 } |
420 | 420 |
421 } | 421 } |
422 | 422 |
423 void | 423 void |
424 Colour3DPlotRenderer::renderToCachePixelResolution(LayerGeometryProvider *v, | 424 Colour3DPlotRenderer::renderToCachePixelResolution(const LayerGeometryProvider *v, |
425 int x0, int repaintWidth, | 425 int x0, int repaintWidth, |
426 bool rightToLeft, | 426 bool rightToLeft, |
427 bool timeConstrained) | 427 bool timeConstrained) |
428 { | 428 { |
429 cerr << "renderToCachePixelResolution" << endl; | 429 cerr << "renderToCachePixelResolution" << endl; |
511 m_drawBuffer, | 511 m_drawBuffer, |
512 paintedLeft - x0, attainedWidth); | 512 paintedLeft - x0, attainedWidth); |
513 } | 513 } |
514 | 514 |
515 void | 515 void |
516 Colour3DPlotRenderer::renderToCacheBinResolution(LayerGeometryProvider *v, | 516 Colour3DPlotRenderer::renderToCacheBinResolution(const LayerGeometryProvider *v, |
517 int x0, int repaintWidth) | 517 int x0, int repaintWidth) |
518 { | 518 { |
519 cerr << "renderToCacheBinResolution" << endl; | 519 cerr << "renderToCacheBinResolution" << endl; |
520 | 520 |
521 // Draw to the draw buffer, and then scale-copy from there. Draw | 521 // Draw to the draw buffer, and then scale-copy from there. Draw |
786 | 786 |
787 return columnCount; | 787 return columnCount; |
788 } | 788 } |
789 | 789 |
790 int | 790 int |
791 Colour3DPlotRenderer::renderDrawBufferPeakFrequencies(LayerGeometryProvider *v, | 791 Colour3DPlotRenderer::renderDrawBufferPeakFrequencies(const LayerGeometryProvider *v, |
792 int w, int h, | 792 int w, int h, |
793 const vector<int> &binforx, | 793 const vector<int> &binforx, |
794 const vector<double> &binfory, | 794 const vector<double> &binfory, |
795 bool rightToLeft, | 795 bool rightToLeft, |
796 bool timeConstrained) | 796 bool timeConstrained) |