![]() |
Isis 3 Programmer 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. More... | |
| virtual | ~GroundGrid () |
| Delete the object. More... | |
| void | CreateGrid (Latitude baseLat, Longitude baseLon, Angle latInc, Angle lonInc, Progress *progress=0) |
| This method draws the grid internally, using default resolutions. More... | |
| void | CreateGrid (Latitude baseLat, Longitude baseLon, Angle latInc, Angle lonInc, Progress *progress, Angle latRes, Angle lonRes) |
| This method draws the grid internally. More... | |
| void | WalkBoundary () |
| This draws grid lines along the extremes of the lat/lon box of the grid. More... | |
| void | SetGroundLimits (Latitude minLat, Longitude minLon, Latitude maxLat, Longitude maxLon) |
| This restricts (or grows) the ground range in which to draw grid lines. More... | |
| bool | PixelOnGrid (int x, int y) |
| Returns true if the grid is on this point. More... | |
| bool | PixelOnGrid (int x, int y, bool latGrid) |
| Returns true if the grid is on this point. More... | |
| Latitude | minLatitude () const |
| Returns the minimum latitude for the grid. More... | |
| Longitude | minLongitude () const |
| Returns the minimum longitude for the grid. More... | |
| Latitude | maxLatitude () const |
| Returns the maximum latitude for the grid. More... | |
| Longitude | maxLongitude () const |
| Returns the maximum longitude for the grid. More... | |
| PvlGroup * | GetMappingGroup () |
| Returns a mapping group representation of the projection or camera. More... | |
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. More... | |
| UniversalGroundMap * | GroundMap () |
| Returns the ground map for children. More... | |
Private Member Functions | |
| void | SetGridBit (unsigned int x, unsigned int y, bool latGrid) |
| This flags a bit as on the grid lines. More... | |
| bool | GetGridBit (unsigned int x, unsigned int y, bool latGrid) |
| Returns true if the specified coordinate is on the grid lines. More... | |
| void | DrawLineOnGrid (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, bool isLatLine) |
| This sets the bits on the grid along the specified line. More... | |
Private Attributes | |
| char * | p_grid |
| This stores the bits of each pixel in the grid. More... | |
| char * | p_latLinesGrid |
| This stores the bits of each pixel in the grid. More... | |
| char * | p_lonLinesGrid |
| This stores the bits of each pixel in the grid. More... | |
| unsigned int | p_width |
| This is the width of the grid. More... | |
| unsigned int | p_height |
| This is the height of the grid. More... | |
| unsigned long | p_gridSize |
| This is width*height. More... | |
| UniversalGroundMap * | p_groundMap |
| This calculates single grid pts. More... | |
| Latitude * | p_minLat |
| Lowest latitude in image. More... | |
| Longitude * | p_minLon |
| Lowest longitude in image. More... | |
| Latitude * | p_maxLat |
| Highest latitude in image. More... | |
| Longitude * | p_maxLon |
| Highest longitude in image. More... | |
| PvlGroup * | p_mapping |
| The mapping group representation of the projection or camera. More... | |
| double | p_defaultResolution |
| Default step size in degrees/pixel. More... | |
| bool | p_reinitialize |
| True if we need to reset p_grid in CreateGrid. More... | |
| bool | m_extendGrid |
| If the grid should extend past the longitude domain boundary. More... | |
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.
Definition at line 58 of file GroundGrid.h.
| 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 |
Definition at line 40 of file GroundGrid.cpp.
References Isis::PvlObject::findGroup(), Isis::Distance::meters(), and Isis::toDouble().
|
virtual |
Delete the object.
Definition at line 167 of file GroundGrid.cpp.
| 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) |
Definition at line 239 of file GroundGrid.cpp.
References Isis::Progress::CheckStatus(), Isis::Angle::isValid(), Isis::Latitude::setErrorChecking(), and Isis::Progress::SetMaximumSteps().
| 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 |
Definition at line 218 of file GroundGrid.cpp.
|
private |
This sets the bits on the grid along the specified line.
| x1 | Start X |
| y1 | Start Y |
| x2 | End X |
| y2 | End Y |
| isLatLine |
Definition at line 730 of file GroundGrid.cpp.
|
private |
Returns true if the specified coordinate is on the grid lines.
| x | X-Coordinate (0-based) |
| y | Y-Coordinate (0-based) |
| latGrid | True if you want to access the latitude grid where there are separate lat/lon grids. False for lon. Irrelevant if using a single grid. |
Definition at line 691 of file GroundGrid.cpp.
| PvlGroup * Isis::GroundGrid::GetMappingGroup | ( | ) |
Returns a mapping group representation of the projection or camera.
This is useful for matching units with lat/lons.
Definition at line 546 of file GroundGrid.cpp.
|
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) |
Definition at line 618 of file GroundGrid.cpp.
|
protected |
Returns the ground map for children.
Definition at line 643 of file GroundGrid.cpp.
| Latitude Isis::GroundGrid::maxLatitude | ( | ) | const |
Returns the maximum latitude for the grid.
Definition at line 585 of file GroundGrid.cpp.
| Longitude Isis::GroundGrid::maxLongitude | ( | ) | const |
Returns the maximum longitude for the grid.
Definition at line 599 of file GroundGrid.cpp.
| Latitude Isis::GroundGrid::minLatitude | ( | ) | const |
Returns the minimum latitude for the grid.
Definition at line 557 of file GroundGrid.cpp.
| Longitude Isis::GroundGrid::minLongitude | ( | ) | const |
Returns the minimum longitude for the grid.
Definition at line 571 of file GroundGrid.cpp.
| 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) |
Definition at line 529 of file GroundGrid.cpp.
| 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 |
Definition at line 510 of file GroundGrid.cpp.
|
private |
This flags a bit as on the grid lines.
| x | X-Coordinate (0-based) |
| y | Y-Coordinate (0-based) |
| latGrid | True if this is derived from a latitude line |
Definition at line 655 of file GroundGrid.cpp.
| 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 |
Definition at line 411 of file GroundGrid.cpp.
References Isis::Angle::isValid().
| void Isis::GroundGrid::WalkBoundary | ( | ) |
This draws grid lines along the extremes of the lat/lon box of the grid.
Definition at line 434 of file GroundGrid.cpp.
References Isis::Latitude::setErrorChecking().
|
private |
If the grid should extend past the longitude domain boundary.
Definition at line 132 of file GroundGrid.h.
|
private |
Default step size in degrees/pixel.
Definition at line 129 of file GroundGrid.h.
|
private |
This stores the bits of each pixel in the grid.
Definition at line 113 of file GroundGrid.h.
|
private |
This is width*height.
Definition at line 118 of file GroundGrid.h.
|
private |
This calculates single grid pts.
Definition at line 119 of file GroundGrid.h.
|
private |
This is the height of the grid.
Definition at line 117 of file GroundGrid.h.
|
private |
This stores the bits of each pixel in the grid.
Definition at line 114 of file GroundGrid.h.
|
private |
This stores the bits of each pixel in the grid.
Definition at line 115 of file GroundGrid.h.
|
private |
The mapping group representation of the projection or camera.
Definition at line 127 of file GroundGrid.h.
|
private |
Highest latitude in image.
Definition at line 123 of file GroundGrid.h.
|
private |
Highest longitude in image.
Definition at line 124 of file GroundGrid.h.
|
private |
Lowest latitude in image.
Definition at line 121 of file GroundGrid.h.
|
private |
Lowest longitude in image.
Definition at line 122 of file GroundGrid.h.
|
private |
True if we need to reset p_grid in CreateGrid.
Definition at line 131 of file GroundGrid.h.
|
private |
This is the width of the grid.
Definition at line 116 of file GroundGrid.h.