# HG changeset patch # User Chris Cannam # Date 1488290784 0 # Node ID f0e291fa7b9c36135f0db5ee866f9a15b424f8b0 # Parent 3ec95b7d1bfcf8eecfcde5063328c25fc5e71b81 Use Range01 normalisation in Colour 3D Plot. This gives us the same column normalisation behaviour as in 2.5 (better than the Max1 option). diff -r 3ec95b7d1bfc -r f0e291fa7b9c layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Thu Feb 23 09:22:56 2017 +0000 +++ b/layer/Colour3DPlotLayer.cpp Tue Feb 28 14:06:24 2017 +0000 @@ -107,7 +107,7 @@ switch (value) { default: case 0: return { ColumnNormalization::None, false }; - case 1: return { ColumnNormalization::Max1, false }; + case 1: return { ColumnNormalization::Range01, false }; case 2: return { ColumnNormalization::None, true }; // visible area case 3: return { ColumnNormalization::Hybrid, false }; } @@ -119,10 +119,11 @@ if (visible) return 2; switch (norm) { case ColumnNormalization::None: return 0; - case ColumnNormalization::Max1: return 1; + case ColumnNormalization::Range01: return 1; case ColumnNormalization::Hybrid: return 3; case ColumnNormalization::Sum1: + case ColumnNormalization::Max1: default: return 0; } } @@ -1063,12 +1064,12 @@ 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(m_model->getMaximumLevel() + 1.0); } else if (m_normalization == ColumnNormalization::None) { minValue = m_model->getMinimumLevel(); maxValue = m_model->getMaximumLevel(); - } else if (m_normalization == ColumnNormalization::Hybrid) { - minValue = 0; - maxValue = log10(m_model->getMaximumLevel() + 1.0); } SVDEBUG << "Colour3DPlotLayer: rebuilding renderer, value range is " @@ -1238,13 +1239,13 @@ // area as well afterwards s += QString("columnNormalization=\"%1\" ") - .arg(m_normalization == ColumnNormalization::Max1 ? "peak" : + .arg(m_normalization == ColumnNormalization::Range01 ? "peak" : m_normalization == ColumnNormalization::Hybrid ? "hybrid" : "none"); // Old-style normalization attribute, for backward compatibility s += QString("normalizeColumns=\"%1\" ") - .arg(m_normalization == ColumnNormalization::Max1 ? "true" : "false"); + .arg(m_normalization == ColumnNormalization::Range01 ? "true" : "false"); // And this applies to both old- and new-style attributes @@ -1298,7 +1299,7 @@ haveNewStyleNormalization = true; if (columnNormalization == "peak") { - setNormalization(ColumnNormalization::Max1); + setNormalization(ColumnNormalization::Range01); } else if (columnNormalization == "hybrid") { setNormalization(ColumnNormalization::Hybrid); } else if (columnNormalization == "none") { @@ -1316,7 +1317,7 @@ bool normalizeColumns = (attributes.value("normalizeColumns").trimmed() == "true"); if (normalizeColumns) { - setNormalization(ColumnNormalization::Max1); + setNormalization(ColumnNormalization::Range01); } bool normalizeHybrid =