|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.projection.Projection
public abstract class Projection
Using two GPSDatum objects, demarking two corners of real-world space, provides functionality to map real-world coordinates to another (virtual) set of coordinates within a rectangle specified by its size. The center of the virtual world is considered to be at the center of the two specified points. The angle at which it is laid out depends on the projection mode. CARDINAL_DIRECTIONS mode CARDINAL_DIRECTIONS mode aligns the virtual world with the cardinal directions of the compass. It's height dimension specifies its N/S length and its width dimension specifies its E/W length. In this mode, the two real world coordinates are used to create a bounding box which contains the virtual world and scales it depending upon its aspect ratio, so that it is always contained by the bounding box. ANCHOR_POINTS mode ANCHOR_POINTS mode rotates the virtual world, so that the midpoints of its top and bottom verticies are anchored to the two specified GPS coordinates. A projection's virtual world scale may be specified in one of two ways: CONSTANT_SCALE_FACTOR mode In this mode, a constant factor is used to scale the virtual world to the real world, specified as the ratio of points (virtual space) : some real world measure (real space). In this mode, the size of the virtual world changes depending on the specified real world space. The real-world measure must be specified by subclasses. It may be degrees of latitude/longitude, real world distance, etc. CONSTANT_SIZE mode In this mode, the virtual world is held at a constant, specified size (width/height) and the scale between it and the real world changes, depending on the other specifications.
| Nested Class Summary | |
|---|---|
static class |
Projection.RotationConstraintMode
|
static class |
Projection.ScaleConstraintMode
|
| Field Summary | |
|---|---|
protected double |
aspectRatio
|
protected GPSDatum |
physicalWorldPointNE
The normalized northwest-most physical world point for this mapping; supplied coordinates will automatically be transformed to match this specification; that is, if the points are essentially NE and SW, then this point will be computed using the north-most and west-most components of those two coordinates. |
protected GPSDatum |
physicalWorldPointSW
The normalized southest-most physical world point for this mapping; supplied coordinates will automatically be transformed to match this specification; that is, if the points are essentially NE and SW, then this point will be computed using the south-most and east-most components of those two coordinates. |
protected double |
realWorldHeight
|
protected double |
realWorldWidth
|
protected Projection.RotationConstraintMode |
rotConstMode
|
protected Projection.ScaleConstraintMode |
scaleConstMode
|
protected GPSDatum |
specedPWP1
|
protected GPSDatum |
specedPWP2
|
protected double |
virtualWorldHeight
|
protected double |
virtualWorldWidth
|
| Constructor Summary | |
|---|---|
protected |
Projection(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2,
double virtualWorldWidth,
double virtualWorldHeight,
double scaleFactor,
Projection.RotationConstraintMode rotConstMode,
Projection.ScaleConstraintMode scaleConstMode)
Catch-all constructor that is called by all the other constructors. |
|
Projection(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2,
double virtualWorldWidth,
double virtualWorldHeight,
Projection.RotationConstraintMode rotConstMode)
Constructs a new Projection using the specified rotation constraint mode and using constant size scale mode. |
|
Projection(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2,
double scaleFactor,
Projection.RotationConstraintMode rotConstMode)
|
| Method Summary | |
|---|---|
protected abstract void |
configure()
Adjusts internal variables to match the modes, based on the current parameters. |
GPSDatum |
getPhysicalWorldPointNE()
|
GPSDatum |
getPhysicalWorldPointSW()
|
abstract double |
getScale()
Compute (if necessary) the scale factor between virtual world and real world units. |
double |
getVirtualWorldHeight()
|
double |
getVirtualWorldWidth()
|
GPSDatum |
projectIntoReal(java.awt.geom.Point2D.Double origPoint)
|
GPSDatum |
projectIntoReal(java.awt.geom.Point2D.Double origPoint,
GPSDatum destDatum)
|
protected abstract GPSDatum |
projectIntoRealImpl(java.awt.geom.Point2D.Double destPoint,
GPSDatum destDatum)
This method does the real work of projectIntoReal; all calls to it are guaranteed to pass an instantiated GPSDatum object. |
java.awt.geom.Point2D.Double |
projectIntoVirtual(GPSDatum origDatum)
Projects the given GPSDatum's coordinates into the virtual space, using some type of projection. |
java.awt.geom.Point2D.Double |
projectIntoVirtual(GPSDatum origDatum,
java.awt.geom.Point2D.Double destPoint)
Projects the given GPSDatum's coordinates into the virtual space, using some type of projection. |
protected abstract java.awt.geom.Point2D.Double |
projectIntoVirtualImpl(GPSDatum origDatum,
java.awt.geom.Point2D.Double destPoint)
This method does the real work of projectIntoVirtual; all calls to it are guaranteed to pass an instantiated Point2D.Double object. |
void |
setPhysicalWorldCoordinates(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2)
|
protected void |
setPhysicalWorldCoordinatesOnly(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2)
|
void |
setRotConstMode(Projection.RotationConstraintMode rotConstMode)
|
protected void |
setRotConstModeOnly(Projection.RotationConstraintMode rotConstMode)
|
void |
setScaleConstMode(Projection.ScaleConstraintMode scaleConstMode)
|
protected void |
setScaleConstModeOnly(Projection.ScaleConstraintMode scaleConstMode)
|
void |
setVirtualWorldPoints(double virtualWorldWidth,
double virtualWorldHeight)
|
protected void |
setVirtualWorldSizeOnly(double virtualWorldWidth,
double virtualWorldHeight)
|
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected GPSDatum physicalWorldPointNE
protected GPSDatum physicalWorldPointSW
protected GPSDatum specedPWP1
protected GPSDatum specedPWP2
protected Projection.RotationConstraintMode rotConstMode
protected Projection.ScaleConstraintMode scaleConstMode
protected double virtualWorldWidth
protected double virtualWorldHeight
protected double realWorldWidth
protected double realWorldHeight
protected double aspectRatio
| Constructor Detail |
|---|
public Projection(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2,
double virtualWorldWidth,
double virtualWorldHeight,
Projection.RotationConstraintMode rotConstMode)
throws SameCoordinatesException
physicalWorldPoint1 - physicalWorldPoint2 - virtualWorldWidth - virtualWorldHeight - rotConstMode -
SameCoordinatesException
public Projection(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2,
double scaleFactor,
Projection.RotationConstraintMode rotConstMode)
throws SameCoordinatesException
SameCoordinatesException
protected Projection(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2,
double virtualWorldWidth,
double virtualWorldHeight,
double scaleFactor,
Projection.RotationConstraintMode rotConstMode,
Projection.ScaleConstraintMode scaleConstMode)
throws SameCoordinatesException
physicalWorldPoint1 - physicalWorldPoint2 - virtualWorldWidth - virtualWorldHeight - scaleFactor - rotConstMode - scaleConstMode -
SameCoordinatesException| Method Detail |
|---|
public GPSDatum getPhysicalWorldPointNE()
public GPSDatum getPhysicalWorldPointSW()
public abstract double getScale()
public double getVirtualWorldHeight()
public double getVirtualWorldWidth()
public final GPSDatum projectIntoReal(java.awt.geom.Point2D.Double origPoint)
public final GPSDatum projectIntoReal(java.awt.geom.Point2D.Double origPoint,
GPSDatum destDatum)
public final java.awt.geom.Point2D.Double projectIntoVirtual(GPSDatum origDatum)
origDatum -
public final java.awt.geom.Point2D.Double projectIntoVirtual(GPSDatum origDatum,
java.awt.geom.Point2D.Double destPoint)
origDatum - destPoint -
public final void setPhysicalWorldCoordinates(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2)
throws SameCoordinatesException
physicalWorldPoint1 - physicalWorldPoint2 -
SameCoordinatesExceptionpublic final void setRotConstMode(Projection.RotationConstraintMode rotConstMode)
rotConstMode - public final void setScaleConstMode(Projection.ScaleConstraintMode scaleConstMode)
scaleConstMode - the scaleConstMode to set
public final void setVirtualWorldPoints(double virtualWorldWidth,
double virtualWorldHeight)
throws SameCoordinatesException
virtualWorldPointUpperLeft - virtualWorldPointLowerRight -
SameCoordinatesExceptionprotected abstract void configure()
protected abstract GPSDatum projectIntoRealImpl(java.awt.geom.Point2D.Double destPoint,
GPSDatum destDatum)
destPoint - destDatum -
protected abstract java.awt.geom.Point2D.Double projectIntoVirtualImpl(GPSDatum origDatum,
java.awt.geom.Point2D.Double destPoint)
origDatum - destPoint -
protected void setPhysicalWorldCoordinatesOnly(GPSDatum physicalWorldPoint1,
GPSDatum physicalWorldPoint2)
throws SameCoordinatesException
physicalWorldPoint1 - physicalWorldPoint2 -
SameCoordinatesExceptionprotected void setRotConstModeOnly(Projection.RotationConstraintMode rotConstMode)
rotConstMode - protected void setScaleConstModeOnly(Projection.ScaleConstraintMode scaleConstMode)
scaleConstMode -
protected void setVirtualWorldSizeOnly(double virtualWorldWidth,
double virtualWorldHeight)
throws SameCoordinatesException
virtualWorldPointUpperLeft - virtualWorldPointLowerRight -
SameCoordinatesException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||