Isis Developer Reference
Isis::GroundGrid Class Reference

Calculates a lat/lon grid over an area. More...

#include <GroundGrid.h>

Collaboration diagram for Isis::GroundGrid:
Collaboration graph

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.
 
PvlGroupGetMappingGroup ()
 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.
 
UniversalGroundMapGroundMap ()
 Returns the ground map for children.
 

Detailed Description

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.

Author
2010-01-06 Steven Lambright

Constructor & Destructor Documentation

◆ GroundGrid()

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.

Parameters
gmapA universal ground map to use for calculating the grid
splitLatLonMake two grids: one for latitude lines and one for longitude lines
extendGridIf the grid should extend past the longitude domain boundary.
widthThe width of the grid; often cube samples
heightThe 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().

◆ ~GroundGrid()

Isis::GroundGrid::~GroundGrid ( )
virtual

Delete the object.

Member Function Documentation

◆ CreateGrid() [1/2]

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.

Parameters
baseLatLatitude to hit in the grid
baseLonLongitude to hit in the grid
latIncDistance between latitude lines
lonIncDistance between longitude lines
progressIf passed in, this progress will be used
latResResolution of latitude lines (in degrees/pixel)
lonResResolution 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.

◆ CreateGrid() [2/2]

void Isis::GroundGrid::CreateGrid ( Latitude baseLat,
Longitude baseLon,
Angle latInc,
Angle lonInc,
Progress * progress = 0 )

This method draws the grid internally, using default resolutions.

Parameters
baseLatLatitude to hit in the grid
baseLonLongitude to hit in the grid
latIncDistance between latitude lines
lonIncDistance between longitude lines
progressIf passed in, this progress will be used

References CreateGrid().

Referenced by CreateGrid().

◆ GetMappingGroup()

PvlGroup * Isis::GroundGrid::GetMappingGroup ( )

Returns a mapping group representation of the projection or camera.

This is useful for matching units with lat/lons.

Returns
Returns a mapping group representation of the projection or camera

Referenced by CreateGrid().

◆ GetXY()

bool Isis::GroundGrid::GetXY ( Latitude lat,
Longitude lon,
unsigned int & x,
unsigned int & y )
protectedvirtual

This method converts a lat/lon to an X/Y.

This implementation converts to sample/line.

Parameters
latLatitude of Lat/Lon pair to convert to S/L
lonLongitude of Lat/Lon pair to convert to S/L
xOutput sample (0-based)
yOutput line (0-based)
Returns
bool Successful

References GroundMap(), Isis::UniversalGroundMap::Line(), and Isis::UniversalGroundMap::Sample().

Referenced by CreateGrid(), and WalkBoundary().

◆ GroundMap()

UniversalGroundMap * Isis::GroundGrid::GroundMap ( )
protected

Returns the ground map for children.

Referenced by GetXY().

◆ maxLatitude()

Latitude Isis::GroundGrid::maxLatitude ( ) const

Returns the maximum latitude for the grid.

Returns
Latitude The maximum latitude for the grid. If no maximum has been set, then a default Latitude object is returned.

◆ maxLongitude()

Longitude Isis::GroundGrid::maxLongitude ( ) const

Returns the maximum longitude for the grid.

Returns
Longitude The maximum longitude for the grid. If no maximum has been set, then a default Longitude object is returned.

◆ minLatitude()

Latitude Isis::GroundGrid::minLatitude ( ) const

Returns the minimum latitude for the grid.

Returns
Latitude The minimum latitude for the grid. If no minimum has been set, then a default Latitude object is returned.

◆ minLongitude()

Longitude Isis::GroundGrid::minLongitude ( ) const

Returns the minimum longitude for the grid.

Returns
Longitude The minimum longitude for the grid. If no minimum has been set, then a default Longitude object is returned.

◆ PixelOnGrid() [1/2]

bool Isis::GroundGrid::PixelOnGrid ( int x,
int y )

Returns true if the grid is on this point.

Parameters
xX-Coordinate of grid (0-based)
yY-Coordinate of grid (0-based)
Returns
bool Pixel lies on grid

◆ PixelOnGrid() [2/2]

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.

Parameters
xX-Coordinate of grid (0-based)
yY-Coordinate of grid (0-based)
latGridTrue for latitude lines, false for longitude lines
Returns
bool Pixel lies on grid

◆ SetGroundLimits()

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.

Parameters
minLatThe lowest latitude extreme to draw grid lines to
maxLatThe highest latitude extreme to draw grid lines to
minLonThe lowest longitude extreme to draw grid lines to
maxLonThe highest longitude extreme to draw grid lines to

References Isis::Angle::isValid().

◆ WalkBoundary()

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().


The documentation for this class was generated from the following files: