Package hec.geometry
Class WorldLine
java.lang.Object
hec.geometry.WorldLine
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
WorldLine3d
A multi-point line in world coordinates.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateOffsetLine
(double c0, double c1, double offset, int bank) Creates a WorldLine offset from the current line between the given coordinatesdouble
computes the stream coordinate nearest the given locationdouble
int
getLocalRegionArrays
(Scale scl, int[] xarray, int[] yarray) creates a set of local coordiates to draw a polygonal reachint
getLocalRegionArrays
(Scale scl, int[] xarray, int[] yarray, double width) creates a set of local coordiates to draw a polygonal reachgetLocationByCoord
(double coord) double
getNearestLocation
(WorldPt wpt, WorldPt ptnbest) computes the shortest distance between the given point and the lineint
getPtIndexBeforeCoord
(double coord) returns the index of the point in the pts vector before the given coordint
getPtIndexNearCoord
(double coord) returns the index of the point in the pts vector nearest the given coordboolean
getSlopeAtCoord
(double coord, WorldPt wpt, WorldPt slope) Compute the location and slope at the specified line coordinate.boolean
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.boolean
newPt()
void
parseString
(String str) boolean
void
setLinePoint
(double coord, WorldPt wpt) reset the location of a point on the stream linetoString()
-
Field Details
-
RIGHTBANK
public static final int RIGHTBANK- See Also:
-
LEFTBANK
public static final int LEFTBANK- See Also:
-
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
-
getFirstPt
-
getLastPt
-
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
-
getNearestLocation
computes the shortest distance between the given point and the line -
getLength
public double getLength() -
getCoordAtLocation
computes the stream coordinate nearest the given location -
getLocationByCoord
-
insertPt
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
-
toString
-
parseString
-
createOffsetLine
Creates a WorldLine offset from the current line between the given coordinates -
getLocalRegionArrays
creates a set of local coordiates to draw a polygonal reach -
getLocalRegionArrays
creates a set of local coordiates to draw a polygonal reach -
getSlopeAtCoord
Compute the location and slope at the specified line coordinate. The line coordinate goes from 0 to 1. -
setLinePoint
reset the location of a point on the stream line
-