Isis 3 Programmer Reference
GroundGrid.h
Go to the documentation of this file.
1 #ifndef GroundGrid_h
2 #define GroundGrid_h
3 
25 namespace Isis {
26  class Angle;
27  class Latitude;
28  class Longitude;
29  class PvlGroup;
30  class Progress;
31  class UniversalGroundMap;
32 
73  class GroundGrid {
74  public:
76  bool splitLatLon,
77  bool extendGrid,
78  unsigned int width,
79  unsigned int height);
80 
81  virtual ~GroundGrid();
82 
83  void CreateGrid(Latitude baseLat,
84  Longitude baseLon,
85  Angle latInc,
86  Angle lonInc,
87  Progress *progress = 0);
88 
89  void CreateGrid(Latitude baseLat,
90  Longitude baseLon,
91  Angle latInc,
92  Angle lonInc,
93  Progress *progress,
94  Angle latRes,
95  Angle lonRes);
96 
97  void WalkBoundary();
98 
99  void SetGroundLimits(Latitude minLat,
100  Longitude minLon,
101  Latitude maxLat,
102  Longitude maxLon);
103 
104  bool PixelOnGrid(int x, int y);
105  bool PixelOnGrid(int x, int y, bool latGrid);
106 
107  Latitude minLatitude() const;
108  Longitude minLongitude() const;
109  Latitude maxLatitude() const;
110  Longitude maxLongitude() const;
111 
113 
114  protected:
115  virtual bool GetXY(Latitude lat, Longitude lon,
116  unsigned int &x, unsigned int &y);
117 
119 
120  private:
121  void SetGridBit(unsigned int x, unsigned int y, bool latGrid);
122  bool GetGridBit(unsigned int x, unsigned int y, bool latGrid);
123  void DrawLineOnGrid(unsigned int x1, unsigned int y1,
124  unsigned int x2, unsigned int y2,
125  bool isLatLine);
126 
127 
128  char *p_grid;
131  unsigned int p_width;
132  unsigned int p_height;
133  unsigned long p_gridSize;
135 
140 
143 
145 
148  };
149 
150 }
151 
152 
153 #endif
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:34
Universal Ground Map.
PvlGroup * GetMappingGroup()
Returns a mapping group representation of the projection or camera.
Definition: GroundGrid.cpp:540
double p_defaultResolution
Default step size in degrees/pixel.
Definition: GroundGrid.h:144
bool p_reinitialize
True if we need to reset p_grid in CreateGrid.
Definition: GroundGrid.h:146
Latitude * p_maxLat
Highest latitude in image.
Definition: GroundGrid.h:138
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:212
Latitude * p_minLat
Lowest latitude in image.
Definition: GroundGrid.h:136
unsigned long p_gridSize
This is width*height.
Definition: GroundGrid.h:133
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:63
UniversalGroundMap * GroundMap()
Returns the ground map for children.
Definition: GroundGrid.cpp:637
unsigned int p_width
This is the width of the grid.
Definition: GroundGrid.h:131
Latitude maxLatitude() const
Returns the maximum latitude for the grid.
Definition: GroundGrid.cpp:579
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
Calculates a lat/lon grid over an area.
Definition: GroundGrid.h:73
char * p_lonLinesGrid
This stores the bits of each pixel in the grid.
Definition: GroundGrid.h:130
Program progress reporter.
Definition: Progress.h:58
unsigned int p_height
This is the height of the grid.
Definition: GroundGrid.h:132
PvlGroup * p_mapping
The mapping group representation of the projection or camera.
Definition: GroundGrid.h:142
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
void SetGridBit(unsigned int x, unsigned int y, bool latGrid)
This flags a bit as on the grid lines.
Definition: GroundGrid.cpp:649
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:724
Longitude * p_maxLon
Highest longitude in image.
Definition: GroundGrid.h:139
UniversalGroundMap * p_groundMap
This calculates single grid pts.
Definition: GroundGrid.h:134
char * p_grid
This stores the bits of each pixel in the grid.
Definition: GroundGrid.h:128
Longitude * p_minLon
Lowest longitude in image.
Definition: GroundGrid.h:137
Defines an angle and provides unit conversions.
Definition: Angle.h:62
virtual ~GroundGrid()
Delete the object.
Definition: GroundGrid.cpp:161
bool GetGridBit(unsigned int x, unsigned int y, bool latGrid)
Returns true if the specified coordinate is on the grid lines.
Definition: GroundGrid.cpp:685
char * p_latLinesGrid
This stores the bits of each pixel in the grid.
Definition: GroundGrid.h:129
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Longitude maxLongitude() const
Returns the maximum longitude for the grid.
Definition: GroundGrid.cpp:593
bool m_extendGrid
If the grid should extend past the longitude domain boundary.
Definition: GroundGrid.h:147
void WalkBoundary()
This draws grid lines along the extremes of the lat/lon box of the grid.
Definition: GroundGrid.cpp:428
bool PixelOnGrid(int x, int y)
Returns true if the grid is on this point.
Definition: GroundGrid.cpp:523
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:612
Latitude minLatitude() const
Returns the minimum latitude for the grid.
Definition: GroundGrid.cpp:551
Longitude minLongitude() const
Returns the minimum longitude for the grid.
Definition: GroundGrid.cpp:565
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:405