Class Projection
- Direct Known Subclasses:
ProjectionCyl
,ProjectionMerc
,ProjectionOrtho
A projection for a globe on a flat surface (must be subclassed).
© 2002 Christian Treber, [email protected]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
finalizeX
(double pX) Since the final mapping is relative to the center of the image -PI and PI get mapped to the left and right border respectively.double
finalizeY
(double pY) Since the final mapping is relative to the center of the image -PI and PI get mapped to the bottom and top border respectively.abstract Coordinate
getLocation
(int pX, int pY) Translate screen point into coordinate on Earth.double
getScale()
void
Initialize transform parameters, set offset to center of image (plus shifts), set scaledouble
inverseFinalizeX
(double x) Transform screen to image coordinates.double
inverseFinalizeY
(double y) Transform screen to image coordinates.abstract double
inverseProjectX
(double pX) abstract double
inverseProjectY
(double pY) abstract boolean
boolean
isWithinImage
(Point2D pPoint) Imagine view the globe, N is up, S is down, and N0E0 is in the center.protected abstract double
projectX
(double pX, double pZ) Project 3D point on x axis.abstract double
projectY
(double pY) Project 3D point on y axis.Rotate the point according to the current rotation of Earth.rotateReverse
(Point3D pPoint) void
setImageHeight
(int pImageHeight) void
setImageWidth
(int pImageWidth) protected abstract void
setScale()
void
setShiftX
(int pX) void
setShiftY
(int pY) void
setViewMagnification
(double pViewMagnification) void
setViewPos
(Coordinate pViewPos) void
setViewRotation
(double pViewRotation)
-
Constructor Details
-
Projection
public Projection()
-
-
Method Details
-
initTransformTable
public void initTransformTable()Initialize transform parameters, set offset to center of image (plus shifts), set scale
-
setScale
protected abstract void setScale() -
projectY
public abstract double projectY(double pY) Project 3D point on y axis.
-
inverseProjectY
public abstract double inverseProjectY(double pY) -
projectX
protected abstract double projectX(double pX, double pZ) Project 3D point on x axis.
-
inverseProjectX
public abstract double inverseProjectX(double pX) -
isVisible
-
isWithinImage
-
getLocation
Translate screen point into coordinate on Earth.
- Parameters:
pX
-pY
-- Returns:
-
project2D
Imagine view the globe, N is up, S is down, and N0E0 is in the center. x is right/left, y is up/down, and z is front/rear.
Map points are located on the surface of a unit sphere (diameter = 1). Latitude is the angle between x and y or z and y. Longitude is the angle between x and z.
Why? The way we choose our global coordinate system, longitude circles (latidude variable) always have the same size while the size of latidude circles (longitude variable) depends on the latitude.
- Parameters:
pPoint
-- Returns:
-
finalize
-
finalizeX
public double finalizeX(double pX) Since the final mapping is relative to the center of the image -PI and PI get mapped to the left and right border respectively. But see ProjectionOrtho.setScale().
-
finalizeY
public double finalizeY(double pY) Since the final mapping is relative to the center of the image -PI and PI get mapped to the bottom and top border respectively. But see ProjectionOrtho.setScale().
-
inverseFinalizeX
public double inverseFinalizeX(double x) Transform screen to image coordinates.
-
inverseFinalizeY
public double inverseFinalizeY(double y) Transform screen to image coordinates.
-
rotate
Rotate the point according to the current rotation of Earth.
-
rotateReverse
-
getScale
public double getScale() -
getViewPos
-
setViewMagnification
public void setViewMagnification(double pViewMagnification) -
setViewPos
-
setShiftX
public void setShiftX(int pX) -
setShiftY
public void setShiftY(int pY) -
setViewRotation
public void setViewRotation(double pViewRotation) -
setImageWidth
public void setImageWidth(int pImageWidth) -
setImageHeight
public void setImageHeight(int pImageHeight)
-