Isis Developer Reference
GroundGrid.h
Go to the documentation of this file.
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;
114  char *p_latLinesGrid;
115  char *p_lonLinesGrid;
116  unsigned int p_width;
117  unsigned int p_height;
118  unsigned long p_gridSize;
119  UniversalGroundMap *p_groundMap;
120 
121  Latitude *p_minLat;
122  Longitude *p_minLon;
123  Latitude *p_maxLat;
124  Longitude *p_maxLon;
125 
127  PvlGroup *p_mapping;
128 
129  double p_defaultResolution;
130 
131  bool p_reinitialize;
132  bool m_extendGrid;
133  };
134 
135 }
136 
137 
138 #endif
ProjectionFactory.h
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::UniversalGroundMap
Universal Ground Map.
Definition: UniversalGroundMap.h:69
Isis::Progress::CheckStatus
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:105
Isis::Latitude
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:51
Isis::Progress::SetMaximumSteps
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:85
GroundGrid.h
Longitude.h
Isis::GroundGrid::maxLatitude
Latitude maxLatitude() const
Returns the maximum latitude for the grid.
Definition: GroundGrid.cpp:585
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::GroundGrid::maxLongitude
Longitude maxLongitude() const
Returns the maximum longitude for the grid.
Definition: GroundGrid.cpp:599
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
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::Latitude::setErrorChecking
void setErrorChecking(ErrorChecking errors)
Set the error checking status.
Definition: Latitude.cpp:420
Isis::GroundGrid
Calculates a lat/lon grid over an area.
Definition: GroundGrid.h:58
Latitude.h
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
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::IException
Isis exception class.
Definition: IException.h:91
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
UniversalGroundMap.h
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
Camera.h
Isis::toDouble
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
std
Namespace for the standard library.
Isis::Angle::isValid
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid,...
Definition: Angle.cpp:95
Isis::GroundGrid::GroundMap
UniversalGroundMap * GroundMap()
Returns the ground map for children.
Definition: GroundGrid.cpp:643
Angle.h
Isis::Distance::meters
double meters() const
Get the distance in meters.
Definition: Distance.cpp:85
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
Projection.h
Isis::GroundGrid::minLongitude
Longitude minLongitude() const
Returns the minimum longitude for the grid.
Definition: GroundGrid.cpp:571
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Distance.h
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
Progress.h
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