|
Isis 3 Programmer Reference
|
12 #include "Constants.h"
13 #include "IException.h"
14 #include "Projection.h"
17 #include "PvlKeyword.h"
19 const double EPSILON = 1.0e-10;
40 Robinson::Robinson(
Pvl &label,
bool allowDefaults) :
68 m_xlr << 0 << 0.9986 <<
94 if ((allowDefaults) && (!mapGroup.
hasKeyword(
"CenterLongitude"))) {
107 QString message =
"Invalid label group [Mapping]";
125 if (!Projection::operator==(proj))
return false;
168 double latRadians = lat *
DEG2RAD;
169 double lonRadians = lon *
DEG2RAD;
174 double p2 = fabs(latRadians / 5.0 /
DEG2RAD);
175 long ip1 = (long) (p2 - EPSILON);
184 m_xlr[ip1 + 1]) / 2.0 +
185 p2 * p2 * (m_xlr[ip1 + 3] - 2.0 * m_xlr[ip1 + 2] +
186 m_xlr[ip1 + 1])/2.0) * deltaLon;
189 m_pr[ip1 +1]) / 2.0 + p2 * p2 * (m_pr[ip1 + 3] -
190 2.0 * m_pr[ip1 + 2] + m_pr[ip1 + 1]) / 2.0);
191 if (lat < 0) y *= -1.;
219 double phid = yy * 90.0;
220 double p2 = fabs(phid / 5.0);
221 long ip1 = (long) (p2 - EPSILON);
222 if (ip1 == 0) ip1 = 1;
236 u = m_pr[ip1 + 3] - m_pr[ip1 + 1];
237 v = m_pr[ip1 + 3] - 2.0 * m_pr[ip1 + 2] + m_pr[ip1 + 1];
238 t = 2.0 * (fabs(yy) - m_pr[ip1 + 2]) / u;
240 p2 = t * (1.0 - c * t * (1.0 - 2.0 * c * t));
242 if ((p2 >= 0.0) || (ip1 == 1)) {
243 phid = (p2 + (double) ip1 ) * 5.0;
244 if (y < 0) phid *= -1;
247 p2 = fabs(phid / 5.0);
248 ip1 = (long) (p2 - EPSILON);
255 m_pr[ip1 +1]) / 2.0 + p2 * p2 * (m_pr[ip1 + 3] -
256 2.0 * m_pr[ip1 + 2] + m_pr[ip1 + 1])/2.0);
257 if (y < 0) y1 *= -1.;
264 }
while (fabs(y1 - y) > .00001);
281 p2 * (m_xlr[ip1 + 3] - m_xlr[ip1 + 1]) / 2.0 +
282 p2 * p2 * (m_xlr[ip1 + 3] - 2.0 * m_xlr[ip1 + 2] +
283 m_xlr[ip1 + 1]) / 2.0);
318 double &minY,
double &maxY) {
397 bool allowDefaults) {
double m_maximumLatitude
Contains the maximum latitude for the entire ground range.
bool operator==(const Projection &proj)
Compares two Projection objects to see if they are equal.
double m_longitude
This contains the currently set longitude value.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
@ Io
A type of error that occurred when performing an actual I/O operation.
double m_minimumLongitude
Contains the minimum longitude for the entire ground range.
double m_latitude
This contains the currently set latitude value.
QString Version() const
Returns the version of the map projection.
A single keyword-value pair.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
double m_minimumLatitude
Contains the minimum latitude for the entire ground range.
@ PositiveWest
Longitude values increase in the westerly direction.
const double DEG2RAD
Multiplier for converting from degrees to radians.
double m_minimumY
See minimumX description.
PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
double m_centerLongitude
The center longitude for the map projection.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Container for cube-like labels.
void SetXY(double x, double y)
This protected method is a helper for derived classes.
void XYRangeCheck(const double latitude, const double longitude)
This convience function is established to assist in the development of the XYRange virtual method.
PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
PvlGroup m_mappingGrp
Mapping group that created this projection.
@ Traverse
Search child objects.
double m_minimumX
The data elements m_minimumX, m_minimumY, m_maximumX, and m_maximumY are convience data elements when...
bool XYRange(double &minX, double &maxX, double &minY, double &maxY)
This method is used to determine the x/y range which completely covers the area of interest specified...
Contains multiple PvlContainers.
bool m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
Base class for Map TProjections.
bool SetGround(const double lat, const double lon)
This method is used to set the latitude/longitude (assumed to be of the correct LatitudeType,...
PvlGroup Mapping()
This function returns the keywords that this projection uses.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
Namespace for the standard library.
QString Name() const
Returns the name of the map projection, "Robinson".
~Robinson()
Destroys the Robinson object.
bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
double m_maximumLongitude
Contains the maximum longitude for the entire ground range.
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
double m_equatorialRadius
Polar radius of the target.
double m_maximumY
See minimumX description.
Base class for Map Projections.
double m_maximumX
See minimumX description.
const double RAD2DEG
Multiplier for converting from radians to degrees.
This is free and unencumbered software released into the public domain.