# HG changeset patch # User Chris Cannam # Date 1467209634 -3600 # Node ID 2e1d6c2ed3ee76ed00b9324b7a007fa688861da0 # Parent 6f98aa5291d4708368a0fe8323d6a5bc4293b9f2 Another tiny bit diff -r 6f98aa5291d4 -r 2e1d6c2ed3ee layer/Colour3DPlotRenderer.cpp --- a/layer/Colour3DPlotRenderer.cpp Wed Jun 29 14:04:57 2016 +0100 +++ b/layer/Colour3DPlotRenderer.cpp Wed Jun 29 15:13:54 2016 +0100 @@ -16,11 +16,30 @@ #include "Colour3DPlotRenderer.h" #include "RenderTimer.h" +#include "data/model/DenseThreeDimensionalModel.h" +#include "data/model/Dense3DModelPeakCache.h" +#include "data/model/FFTModel.h" + +#include "view/LayerGeometryProvider.h" + Colour3DPlotRenderer::RenderResult Colour3DPlotRenderer::render(QPainter &paint, QRect rect, bool complete) { + LayerGeometryProvider *v = m_sources.geometryProvider; + if (!v) { + throw std::logic_error("no LayerGeometryProvider provided"); + } + + DenseThreeDimensionalModel *model = m_sources.source; + if (!model || !model->isOK() || !model->isReady()) { + throw std::logic_error("no source model provided, or model not ready"); + } + + sv_frame_t startFrame = v->getStartFrame(); + + //!!! todo: timing/incomplete paint //!!! todo: peak frequency style diff -r 6f98aa5291d4 -r 2e1d6c2ed3ee layer/Colour3DPlotRenderer.h --- a/layer/Colour3DPlotRenderer.h Wed Jun 29 14:04:57 2016 +0100 +++ b/layer/Colour3DPlotRenderer.h Wed Jun 29 15:13:54 2016 +0100 @@ -108,6 +108,12 @@ * * If complete is true, the whole rect will be rendered and the * returned QRect will be equal to the passed QRect. + * + * If the model to render from is not ready, this will throw a + * std::logic_error exception. The model must be ready and the + * layer requesting the render must not be dormant in its view, so + * that the LayerGeometryProvider returns valid results; it is the + * caller's responsibility to ensure these. */ RenderResult render(QPainter &paint, QRect rect,