changeset 6428:39aba54a4c15

issue1370: StyledSeriesBuilder: Added add function with translation and scale factors.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 26 Jun 2013 12:38:54 +0200
parents 6d58f5a4c96a
children e32b166c881b
files artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java	Wed Jun 26 12:37:33 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java	Wed Jun 26 12:38:54 2013 +0200
@@ -214,6 +214,26 @@
         }
     }
 
+    /**
+     * Add points to series (q to 1st dim, w to 2nd dim), adding wTrans to the
+     * W values and scaling it with wScale.
+     *
+     * @param series Series to add points to.
+     * @param wqkms WQKms to add to series.
+     * @param wAdd Value to add to each Q while adding to series.
+     * @param wScale multiply with
+     */
+    public static void addPointsQW(XYSeries series, WQKms wqkms, double wTrans, double wScale) {
+        if (wqkms == null) {
+            return;
+        }
+
+        int size = wqkms.size();
+
+        for (int i = 0; i < size; i++) {
+            series.add(wqkms.getQ(i), wScale * (wqkms.getW(i) + wTrans), false);
+        }
+    }
 
     /**
      * Add points to series (q to 1st dim, w to 2nd dim).

http://dive4elements.wald.intevation.org