![]()  | 
  
    Isis Developer Reference
    
   | 
 
Calculates a lat/lon grid over an area. More...
#include <GroundGrid.h>

Public Member Functions | |
| GroundGrid (UniversalGroundMap *gmap, bool splitLatLon, bool extendGrid, unsigned int width, unsigned int height) | |
| This method initializes the class by allocating the grid, calculating the lat/lon range, and getting a default grid resolution.   | |
| virtual | ~GroundGrid () | 
| Delete the object.   | |
| void | CreateGrid (Latitude baseLat, Longitude baseLon, Angle latInc, Angle lonInc, Progress *progress=0) | 
| This method draws the grid internally, using default resolutions.   | |
| void | CreateGrid (Latitude baseLat, Longitude baseLon, Angle latInc, Angle lonInc, Progress *progress, Angle latRes, Angle lonRes) | 
| This method draws the grid internally.   | |
| void | WalkBoundary () | 
| This draws grid lines along the extremes of the lat/lon box of the grid.   | |
| void | SetGroundLimits (Latitude minLat, Longitude minLon, Latitude maxLat, Longitude maxLon) | 
| This restricts (or grows) the ground range in which to draw grid lines.   | |
| bool | PixelOnGrid (int x, int y) | 
| Returns true if the grid is on this point.   | |
| bool | PixelOnGrid (int x, int y, bool latGrid) | 
| Returns true if the grid is on this point.   | |
| Latitude | minLatitude () const | 
| Returns the minimum latitude for the grid.   | |
| Longitude | minLongitude () const | 
| Returns the minimum longitude for the grid.   | |
| Latitude | maxLatitude () const | 
| Returns the maximum latitude for the grid.   | |
| Longitude | maxLongitude () const | 
| Returns the maximum longitude for the grid.   | |
| PvlGroup * | GetMappingGroup () | 
| Returns a mapping group representation of the projection or camera.   | |
Protected Member Functions | |
| virtual bool | GetXY (Latitude lat, Longitude lon, unsigned int &x, unsigned int &y) | 
| This method converts a lat/lon to an X/Y.   | |
| UniversalGroundMap * | GroundMap () | 
| Returns the ground map for children.   | |
Calculates a lat/lon grid over an area.
This class, given a universal ground map, area width and height, base lat/lon, lat/lon increments, and optionalls a progress and resolutions will calculate where grid lines should lie.
| Isis::GroundGrid::GroundGrid | ( | UniversalGroundMap * | gmap, | 
| bool | splitLatLon, | ||
| bool | extendGrid, | ||
| unsigned int | width, | ||
| unsigned int | height ) | 
This method initializes the class by allocating the grid, calculating the lat/lon range, and getting a default grid resolution.
| gmap | A universal ground map to use for calculating the grid | 
| splitLatLon | Make two grids: one for latitude lines and one for longitude lines | 
| extendGrid | If the grid should extend past the longitude domain boundary. | 
| width | The width of the grid; often cube samples | 
| height | The height of the grid; often cube samples | 
References Isis::Latitude::AllowPastPole, Isis::Camera::BasicMapping(), Isis::UniversalGroundMap::Camera(), Isis::Angle::Degrees, Isis::UniversalGroundMap::HasCamera(), Isis::PvlContainer::hasKeyword(), Isis::Camera::HighestImageResolution(), Isis::Angle::isValid(), Isis::Projection::Mapping(), Isis::Distance::Meters, Isis::UniversalGroundMap::Projection(), Isis::UniversalGroundMap::Resolution(), and Isis::toDouble().
      
  | 
  virtual | 
Delete the object.
| void Isis::GroundGrid::CreateGrid | ( | Latitude | baseLat, | 
| Longitude | baseLon, | ||
| Angle | latInc, | ||
| Angle | lonInc, | ||
| Progress * | progress, | ||
| Angle | latRes, | ||
| Angle | lonRes ) | 
This method draws the grid internally.
It is not valid to call PixelOnGrid until this method has been called.
| baseLat | Latitude to hit in the grid | 
| baseLon | Longitude to hit in the grid | 
| latInc | Distance between latitude lines | 
| lonInc | Distance between longitude lines | 
| progress | If passed in, this progress will be used | 
| latRes | Resolution of latitude lines (in degrees/pixel) | 
| lonRes | Resolution of longitude lines (in degrees/pixel) | 
References _FILEINFO_, Isis::Latitude::AllowPastPole, Isis::Progress::CheckStatus(), Isis::Angle::Degrees, GetMappingGroup(), GetXY(), Isis::Angle::isValid(), Isis::IException::Programmer, Isis::Latitude::setErrorChecking(), Isis::Progress::SetMaximumSteps(), and Isis::IException::Unknown.
| void Isis::GroundGrid::CreateGrid | ( | Latitude | baseLat, | 
| Longitude | baseLon, | ||
| Angle | latInc, | ||
| Angle | lonInc, | ||
| Progress * | progress = 0 ) | 
This method draws the grid internally, using default resolutions.
| baseLat | Latitude to hit in the grid | 
| baseLon | Longitude to hit in the grid | 
| latInc | Distance between latitude lines | 
| lonInc | Distance between longitude lines | 
| progress | If passed in, this progress will be used | 
References CreateGrid().
Referenced by CreateGrid().
| PvlGroup * Isis::GroundGrid::GetMappingGroup | ( | ) | 
Returns a mapping group representation of the projection or camera.
This is useful for matching units with lat/lons.
Referenced by CreateGrid().
      
  | 
  protectedvirtual | 
This method converts a lat/lon to an X/Y.
This implementation converts to sample/line.
| lat | Latitude of Lat/Lon pair to convert to S/L | 
| lon | Longitude of Lat/Lon pair to convert to S/L | 
| x | Output sample (0-based) | 
| y | Output line (0-based) | 
References GroundMap(), Isis::UniversalGroundMap::Line(), and Isis::UniversalGroundMap::Sample().
Referenced by CreateGrid(), and WalkBoundary().
      
  | 
  protected | 
Returns the ground map for children.
Referenced by GetXY().
| Latitude Isis::GroundGrid::maxLatitude | ( | ) | const | 
| Longitude Isis::GroundGrid::maxLongitude | ( | ) | const | 
| Latitude Isis::GroundGrid::minLatitude | ( | ) | const | 
| Longitude Isis::GroundGrid::minLongitude | ( | ) | const | 
| bool Isis::GroundGrid::PixelOnGrid | ( | int | x, | 
| int | y ) | 
Returns true if the grid is on this point.
| x | X-Coordinate of grid (0-based) | 
| y | Y-Coordinate of grid (0-based) | 
| bool Isis::GroundGrid::PixelOnGrid | ( | int | x, | 
| int | y, | ||
| bool | latGrid ) | 
Returns true if the grid is on this point.
Using this method is recommended if lat/lon grids are separate.
| x | X-Coordinate of grid (0-based) | 
| y | Y-Coordinate of grid (0-based) | 
| latGrid | True for latitude lines, false for longitude lines | 
| void Isis::GroundGrid::SetGroundLimits | ( | Latitude | minLat, | 
| Longitude | minLon, | ||
| Latitude | maxLat, | ||
| Longitude | maxLon ) | 
This restricts (or grows) the ground range in which to draw grid lines.
| minLat | The lowest latitude extreme to draw grid lines to | 
| maxLat | The highest latitude extreme to draw grid lines to | 
| minLon | The lowest longitude extreme to draw grid lines to | 
| maxLon | The highest longitude extreme to draw grid lines to | 
References Isis::Angle::isValid().
| void Isis::GroundGrid::WalkBoundary | ( | ) | 
This draws grid lines along the extremes of the lat/lon box of the grid.
References Isis::Latitude::AllowPastPole, Isis::Angle::Degrees, GetXY(), and Isis::Latitude::setErrorChecking().