org.mars_sim.msp.mapdata
Class SurfaceMapData

java.lang.Object
  extended by org.mars_sim.msp.mapdata.SurfaceMapData
All Implemented Interfaces:
MapData

public class SurfaceMapData
extends Object

Surface map data.


Field Summary
static double HALF_MAP_ANGLE
           
static int MAP_HEIGHT
           
static int MAP_WIDTH
           
static double PIXEL_RHO
           
 
Constructor Summary
SurfaceMapData()
          Constructor
 
Method Summary
 Point findRectPosition(double oldPhi, double oldTheta, double newPhi, double newTheta, double rho, int half_map, int low_edge)
          Converts spherical coordinates to rectangular coordinates.
 Image getMapImage(double centerPhi, double centerTheta)
          Generates and returns a map image with the given parameters.
 Color getRGBColor(double phi, double theta)
          Gets the RGB map color at a given location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HALF_MAP_ANGLE

public static final double HALF_MAP_ANGLE
See Also:
Constant Field Values

MAP_HEIGHT

public static final int MAP_HEIGHT
See Also:
Constant Field Values

MAP_WIDTH

public static final int MAP_WIDTH
See Also:
Constant Field Values

PIXEL_RHO

public static final double PIXEL_RHO
See Also:
Constant Field Values
Constructor Detail

SurfaceMapData

public SurfaceMapData()
Constructor

Method Detail

getMapImage

public Image getMapImage(double centerPhi,
                         double centerTheta)
Description copied from interface: MapData
Generates and returns a map image with the given parameters.

Specified by:
getMapImage in interface MapData
Parameters:
centerPhi - the phi center location of the map.
centerTheta - the theta center location of the map.
Returns:
The map image.

getRGBColor

public Color getRGBColor(double phi,
                         double theta)
Description copied from interface: MapData
Gets the RGB map color at a given location.

Specified by:
getRGBColor in interface MapData
Parameters:
phi - the phi location.
theta - the theta location.
Returns:
the RGB map color.

findRectPosition

public Point findRectPosition(double oldPhi,
                              double oldTheta,
                              double newPhi,
                              double newTheta,
                              double rho,
                              int half_map,
                              int low_edge)
Converts spherical coordinates to rectangular coordinates. Returns integer x and y display coordinates for spherical location.

Parameters:
newPhi - the new phi coordinate
newTheta - the new theta coordinate
rho - diameter of planet (in km)
half_map - half the map's width (in pixels)
low_edge - lower edge of map (in pixels)
Returns:
pixel offset value for map


Copyright © 2009-2013. All Rights Reserved.