[Dive4elements-commits] [PATCH 1 of 3] WaterLineArtifact: Added callcontext-parameter to interfaces getWaterLine
Wald Commits
scm-commit at wald.intevation.org
Tue Nov 13 14:44:23 CET 2012
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1352814404 -3600
# Node ID 6153c50f78cf7721ad993a2fad60296b459ed00d
# Parent 79bb64f66c7464bb563664a637c7bccf86ec9675
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.
diff -r 79bb64f66c74 -r 6153c50f78cf flys-artifacts/src/main/java/de/intevation/flys/artifacts/ManualPointsArtifact.java
--- 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));
diff -r 79bb64f66c74 -r 6153c50f78cf flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java
--- 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());
diff -r 79bb64f66c74 -r 6153c50f78cf flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java
--- 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");
diff -r 79bb64f66c74 -r 6153c50f78cf flys-artifacts/src/main/java/de/intevation/flys/artifacts/WaterLineArtifact.java
--- 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 :
diff -r 79bb64f66c74 -r 6153c50f78cf flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java
--- 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);
More information about the Dive4elements-commits
mailing list