comparison layer/Colour3DPlotLayer.cpp @ 1246:f7ebb72c5e12

Remove unused function
author Chris Cannam
date Tue, 28 Feb 2017 14:06:49 +0000
parents f0e291fa7b9c
children c72d78d7890a
comparison
equal deleted inserted replaced
1245:f0e291fa7b9c 1246:f7ebb72c5e12
992 } 992 }
993 993
994 paint.restore(); 994 paint.restore();
995 } 995 }
996 996
997 DenseThreeDimensionalModel::Column
998 Colour3DPlotLayer::getColumn(int col) const
999 {
1000 Profiler profiler("Colour3DPlotLayer::getColumn");
1001
1002 DenseThreeDimensionalModel::Column values = m_model->getColumn(col);
1003 values.resize(m_model->getHeight(), 0.f);
1004 if (m_normalization != ColumnNormalization::Max1 &&
1005 m_normalization != ColumnNormalization::Hybrid) {
1006 return values;
1007 }
1008
1009 double colMax = 0.f, colMin = 0.f;
1010 double min = 0.f, max = 0.f;
1011
1012 int nv = int(values.size());
1013
1014 min = m_model->getMinimumLevel();
1015 max = m_model->getMaximumLevel();
1016
1017 for (int y = 0; y < nv; ++y) {
1018 if (y == 0 || values.at(y) > colMax) colMax = values.at(y);
1019 if (y == 0 || values.at(y) < colMin) colMin = values.at(y);
1020 }
1021 if (colMin == colMax) colMax = colMin + 1;
1022
1023 for (int y = 0; y < nv; ++y) {
1024
1025 double value = values.at(y);
1026 double norm = (value - colMin) / (colMax - colMin);
1027 double newvalue = min + (max - min) * norm;
1028
1029 if (value != newvalue) values[y] = float(newvalue);
1030 }
1031
1032 if (m_normalization == ColumnNormalization::Hybrid
1033 && (colMax > 0.0)) {
1034 double logmax = log10(colMax);
1035 for (int y = 0; y < nv; ++y) {
1036 values[y] = float(values[y] * logmax);
1037 }
1038 }
1039
1040 return values;
1041 }
1042
1043 Colour3DPlotRenderer * 997 Colour3DPlotRenderer *
1044 Colour3DPlotLayer::getRenderer(const LayerGeometryProvider *v) const 998 Colour3DPlotLayer::getRenderer(const LayerGeometryProvider *v) const
1045 { 999 {
1046 int viewId = v->getId(); 1000 int viewId = v->getId();
1047 1001