|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.proj.Proj | +--com.bbn.openmap.proj.Cylindrical
Base of all cylindrical projections.
Projection
,
Proj
,
Mercator
,
CADRG
,
Serialized FormField Summary | |
protected int |
half_world
|
protected java.awt.Point |
world
|
Fields inherited from class com.bbn.openmap.proj.Proj |
ctrLat, ctrLon, DATELINE, height, maxscale, mercator, MIN_HEIGHT, MIN_WIDTH, minscale, NORTH_POLE, NUM_DEFAULT_CIRCLE_VERTS, NUM_DEFAULT_GREAT_SEGS, pixelsPerMeter, planetPixelCircumference, planetPixelRadius, planetRadius, projID, scale, scaled_radius, SOUTH_POLE, type, width, XSCALE_THRESHOLD, XTHRESHOLD |
Constructor Summary | |
Cylindrical(LatLonPoint center,
float scale,
int width,
int height,
int type)
Construct a cylindrical projection. |
Method Summary | |
protected java.util.ArrayList |
_forwardPoly(float[] rawllpts,
int ltype,
int nsegs,
boolean isFilled)
Forward project a raw float[] Poly. |
protected void |
computeParameters()
Called when some fundamental parameters change. |
void |
drawBackground(java.awt.Graphics g)
Assume that the Graphics has been set with the Paint/Color needed, just render the shape of the background. |
void |
drawBackground(java.awt.Graphics2D g,
java.awt.Paint paint)
Draw the background for the projection. |
boolean |
forwardRaw(float[] rawllpts,
int rawoff,
int[] xcoords,
int[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of radian points. |
LatLonPoint |
getLowerRight()
Get the lower right (southeast) point of the projection. |
java.lang.String |
getName()
Get the name string of the projection. |
LatLonPoint |
getUpperLeft()
Get the upper left (northwest) point of the projection. |
void |
pan(float Az)
Pan the map/projection. |
java.lang.String |
toString()
Return stringified description of this projection. |
Methods inherited from class com.bbn.openmap.proj.Proj |
clone, doPolyDispatch, equals, forward, forward, forwardArc, forwardArc, forwardArc, forwardCircle, forwardCircle, forwardCircle, forwardGreatPoly, forwardLine, forwardLine, forwardPoly, forwardPoly, forwardRaster, forwardRect, forwardRect, forwardRect, forwardRhumbPoly, getCenter, getHeight, getMaxScale, getMinScale, getPlanetPixelCircumference, getPlanetPixelRadius, getPlanetRadius, getPPM, getProjectionID, getProjectionType, getScale, getScale, getWidth, hashCode, inverse, inverse, isComplicatedLineType, isPlotable, makeClone, normalize_latitude, pan, panE, panE, panN, panN, panNE, panNE, panNW, panNW, panS, panS, panSE, panSE, panSW, panSW, panW, panW, setCenter, setCenter, setHeight, setMaxScale, setMinScale, setParms, setPlanetRadius, setPPM, setProjectionID, setScale, setWidth, wrap_longitude |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.bbn.openmap.proj.Projection |
forward, forward, forward, inverse, inverse, isPlotable |
Field Detail |
protected java.awt.Point world
protected int half_world
Constructor Detail |
public Cylindrical(LatLonPoint center, float scale, int width, int height, int type)
center
- LatLonPoint center of projectionscale
- float scale of projectionwidth
- width of screenheight
- height of screentype
- projection typeMethod Detail |
public java.lang.String toString()
toString
in class Proj
Projection.getProjectionID()
protected void computeParameters()
Each projection will decide how to respond to this change. For instance, they may need to recalculate "constant" parameters used in the forward() and inverse() calls.
computeParameters
in class Proj
public void pan(float Az)
pan(?180, c)
pan south
pan(-90, c)
pan west
pan(0, c)
pan north
pan(90, c)
pan east
pan
in interface Projection
pan
in class Proj
Az
- azimuth "east of north" in decimal degrees:
-180 <= Az <= 180
public LatLonPoint getUpperLeft()
Returns the upper left point (or closest equivalent) of the projection based on the center point and height and width of screen.
public LatLonPoint getLowerRight()
Returns the lower right point (or closest equivalent) of the projection based on the center point and height and width of screen.
public boolean forwardRaw(float[] rawllpts, int rawoff, int[] xcoords, int[] ycoords, boolean[] visible, int copyoff, int copylen)
It does populate a visible array indicating whether the points are visible on the projected view of the world.
rawllpts
- array of lat,lon,... in radiansrawoff
- offset into rawllptsxcoords
- x coordinatesycoords
- y coordinatesvisible
- coordinates visible?copyoff
- offset into x,y,visible arrayscopylen
- number of coordinates (coordinate arrays should
be at least this long, rawllpts should be at least twice
as long).
protected java.util.ArrayList _forwardPoly(float[] rawllpts, int ltype, int nsegs, boolean isFilled)
Implementation:
For the cylindrical "boxy" family of projections, we project
all the points, and check the horizontal (longitudinal) spacing
between vertices as we go. If the spacing is greater than half
the world width (circumference) in pixels, we assume that the
segment has wrapped off one edge of the screen and back onto
the other side. (NOTE that our restrictions on line segments
mentioned in the Projection interface do not allow for lines
>= 180 degrees of arc or for the difference in longitude
between two points to be >= 180 degrees of arc).
For the case where a segment wraps offscreen, we keep track of the wrapping adjustment factor, and shift the points as we go. After projecting and shifting all the points, we have a single continuous x-y polygon. We then need to make shifted copies of this polygon for the maxima and minima wrap values calculated during the projection process. This allows us to see the discontinuous (wrapped) sections on the screen when they are drawn.
_forwardPoly
in class Proj
rawllpts
- float[] of lat,lon,lat,lon,... in RADIANS!ltype
- line type (straight, rhumbline, greatcircle)nsegs
- number of segments between vertices (or if < 0,
generate this value internally)isFilled
- filled poly? this is currently ignored for
cylindrical projections.
public void drawBackground(java.awt.Graphics2D g, java.awt.Paint paint)
drawBackground
in class Proj
g
- Graphics2Dpaint
- java.awt.Paint to use for the backgroundpublic void drawBackground(java.awt.Graphics g)
drawBackground
in class Proj
public java.lang.String getName()
getName
in interface Projection
getName
in class Proj
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |