Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java @ 448:3cb2bea50456
Generate iso line classes according gnv-issues/issue108
gnv-artifacts/trunk@496 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 03 Jan 2010 12:16:55 +0000 |
parents | f42ed4f10b79 |
children | bc5901bb4525 |
comparison
equal
deleted
inserted
replaced
447:92b7ccbf6163 | 448:3cb2bea50456 |
---|---|
80 Collections.sort(values, HeightValue.INV_Z_COMPARATOR); | 80 Collections.sort(values, HeightValue.INV_Z_COMPARATOR); |
81 | 81 |
82 // if there is no value at 0 repeat first value | 82 // if there is no value at 0 repeat first value |
83 HeightValue first = values.get(0); | 83 HeightValue first = values.get(0); |
84 if (first.z < 0d) { | 84 if (first.z < 0d) { |
85 values.add(0, new HeightValue(0d, first.z, first.k-1)); | 85 values.add(0, new HeightValue(0d, first.v, first.k-1)); |
86 ++N; | 86 ++N; |
87 } | 87 } |
88 | 88 |
89 // if there is no value at depth repeat last value | 89 // if there is no value at depth repeat last value |
90 HeightValue last = values.get(N-1); | 90 HeightValue last = values.get(N-1); |
91 if (last.z > depth) { | 91 if (last.z > depth) { |
92 values.add(new HeightValue(depth, last.z, last.k+1)); | 92 values.add(new HeightValue(depth, last.v, last.k+1)); |
93 ++N; | 93 ++N; |
94 } | 94 } |
95 N = values.size(); | |
96 if (N < 3) { // interpolate linear | 95 if (N < 3) { // interpolate linear |
97 first = values.get(0); | 96 first = values.get(0); |
98 last = values.get(N-1); | 97 last = values.get(N-1); |
99 curve = new LinearFunction.Univariate( | 98 curve = new LinearFunction.Univariate( |
100 first.z, first.v, | 99 first.z, first.v, |