7#include "ObliqueCylindrical.h"
15#include "IException.h"
16#include "TProjection.h"
19#include "PvlKeyword.h"
20#include "NaifStatus.h"
50 if (m_poleLatitude < -90 || m_poleLatitude > 90) {
52 "Pole latitude must be between -90 and 90.",
58 if (m_poleLongitude < -360 || m_poleLongitude > 360) {
60 "Pole longitude must be between -360 and 360.",
66 if (m_poleRotation < -360 || m_poleRotation > 360) {
68 "Pole rotation must be between -360 and 360.",
72 bool calculateVectors =
false;
75 if (!mapGroup.hasKeyword(
"XAxisVector")
76 || mapGroup[
"XAxisVector"].size() != 3) {
77 calculateVectors =
true;
80 if (!mapGroup.hasKeyword(
"YAxisVector")
81 || mapGroup[
"YAxisVector"].size() != 3) {
82 calculateVectors =
true;
85 if (!mapGroup.hasKeyword(
"ZAxisVector")
86 || mapGroup[
"ZAxisVector"].size() != 3) {
87 calculateVectors =
true;
90 if (!calculateVectors) {
114 eul2m_c(rotationAngle, latitudeAngle, longitudeAngle, 3, 2, 3, pvec);
118 if (mapGroup.hasKeyword(
"XAxisVector")) {
119 mapGroup.deleteKeyword(
"XAxisVector");
121 if (mapGroup.hasKeyword(
"YAxisVector")) {
122 mapGroup.deleteKeyword(
"YAxisVector");
124 if (mapGroup.hasKeyword(
"ZAxisVector")) {
125 mapGroup.deleteKeyword(
"ZAxisVector");
133 for (
int i = 0; i < 3; i++) {
138 mapGroup[
"XAxisVector"] +=
toString(pvec[0][i]);
139 mapGroup[
"YAxisVector"] +=
toString(pvec[1][i]);
140 mapGroup[
"ZAxisVector"] +=
toString(pvec[2][i]);
147 QString message =
"Invalid label group [Mapping]";
165 if (!Projection::operator==(proj))
return false;
169 if (obProjection->poleLatitude() !=
poleLatitude())
return false;
170 if (obProjection->poleLongitude() !=
poleLongitude())
return false;
171 if (obProjection->poleRotation() !=
poleRotation())
return false;
182 return "ObliqueCylindrical";
208 double normalLat, normalLon;
209 double obliqueLat, obliqueLon;
232 obliqueLon = atan2(cos(normalLat) * sin(normalLon -
poleLongitude),
237 while(obliqueLon < -
PI) {
238 obliqueLon += (2.0 *
PI);
241 while(obliqueLon >=
PI) {
242 obliqueLon -= (2.0 *
PI);
290 double obliqueLat, obliqueLon;
346 double &minY,
double &maxY) {
418 void ObliqueCylindrical::init() {
430 "The input center latitude is too close to a pole "
431 "which will result in a division by zero.",
450 bool allowDefaults) {
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ Io
A type of error that occurred when performing an actual I/O operation.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Oblique Cylindrical Map Projection.
QString Version() const
Returns the version of the map projection.
std::vector< double > m_xAxisVector
The x-axis vector, read from the mapping group in the label.
~ObliqueCylindrical()
Destroys the ObliqueCylindrical object.
bool SetGround(const double lat, const double lon)
This method is used to set the latitude/longitude (assumed to be of the correct LatitudeType,...
bool operator==(const Isis::Projection &proj)
Compares two Projection objects to see if they are equal.
ObliqueCylindrical(Isis::Pvl &label, bool allowDefaults=false)
Constructs an ObliqueCylindrical object.
std::vector< double > m_yAxisVector
The y-axis vector, read from the mapping group in the label.
std::vector< double > m_zAxisVector
The z-axis vector, read from the mapping group in the label.
PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
double poleRotation() const
Returns the value of the pole rotation.
double m_poleLongitude
The Oblique Pole Longitude.
double poleLongitude() const
Returns the value of the pole longitude.
double m_poleLatitude
The Oblique Pole Latitude.
QString Name() const
Returns the name of the map projection, "ObliqueCylindrical".
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...
bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
double poleLatitude() const
Returns the value of the pole latitude.
PvlGroup Mapping()
This function returns the keywords that this projection uses.
double m_poleRotation
The Oblique Pole Rotation.
Base class for Map Projections.
double GetX() const
Calculates the unrotated form of current x value.
bool m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
PvlGroup m_mappingGrp
Mapping group that created this projection.
double GetY() const
Calculates the unrotated form of the current y value.
void SetXY(double x, double y)
This protected method is a helper for derived classes.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
@ Traverse
Search child objects.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Base class for Map TProjections.
double m_longitude
This contains the currently set longitude value.
bool xyRangeOblique(double &minX, double &maxX, double &minY, double &maxY)
This method is used to find the XY range for oblique aspect projections (non-polar projections) by "w...
bool IsPlanetocentric() const
This indicates if the latitude type is planetocentric (as opposed to planetographic).
double m_equatorialRadius
Polar radius of the target.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
@ PositiveWest
Longitude values increase in the westerly direction.
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
double m_latitude
This contains the currently set latitude value.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
const double HALFPI
The mathematical constant PI/2.
double toDouble(const QString &string)
Global function to convert from a string to a double.
const double PI
The mathematical constant PI.
Namespace for the standard library.