Chris@1071
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@1071
|
2
|
Chris@1071
|
3 /*
|
Chris@1071
|
4 Sonic Visualiser
|
Chris@1071
|
5 An audio file viewer and annotation editor.
|
Chris@1071
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@1071
|
7 This file copyright 2006-2016 Chris Cannam and QMUL.
|
Chris@1071
|
8
|
Chris@1071
|
9 This program is free software; you can redistribute it and/or
|
Chris@1071
|
10 modify it under the terms of the GNU General Public License as
|
Chris@1071
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@1071
|
12 License, or (at your option) any later version. See the file
|
Chris@1071
|
13 COPYING included with this distribution for more information.
|
Chris@1071
|
14 */
|
Chris@1071
|
15
|
Chris@1071
|
16 #include "Colour3DPlotRenderer.h"
|
Chris@1074
|
17 #include "RenderTimer.h"
|
Chris@1071
|
18
|
Chris@1075
|
19 #include "data/model/DenseThreeDimensionalModel.h"
|
Chris@1075
|
20 #include "data/model/Dense3DModelPeakCache.h"
|
Chris@1075
|
21 #include "data/model/FFTModel.h"
|
Chris@1075
|
22
|
Chris@1075
|
23 #include "view/LayerGeometryProvider.h"
|
Chris@1075
|
24
|
Chris@1073
|
25 Colour3DPlotRenderer::RenderResult
|
Chris@1073
|
26 Colour3DPlotRenderer::render(QPainter &paint,
|
Chris@1073
|
27 QRect rect,
|
Chris@1073
|
28 bool complete)
|
Chris@1073
|
29 {
|
Chris@1075
|
30 LayerGeometryProvider *v = m_sources.geometryProvider;
|
Chris@1075
|
31 if (!v) {
|
Chris@1075
|
32 throw std::logic_error("no LayerGeometryProvider provided");
|
Chris@1075
|
33 }
|
Chris@1075
|
34
|
Chris@1075
|
35 DenseThreeDimensionalModel *model = m_sources.source;
|
Chris@1075
|
36 if (!model || !model->isOK() || !model->isReady()) {
|
Chris@1075
|
37 throw std::logic_error("no source model provided, or model not ready");
|
Chris@1075
|
38 }
|
Chris@1075
|
39
|
Chris@1075
|
40 sv_frame_t startFrame = v->getStartFrame();
|
Chris@1075
|
41
|
Chris@1075
|
42
|
Chris@1073
|
43 //!!! todo: timing/incomplete paint
|
Chris@1073
|
44
|
Chris@1073
|
45 //!!! todo: peak frequency style
|
Chris@1073
|
46
|
Chris@1073
|
47 //!!! todo: transparent style from Colour3DPlot
|
Chris@1074
|
48
|
Chris@1074
|
49 //!!! todo: bin boundary alignment when in BinResolution
|
Chris@1074
|
50
|
Chris@1074
|
51 return { rect, {} };
|
Chris@1073
|
52 }
|
Chris@1073
|
53
|