Package hec.geometry

Class WorldLine

java.lang.Object
hec.geometry.WorldLine
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
WorldLine3d

public class WorldLine extends Object implements Serializable
A multi-point line in world coordinates.
See Also:
  • Field Details

    • RIGHTBANK

      public static final int RIGHTBANK
      See Also:
    • LEFTBANK

      public static final int LEFTBANK
      See Also:
    • pts

      public Vector pts
      Vector of interior points in line
    • _length

      protected transient double _length
    • _coordAtPt

      protected transient double[] _coordAtPt
  • Constructor Details

    • WorldLine

      public WorldLine()
  • Method Details

    • newPt

      public WorldPt newPt()
    • getFirstPt

      public WorldPt getFirstPt()
    • getLastPt

      public WorldPt getLastPt()
    • getCenterPt

      public WorldPt getCenterPt()
    • getPtIndexBeforeCoord

      public int getPtIndexBeforeCoord(double coord)
      returns the index of the point in the pts vector before the given coord
    • getPtIndexNearCoord

      public int getPtIndexNearCoord(double coord)
      returns the index of the point in the pts vector nearest the given coord
    • nearPt

      public boolean nearPt(WorldPt wpt, double tol)
    • getNearestLocation

      public double getNearestLocation(WorldPt wpt, WorldPt ptnbest)
      computes the shortest distance between the given point and the line
    • getLength

      public double getLength()
    • getCoordAtLocation

      public double getCoordAtLocation(WorldPt wpt)
      computes the stream coordinate nearest the given location
    • getLocationByCoord

      public WorldPt getLocationByCoord(double coord)
    • insertPt

      public boolean insertPt(WorldPt wpt, double tol)
      if the given point is within the given tolerance of the line, a new point is inserted at the location on the line nearest the given point.
    • removePt

      public boolean removePt(WorldPt wpt, double tol)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parseString

      public void parseString(String str)
    • createOffsetLine

      public WorldLine createOffsetLine(double c0, double c1, double offset, int bank)
      Creates a WorldLine offset from the current line between the given coordinates
    • getLocalRegionArrays

      public int getLocalRegionArrays(Scale scl, int[] xarray, int[] yarray)
      creates a set of local coordiates to draw a polygonal reach
    • getLocalRegionArrays

      public int getLocalRegionArrays(Scale scl, int[] xarray, int[] yarray, double width)
      creates a set of local coordiates to draw a polygonal reach
    • getSlopeAtCoord

      public boolean getSlopeAtCoord(double coord, WorldPt wpt, WorldPt slope)
      Compute the location and slope at the specified line coordinate. The line coordinate goes from 0 to 1.
    • setLinePoint

      public void setLinePoint(double coord, WorldPt wpt)
      reset the location of a point on the stream line