public abstract class MapViewState.MapViewPoint extends java.lang.Object
Constructor and Description |
---|
MapViewPoint() |
Modifier and Type | Method and Description |
---|---|
MapViewState.MapViewPoint |
add(EastNorth en)
Add the given offset to this point
|
double |
distanceToInView(MapViewState.MapViewPoint p2)
Gets the distance between this point and an other point.
|
double |
distanceToInViewSq(MapViewState.MapViewPoint p2)
Gets the squared distance between this point and an other point.
|
EastNorth |
getEastNorth()
Gets the
EastNorth coordinate of this point. |
java.awt.geom.Point2D |
getInView()
Get this point in view coordinates.
|
abstract double |
getInViewX()
Get the x coordinate in view space without creating an intermediate object.
|
abstract double |
getInViewY()
Get the y coordinate in view space without creating an intermediate object.
|
java.awt.geom.Point2D |
getInWindow()
Convert this point to window coordinates.
|
LatLon |
getLatLon()
Gets the current position in LatLon coordinates according to the current projection.
|
LatLon |
getLatLonClamped()
Gets the latlon coordinate clamped to the current world area.
|
java.awt.geom.Point2D |
getOnScreen()
Convert this point to screen coordinates.
|
int |
getOutsideRectangleFlags(MapViewState.MapViewRectangle rect)
Gets the direction in which this point is outside of the given view rectangle.
|
private java.awt.geom.Point2D.Double |
getUsingCorner(java.awt.Point corner) |
private boolean |
inRange(double val,
int min,
double max) |
MapViewState.MapViewPoint |
interpolate(MapViewState.MapViewPoint p1,
double i)
Do a linear interpolation to the other point
|
boolean |
isInView()
Check if this point is inside the view bounds.
|
double |
oneNormInView(MapViewState.MapViewPoint p2)
Gets the sum of the x/y view distances between the points.
|
MapViewState.MapViewRectangle |
rectTo(MapViewState.MapViewPoint other)
Create a rectangle from this to the other point.
|
public MapViewPoint()
public java.awt.geom.Point2D getInView()
public abstract double getInViewX()
public abstract double getInViewY()
public java.awt.geom.Point2D getInWindow()
public java.awt.geom.Point2D getOnScreen()
private java.awt.geom.Point2D.Double getUsingCorner(java.awt.Point corner)
public EastNorth getEastNorth()
EastNorth
coordinate of this point.public MapViewState.MapViewRectangle rectTo(MapViewState.MapViewPoint other)
other
- The other point. Needs to be of the same MapViewState
public LatLon getLatLon()
getLatLonClamped()
public LatLon getLatLonClamped()
public MapViewState.MapViewPoint add(EastNorth en)
en
- The offset in east/north space.public boolean isInView()
getOutsideRectangleFlags(getViewArea())
returns no flagsprivate boolean inRange(double val, int min, double max)
public int getOutsideRectangleFlags(MapViewState.MapViewRectangle rect)
rect
- The rectangle to check agains.public double oneNormInView(MapViewState.MapViewPoint p2)
p2
- The other pointpublic double distanceToInViewSq(MapViewState.MapViewPoint p2)
p2
- The other pointpublic double distanceToInView(MapViewState.MapViewPoint p2)
p2
- The other pointpublic MapViewState.MapViewPoint interpolate(MapViewState.MapViewPoint p1, double i)
p1
- The other pointi
- The interpolation factor. 0 is at the current point, 1 at the other point.