|
Isis 3 Programmer Reference
|
11 #include "Constants.h"
13 #include "IException.h"
17 #include "SpecialPixel.h"
111 QString msg =
"Unable to create Latitude object from given mapping group.";
118 if (mapping[
"LatitudeType"][0] ==
"Planetographic") {
121 else if (mapping[
"LatitudeType"][0] ==
"Planetocentric") {
125 QString msg =
"Latitude type [" + mapping[
"LatitudeType"][0] +
126 "] is not recognized";
171 QString msg =
"Unable to create Latitude object from given mapping group.";
178 if (mapping[
"LatitudeType"][0] ==
"Planetographic") {
181 else if (mapping[
"LatitudeType"][0] ==
"Planetocentric") {
185 QString msg =
"Latitude type [" + mapping[
"LatitudeType"][0] +
186 "] is not recognized";
229 QString msg =
"Enumeration value [" +
toString(latType) +
"] is not a valid CoordinateType";
318 QString msg =
"Latitude [" +
toString(
true) +
"] cannot "
319 "be converted to Planetographic without the planetary radii, please "
320 "use the other Latitude constructor.";
326 QString msg =
"Latitudes outside of the -90/90 range cannot be converted "
327 "between Planetographic and Planetocentric";
332 QString msg =
"Invalid planetographic latitudes are not currently "
337 double ographicLatitude = atan(tan(
radians()) *
363 QString msg =
"Latitude [" +
Isis::toString(latitude) +
" degrees] cannot be "
364 "converted to Planetocentic without the planetary radii, please use "
365 "the other Latitude constructor.";
369 Angle inputAngle(latitude, units);
373 QString msg =
"Latitudes outside of the -90/90 range cannot be converted "
374 "between Planetographic and Planetocentric";
382 QString msg =
"Invalid planetographic latitudes are not currently "
387 double ocentricLatitude = atan(tan(inputAngle.
radians()) *
392 if ((ocentricLatitude > 0) != (inputAngle.
radians() > 0)) {
393 ocentricLatitude *= -1;
443 QString msg =
"Minimum latitude [" + min.
toString(
true) +
444 "] is greater than maximum latitude [" +
451 Latitude adjustedMin = min - epsilon;
452 Latitude adjustedMax = max + epsilon;
455 return *
this >= adjustedMin && *
this <= adjustedMax;
469 if (
this == &latitudeToCopy)
return *
this;
524 QString msg =
"Unable to add angle to Latitude object from given mapping group.";
529 if (mapping[
"LatitudeType"][0] ==
"Planetocentric")
531 else if (mapping[
"LatitudeType"][0] ==
"Planetographic")
534 QString msg =
"Latitude type [" + mapping[
"LatitudeType"][0] +
"] is not recognized";
538 return add(angleToAdd, equatorialRadius, polarRadius, latType);
591 QString msg =
"Latitudes past 90 degrees are not valid. The latitude ["
static PvlGroup radiiGroup(QString target)
Creates a Pvl Group with keywords TargetName, EquitorialRadius, and PolarRadius.
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
virtual QString toString(bool includeUnits=true) const
Get the angle in human-readable form.
This class is designed to encapsulate the concept of a Latitude.
Latitude add(Angle angleToAdd, PvlGroup mapping)
Adds an angle to this latitude.
Distance * m_polarRadius
Used for converting to Planetographic, this is the radius of the target perpendicular to the equatori...
double planetographic(Angle::Units units=Angle::Radians) const
Get the latitude in the planetographic coordinate system.
@ Unknown
A type of error that cannot be classified as any of the other error types.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
~Latitude()
This cleans up the Latitude class.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
bool IsSpecial(const double d)
Returns if the input pixel is special.
@ Planetographic
This is a secondary coordinate system for latitudes.
Distance measurement, usually in meters.
ErrorChecking
Some user-configurable error checking parameters.
void setErrorChecking(ErrorChecking errors)
Set the error checking status.
void setPlanetographic(double latitude, Angle::Units units=Angle::Radians)
Set the latitude given a value in the Planetographic coordinate system.
void setPlanetocentric(double latitude, Angle::Units units=Angle::Radians)
Set the latitude given a value in the Planetocentric coordinate system.
@ Meters
The distance is being specified in meters.
virtual void setAngle(const double &angle, const Angle::Units &units)
Same as planetocentric.
Contains multiple PvlContainers.
@ Planetocentric
This is the universal (and default) latitude coordinate system.
Distance * m_equatorialRadius
Used for converting to Planetographic, this is the radius of the target on the equatorial plane.
Latitude & operator=(const Latitude &latitudeToCopy)
This assigns another latitude to this one - making this latitude an exact duplicate of the other.
Units
The set of usable angle measurement units.
Defines an angle and provides unit conversions.
Latitude()
Create a blank Latitude object without Planetographic support.
ErrorChecking m_errors
This contains which exceptions should not be thrown.
@ AllowPastPole
Don't throw an exception if a latitude beyond -90/90 is found.
double toDouble(const QString &string)
Global function to convert from a string to a double.
@ Programmer
This error is for when a programmer made an API call that was illegal.
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid,...
Angle()
Constructs a blank angle object which needs a value to be set in order to do any calculations.
double planetocentric(Angle::Units units=Angle::Radians) const
Get the latitude in the planetocentric (universal) coordinate system.
double degrees() const
Get the angle in units of Degrees.
virtual void setAngle(const double &angle, const Units &unit)
Set angle value in desired units.
bool inRange(Latitude min, Latitude max) const
Checks if this latitude value is within the given range.
ErrorChecking errorChecking() const
Get the error checking status.
CoordinateType
These are the latitude coordinate systems.
virtual double angle(const Units &unit) const
Return angle value in desired units.
@ Radians
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
This is free and unencumbered software released into the public domain.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
double radians() const
Convert an angle to a double.