changeset 4478:6153c50f78cf

WaterLineArtifact: Added callcontext-parameter to interfaces getWaterLine. Update all implementations. The change was done to be able to compute the extreme values during getWaterLine to access data needed in CrossSectionProfile Diagrams.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 13 Nov 2012 14:46:44 +0100
parents 79bb64f66c74
children 5fc7df736634
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/ManualPointsArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WaterLineArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java
diffstat 5 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/ManualPointsArtifact.java	Tue Nov 13 09:55:29 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/ManualPointsArtifact.java	Tue Nov 13 14:46:44 2012 +0100
@@ -12,6 +12,7 @@
 import de.intevation.artifactdatabase.state.Facet;
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.ArtifactFactory;
+import de.intevation.artifacts.CallContext;
 import de.intevation.artifacts.CallMeta;
 import de.intevation.flys.artifacts.geom.Lines;
 import de.intevation.flys.artifacts.model.FacetTypes;
@@ -128,12 +129,14 @@
      * @param csl 'ground' against which to determine water surface.
      * @param a (ignored in this implementation).
      * @param b (ignored in this implementation).
+     * @param context (ignored in this implementation).
      */
     @Override
     public Lines.LineData getWaterLines(
             int                  index,
             FastCrossSectionLine csl,
-            double a, double b
+            double a, double b,
+            CallContext context
             ) {
         List<Point2D> points = csl.getPoints();
         return Lines.createWaterLines(points, getLine(index));
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Tue Nov 13 09:55:29 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Tue Nov 13 14:46:44 2012 +0100
@@ -7,6 +7,7 @@
 
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.ArtifactFactory;
+import de.intevation.artifacts.CallContext;
 import de.intevation.artifacts.CallMeta;
 
 import de.intevation.artifacts.common.utils.XMLUtils;
@@ -386,13 +387,14 @@
      * @param csl FastCrossSectionLine to compute water surface agains.
      * @param next The km of the next crosssectionline.
      * @param prev The km of the previous crosssectionline.
+     * @param context Ignored in this implementation.
      *
      * @return an array holding coordinates of points of surface of water (
      *         in the form {{x1, x2}, {y1, y2}} ).
      */
     @Override
     public Lines.LineData getWaterLines(int idx, FastCrossSectionLine csl,
-        double next, double prev
+        double next, double prev, CallContext context
     ) {
         logger.debug("getWaterLines(" + idx + ")/" + identifier());
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Tue Nov 13 09:55:29 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Tue Nov 13 14:46:44 2012 +0100
@@ -163,7 +163,7 @@
      *
      * @return an array of data triples that consist of W, Q and Kms.
      */
-    public CalculationResult getWaterlevelData()
+    public CalculationResult getWaterlevelData(CallContext context)
     {
         logger.debug("WINFOArtifact.getWaterlevelData");
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WaterLineArtifact.java	Tue Nov 13 09:55:29 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WaterLineArtifact.java	Tue Nov 13 14:46:44 2012 +0100
@@ -1,7 +1,11 @@
 package de.intevation.flys.artifacts;
 
+import de.intevation.artifacts.CallContext;
+
 import de.intevation.flys.artifacts.geom.Lines;
 import de.intevation.flys.model.FastCrossSectionLine;
+
+
 /**
  * Interface, Artifact can create WaterLines (Water against Cross-Profile).
  */
@@ -9,6 +13,11 @@
 
     /** Get points that define a line of a (water)facet against a cross-
      * section. */
-    public Lines.LineData getWaterLines(int facetIdx, FastCrossSectionLine csl, double d, double w);
+    public Lines.LineData getWaterLines(
+        int                  facetIdx,
+        FastCrossSectionLine      csl,
+        double                      d,
+        double                      w,
+        CallContext           context);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java	Tue Nov 13 09:55:29 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java	Tue Nov 13 14:46:44 2012 +0100
@@ -75,7 +75,8 @@
 
         if (crossSection != null) {
             return lineArtifact.getWaterLines(this.getIndex(),
-                (FastCrossSectionLine) crossSection, (Double) nextKm, (Double) prevKm);
+                (FastCrossSectionLine) crossSection, (Double) nextKm,
+                (Double) prevKm, context);
         }
         else {
             return new Lines.LineData(new double[][] {}, 0d,0d);

http://dive4elements.wald.intevation.org