Isis 3.0
Home
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 
69  class GroundGrid {
70  public:
72  bool splitLatLon,
73  unsigned int width,
74  unsigned int height);
75 
76  virtual ~GroundGrid();
77 
78  void CreateGrid(Latitude baseLat,
79  Longitude baseLon,
80  Angle latInc,
81  Angle lonInc,
82  Progress *progress = 0);
83 
84  void CreateGrid(Latitude baseLat,
85  Longitude baseLon,
86  Angle latInc,
87  Angle lonInc,
88  Progress *progress,
89  Angle latRes,
90  Angle lonRes);
91 
92  void WalkBoundary();
93 
94  void SetGroundLimits(Latitude minLat,
95  Longitude minLon,
96  Latitude maxLat,
97  Longitude maxLon);
98 
99  bool PixelOnGrid(int x, int y);
100  bool PixelOnGrid(int x, int y, bool latGrid);
101 
103 
104  protected:
105  virtual bool GetXY(Latitude lat, Longitude lon,
106  unsigned int &x, unsigned int &y);
107 
109 
110  private:
111  void SetGridBit(unsigned int x, unsigned int y, bool latGrid);
112  bool GetGridBit(unsigned int x, unsigned int y, bool latGrid);
113  void DrawLineOnGrid(unsigned int x1, unsigned int y1,
114  unsigned int x2, unsigned int y2,
115  bool isLatLine);
116 
117 
118  char *p_grid;
119  char *p_latLinesGrid;
120  char *p_lonLinesGrid;
121  unsigned int p_width;
122  unsigned int p_height;
123  unsigned long p_gridSize;
124  UniversalGroundMap *p_groundMap;
125 
126  Latitude *p_minLat;
127  Longitude *p_minLon;
128  Latitude *p_maxLat;
129  Longitude *p_maxLon;
130 
132  PvlGroup *p_mapping;
133 
134  double p_defaultResolution;
135 
136  bool p_reinitialize;
137  };
138 
139 }
140 
141 
142 #endif
Universal Ground Map.
Definition: UniversalGroundMap.h:83
PvlGroup * GetMappingGroup()
Returns a mapping group representation of the projection or camera.
Definition: GroundGrid.cpp:520
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:208
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:59
UniversalGroundMap * GroundMap()
Returns the ground map for children.
Definition: GroundGrid.cpp:555
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:69
Program progress reporter.
Definition: Progress.h:58
GroundGrid(UniversalGroundMap *gmap, bool splitLatLon, unsigned int width, unsigned int height)
This method initializes the class by allocating the grid, calculating the lat/lon range...
Definition: GroundGrid.cpp:32
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
Defines an angle and provides unit conversions.
Definition: Angle.h:58
virtual ~GroundGrid()
Delete the object.
Definition: GroundGrid.cpp:157
void WalkBoundary()
This draws grid lines along the extremes of the lat/lon box of the grid.
Definition: GroundGrid.cpp:416
bool PixelOnGrid(int x, int y)
Returns true if the grid is on this point.
Definition: GroundGrid.cpp:503
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:535
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:393