public abstract class Projection extends Object
A projection for a globe on a flat surface (must be subclassed).
© 2002 Christian Treber, [email protected]
Constructor and Description |
---|
Projection() |
Modifier and Type | Method and Description |
---|---|
Point2D |
finalize(Point2D pPoint) |
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.
|
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() |
Coordinate |
getViewPos() |
void |
initTransformTable()
Initialize transform parameters, set offset to center of image
(plus shifts), set scale
|
double |
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 |
isVisible(Point3D pPoint) |
boolean |
isWithinImage(Point2D pPoint) |
Point2D |
project2D(Point3D 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.
|
Point3D |
rotate(Point3D pPoint)
Rotate the point according to the current rotation of Earth.
|
Point3D |
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) |
public void initTransformTable()
Initialize transform parameters, set offset to center of image (plus shifts), set scale
protected abstract void setScale()
public abstract double projectY(double pY)
Project 3D point on y axis.
public abstract double inverseProjectY(double pY)
protected abstract double projectX(double pX, double pZ)
Project 3D point on x axis.
public abstract double inverseProjectX(double pX)
public abstract boolean isVisible(Point3D pPoint)
public boolean isWithinImage(Point2D pPoint)
public abstract Coordinate getLocation(int pX, int pY)
Translate screen point into coordinate on Earth.
pX
- pY
- public Point2D project2D(Point3D pPoint)
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.
pPoint
- 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().
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().
public double inverseFinalizeX(double x)
Transform screen to image coordinates.
public double inverseFinalizeY(double y)
Transform screen to image coordinates.
public Point3D rotate(Point3D pPoint)
Rotate the point according to the current rotation of Earth.
public double getScale()
public Coordinate getViewPos()
public void setViewMagnification(double pViewMagnification)
public void setViewPos(Coordinate pViewPos)
public void setShiftX(int pX)
public void setShiftY(int pY)
public void setViewRotation(double pViewRotation)
public void setImageWidth(int pImageWidth)
public void setImageHeight(int pImageHeight)
Copyright © 2016. All Rights Reserved.