comparison artifacts/src/main/java/org/dive4elements/river/artifacts/WaterLineArtifact.java @ 9425:3f49835a00c3

Extended CrossSectionFacet so it may fetch different data from within the artifact result. Also allows to have acces to the potentially already computed artifact result via its normal computation cache.
author gernotbelger
date Fri, 17 Aug 2018 15:31:02 +0200
parents af13ceeba52a
children
comparison
equal deleted inserted replaced
9424:da19f1f58d72 9425:3f49835a00c3
6 * documentation coming with Dive4Elements River for details. 6 * documentation coming with Dive4Elements River for details.
7 */ 7 */
8 8
9 package org.dive4elements.river.artifacts; 9 package org.dive4elements.river.artifacts;
10 10
11 import java.io.Serializable;
12
11 import org.dive4elements.artifacts.CallContext; 13 import org.dive4elements.artifacts.CallContext;
12 14 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
13 import org.dive4elements.river.artifacts.geom.Lines;
14 import org.dive4elements.river.model.FastCrossSectionLine;
15
16 15
17 /** 16 /**
18 * Interface, Artifact can create WaterLines (Water against Cross-Profile). 17 * Interface, Artifact can create WaterLines (Water against Cross-Profile).
19 */ 18 */
20 public interface WaterLineArtifact { 19 public interface WaterLineArtifact {
21 20
22 /** Get points that define a line of a (water)facet against a cross- 21 /**
23 * section. */ 22 * Get points that define a line of a (water)facet against a cross-
24 public Lines.LineData getWaterLines( 23 * section.
25 int facetIdx, 24 *
26 FastCrossSectionLine csl, 25 * @param stateId
27 double d, 26 * @param hash
28 double w, 27 *
29 CallContext context); 28 * @param waterLineIndex
29 * The object whith wich this artifact determines which of the waterlevels to return. Given to the facet when
30 * constructed. Can be an integer in the simple case, or a more complex description.
31 */
32 // REMARK: we are giving type, hash and stateId so individual artifacts may call back on their compute method, which
33 // needs
34 // those to hash the result data.
35 // Currently, the old implementations don't do that but simply execute the whole computation each time they are
36 // called...
37 // TODO: instead we should compute outside and provide the computed data to this method.
38 double getWaterLevel(ComputeType type, String hash, String stateId, double currentKm, Serializable waterLineIndex, double nextKm, double prevKm,
39 CallContext context);
30 } 40 }
31 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org