Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsColumn.java @ 2616:27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
flys-artifacts/trunk@4200 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 05 Apr 2012 07:21:58 +0000 |
parents | b0597a63fe70 |
children | 6ed24efc80de |
line wrap: on
line source
package de.intevation.flys.artifacts.model; import de.intevation.flys.artifacts.math.Linear; import java.util.Arrays; import java.io.Serializable; public class FixingsColumn implements Serializable { protected int columnId; protected double [] kms; protected double [] ws; protected QRangeTree qs; public FixingsColumn() { } public FixingsColumn( int columnId, double [] kms, double [] ws ) { this.columnId = columnId; this.kms = kms; this.ws = ws; } public int getColumnId() { return columnId; } public boolean getW(double km, double [] w) { if (km < kms[0] || km > kms[kms.length-1]) { w[0] = Double.NaN; return true; } int idx = Arrays.binarySearch(kms, km); if (idx >= 0) { w[0] = ws[idx]; return true; } idx = -idx - 1; w[0] = Linear.linear(km, kms[idx], kms[idx+1], ws[idx], ws[idx+1]); return false; } public double getQ(double km) { return qs.findQ(km); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :