 |
Isis 3 Programmer Reference
|
7 #include "ObliqueCylindrical.h"
14 #include "Constants.h"
15 #include "IException.h"
16 #include "TProjection.h"
19 #include "PvlKeyword.h"
20 #include "NaifStatus.h"
37 ObliqueCylindrical::ObliqueCylindrical(
Pvl &label,
bool allowDefaults) :
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;
76 || mapGroup[
"XAxisVector"].size() != 3) {
77 calculateVectors =
true;
81 || mapGroup[
"YAxisVector"].size() != 3) {
82 calculateVectors =
true;
86 || mapGroup[
"ZAxisVector"].size() != 3) {
87 calculateVectors =
true;
90 if (!calculateVectors) {
114 eul2m_c(rotationAngle, latitudeAngle, longitudeAngle, 3, 2, 3, pvec);
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;
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) {
const double HALFPI
The mathematical constant PI/2.
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_latitude
This contains the currently set latitude value.
PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
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...
const double PI
The mathematical constant PI.
A single keyword-value pair.
bool operator==(const Isis::Projection &proj)
Compares two Projection objects to see if they are equal.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
@ PositiveWest
Longitude values increase in the westerly direction.
@ Unknown
A type of error that cannot be classified as any of the other error types.
double GetX() const
Calculates the unrotated form of current x 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 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.
double poleLatitude() const
Returns the value of the pole latitude.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
double m_poleLongitude
The Oblique Pole Longitude.
PvlGroup m_mappingGrp
Mapping group that created this projection.
double GetY() const
Calculates the unrotated form of the current y value.
double poleRotation() const
Returns the value of the pole rotation.
@ Traverse
Search child objects.
bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
PvlGroup Mapping()
This function returns the keywords that this projection uses.
Contains multiple PvlContainers.
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 m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
Base class for Map TProjections.
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 poleLongitude() const
Returns the value of the pole longitude.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
QString Name() const
Returns the name of the map projection, "ObliqueCylindrical".
void deleteKeyword(const QString &name)
Remove a specified keyword.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
double toDouble(const QString &string)
Global function to convert from a string to a double.
Namespace for the standard library.
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
QString Version() const
Returns the version of the map projection.
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
double m_equatorialRadius
Polar radius of the target.
bool IsPlanetocentric() const
This indicates if the latitude type is planetocentric (as opposed to planetographic).
Base class for Map Projections.
std::vector< double > m_xAxisVector
The x-axis vector, read from the mapping group in the label.
double m_poleRotation
The Oblique Pole Rotation.
double m_poleLatitude
The Oblique Pole Latitude.
This is free and unencumbered software released into the public domain.
Oblique Cylindrical Map Projection.
~ObliqueCylindrical()
Destroys the ObliqueCylindrical object.