Isis 3 Programmer Reference
GroundGrid.h
1 #ifndef GroundGrid_h
2 #define GroundGrid_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 namespace Isis {
11  class Angle;
12  class Latitude;
13  class Longitude;
14  class PvlGroup;
15  class Progress;
16  class UniversalGroundMap;
17 
58  class GroundGrid {
59  public:
61  bool splitLatLon,
62  bool extendGrid,
63  unsigned int width,
64  unsigned int height);
65 
66  virtual ~GroundGrid();
67 
68  void CreateGrid(Latitude baseLat,
69  Longitude baseLon,
70  Angle latInc,
71  Angle lonInc,
72  Progress *progress = 0);
73 
74  void CreateGrid(Latitude baseLat,
75  Longitude baseLon,
76  Angle latInc,
77  Angle lonInc,
78  Progress *progress,
79  Angle latRes,
80  Angle lonRes);
81 
82  void WalkBoundary();
83 
84  void SetGroundLimits(Latitude minLat,
85  Longitude minLon,
86  Latitude maxLat,
87  Longitude maxLon);
88 
89  bool PixelOnGrid(int x, int y);
90  bool PixelOnGrid(int x, int y, bool latGrid);
91 
92  Latitude minLatitude() const;
93  Longitude minLongitude() const;
94  Latitude maxLatitude() const;
95  Longitude maxLongitude() const;
96 
98 
99  protected:
100  virtual bool GetXY(Latitude lat, Longitude lon,
101  unsigned int &x, unsigned int &y);
102 
104 
105  private:
106  void SetGridBit(unsigned int x, unsigned int y, bool latGrid);
107  bool GetGridBit(unsigned int x, unsigned int y, bool latGrid);
108  void DrawLineOnGrid(unsigned int x1, unsigned int y1,
109  unsigned int x2, unsigned int y2,
110  bool isLatLine);
111 
112 
113  char *p_grid;
116  unsigned int p_width;
117  unsigned int p_height;
118  unsigned long p_gridSize;
120 
125 
128 
130 
133  };
134 
135 }
136 
137 
138 #endif
Isis::GroundGrid::m_extendGrid
bool m_extendGrid
If the grid should extend past the longitude domain boundary.
Definition: GroundGrid.h:132
Isis::GroundGrid::p_width
unsigned int p_width
This is the width of the grid.
Definition: GroundGrid.h:116
Isis::UniversalGroundMap
Universal Ground Map.
Definition: UniversalGroundMap.h:69
Isis::Latitude
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:51
Isis::GroundGrid::p_minLon
Longitude * p_minLon
Lowest longitude in image.
Definition: GroundGrid.h:122
Isis::GroundGrid::p_mapping
PvlGroup * p_mapping
The mapping group representation of the projection or camera.
Definition: GroundGrid.h:127
Isis::GroundGrid::maxLatitude
Latitude maxLatitude() const
Returns the maximum latitude for the grid.
Definition: GroundGrid.cpp:585
Isis::GroundGrid::p_maxLon
Longitude * p_maxLon
Highest longitude in image.
Definition: GroundGrid.h:124
Isis::GroundGrid::p_groundMap
UniversalGroundMap * p_groundMap
This calculates single grid pts.
Definition: GroundGrid.h:119
Isis::GroundGrid::maxLongitude
Longitude maxLongitude() const
Returns the maximum longitude for the grid.
Definition: GroundGrid.cpp:599
Isis::GroundGrid::p_grid
char * p_grid
This stores the bits of each pixel in the grid.
Definition: GroundGrid.h:113
Isis::GroundGrid::GetGridBit
bool GetGridBit(unsigned int x, unsigned int y, bool latGrid)
Returns true if the specified coordinate is on the grid lines.
Definition: GroundGrid.cpp:691
Isis::Longitude
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:40
Isis::GroundGrid::GetMappingGroup
PvlGroup * GetMappingGroup()
Returns a mapping group representation of the projection or camera.
Definition: GroundGrid.cpp:546
Isis::GroundGrid::p_maxLat
Latitude * p_maxLat
Highest latitude in image.
Definition: GroundGrid.h:123
Isis::GroundGrid::p_latLinesGrid
char * p_latLinesGrid
This stores the bits of each pixel in the grid.
Definition: GroundGrid.h:114
Isis::GroundGrid
Calculates a lat/lon grid over an area.
Definition: GroundGrid.h:58
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::GroundGrid::minLatitude
Latitude minLatitude() const
Returns the minimum latitude for the grid.
Definition: GroundGrid.cpp:557
Isis::GroundGrid::p_gridSize
unsigned long p_gridSize
This is width*height.
Definition: GroundGrid.h:118
Isis::GroundGrid::p_defaultResolution
double p_defaultResolution
Default step size in degrees/pixel.
Definition: GroundGrid.h:129
Isis::GroundGrid::p_reinitialize
bool p_reinitialize
True if we need to reset p_grid in CreateGrid.
Definition: GroundGrid.h:131
Isis::GroundGrid::p_minLat
Latitude * p_minLat
Lowest latitude in image.
Definition: GroundGrid.h:121
Isis::Angle
Defines an angle and provides unit conversions.
Definition: Angle.h:45
Isis::GroundGrid::SetGroundLimits
void SetGroundLimits(Latitude minLat, Longitude minLon, Latitude maxLat, Longitude maxLon)
This restricts (or grows) the ground range in which to draw grid lines.
Definition: GroundGrid.cpp:411
Isis::GroundGrid::WalkBoundary
void WalkBoundary()
This draws grid lines along the extremes of the lat/lon box of the grid.
Definition: GroundGrid.cpp:434
Isis::GroundGrid::PixelOnGrid
bool PixelOnGrid(int x, int y)
Returns true if the grid is on this point.
Definition: GroundGrid.cpp:529
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::GroundGrid::GetXY
virtual bool GetXY(Latitude lat, Longitude lon, unsigned int &x, unsigned int &y)
This method converts a lat/lon to an X/Y.
Definition: GroundGrid.cpp:618
Isis::GroundGrid::SetGridBit
void SetGridBit(unsigned int x, unsigned int y, bool latGrid)
This flags a bit as on the grid lines.
Definition: GroundGrid.cpp:655
Isis::GroundGrid::DrawLineOnGrid
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.
Definition: GroundGrid.cpp:730
Isis::GroundGrid::GroundMap
UniversalGroundMap * GroundMap()
Returns the ground map for children.
Definition: GroundGrid.cpp:643
Isis::GroundGrid::p_height
unsigned int p_height
This is the height of the grid.
Definition: GroundGrid.h:117
Isis::GroundGrid::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,...
Definition: GroundGrid.cpp:40
Isis::GroundGrid::minLongitude
Longitude minLongitude() const
Returns the minimum longitude for the grid.
Definition: GroundGrid.cpp:571
Isis::GroundGrid::CreateGrid
void CreateGrid(Latitude baseLat, Longitude baseLon, Angle latInc, Angle lonInc, Progress *progress=0)
This method draws the grid internally, using default resolutions.
Definition: GroundGrid.cpp:218
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::GroundGrid::~GroundGrid
virtual ~GroundGrid()
Delete the object.
Definition: GroundGrid.cpp:167
Isis::GroundGrid::p_lonLinesGrid
char * p_lonLinesGrid
This stores the bits of each pixel in the grid.
Definition: GroundGrid.h:115