# HG changeset patch # User Chris Cannam # Date 1579096713 0 # Node ID 5f6fdd525158060bd898a11e12ee52ccb3a98719 # Parent 9cd77efef37cd44e3feef1d1f4fc3e15785975b9 Cut this down, we don't need the things we were calculating (also avoid possible null pointer dereference of v) diff -r 9cd77efef37c -r 5f6fdd525158 layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Wed Jan 15 13:58:11 2020 +0000 +++ b/layer/Colour3DPlotLayer.cpp Wed Jan 15 13:58:33 2020 +0000 @@ -225,42 +225,15 @@ auto model = ModelById::getAs(m_model); if (!model) return {}; - int viewId = v->getId(); Colour3DPlotExporter::Sources sources; sources.verticalBinLayer = this; sources.source = m_model; sources.provider = v; - double minValue = 0.0; - double maxValue = 1.0; - - if (m_normalizeVisibleArea && m_viewMags[viewId].isSet()) { - minValue = m_viewMags[viewId].getMin(); - maxValue = m_viewMags[viewId].getMax(); - } else if (m_normalization == ColumnNormalization::Hybrid) { - minValue = 0; - maxValue = log10(model->getMaximumLevel() + 1.0); - } else if (m_normalization == ColumnNormalization::None) { - minValue = model->getMinimumLevel(); - maxValue = model->getMaximumLevel(); - } - - if (maxValue <= minValue) { - maxValue = minValue + 0.1f; - - if (!(maxValue > minValue)) { // one of them must be NaN or Inf - SVCERR << "WARNING: Colour3DPlotLayer::getExportModel: resetting " - << "minValue and maxValue to zero and one" << endl; - minValue = 0.f; - maxValue = 1.f; - } - } - Colour3DPlotExporter::Parameters params; - params.threshold = minValue; - params.gain = m_gain; // matching ColourScale in getRenderer - params.normalization = m_normalization; + // No thresholding for Colour3DPlot layers, so no need for gain or + // normalisaion values either ModelId exporter = ModelById::add (std::make_shared(sources, params));