7#include "RingPlaneProjection.h"
20#include "Displacement.h"
22#include "IException.h"
25#include "NaifStatus.h"
28#include "PvlKeyword.h"
29#include "SpecialPixel.h"
30#include "WorldMapper.h"
73 if ((QString)
m_mappingGrp[
"RingLongitudeDirection"] ==
"Clockwise") {
76 else if ((QString)
m_mappingGrp[
"RingLongitudeDirection"] ==
"CounterClockwise") {
80 QString msg =
"Projection failed. Invalid value for keyword "
81 "[RingLongitudeDirection] must be "
82 "[Clockwise or CounterClockwise]";
87 if ((QString)
m_mappingGrp[
"RingLongitudeDomain"] ==
"360") {
90 else if ((QString)
m_mappingGrp[
"RingLongitudeDomain"] ==
"180") {
94 QString msg =
"Projection failed. Invalid value for keyword "
95 "[RingLongitudeDomain] must be [180 or 360]";
112 IString msg =
"Projection failed. "
119 IString msg =
"Projection failed. "
126 IString msg =
"Projection failed. "
127 "[MinimumRingRadius,MaximumRingRadius] of ["
130 +
"properly ordered";
135 IString msg =
"Projection failed. "
136 "[MinimumRingLongitude,MaximumRingLongitude] of ["
139 +
"properly ordered";
163 IString msg =
"Projection failed. Invalid label group [Mapping]";
182 if (!Projection::operator==(proj))
return false;
184 if (
IsClockwise() != rproj->IsClockwise())
return false;
185 if (
Has180Domain() != rproj->Has180Domain())
return false;
241 if (ringLongitude ==
Null) {
243 "Unable to convert to Clockwise. The given ring longitude value ["
247 double myRingLongitude = ringLongitude;
249 myRingLongitude *= -1;
254 else if (domain == 180) {
259 +
"] is not 180 or 360.";
263 return myRingLongitude;
281 if (ringLongitude ==
Null) {
283 "Unable to convert to CounterClockwise. The given ring longitude value ["
284 +
IString(ringLongitude) +
"] is invalid.",
287 double myRingLongitude = ringLongitude;
289 myRingLongitude *= -1;
294 else if (domain == 180) {
298 IString msg =
"Unable to convert ring longitude. Domain [" +
IString(domain)
299 +
"] is not 180 or 360.";
303 return myRingLongitude;
316 return "CounterClockwise";
353 if (ringLongitude ==
Null) {
355 "Unable to convert to 180 degree domain. The given ring longitude value ["
356 +
IString(ringLongitude) +
"] is invalid.",
371 if (ringLongitude ==
Null) {
373 "Unable to convert to 360 degree domain. The given ring longitude value ["
374 +
IString(ringLongitude) +
"] is invalid.",
377 double result = ringLongitude;
379 if ( (ringLongitude < 0.0 || ringLongitude > 360.0) &&
380 !qFuzzyCompare(ringLongitude, 0.0) && !qFuzzyCompare(ringLongitude, 360.0)) {
457 if (ringRadius ==
Null || ringLongitude ==
Null) {
547 if (ringRadius ==
Null || ringLongitude ==
Null) {
593 return ringLongitude;
657 double &minY,
double &maxY) {
710 if (ringRadius ==
Null || ringLongitude ==
Null) {
double degrees() const
Get the angle in units of Degrees.
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
@ Unknown
A type of error that cannot be classified as any of the other error types.
Adds specific functionality to C++ strings.
This class is designed to encapsulate the concept of a Longitude.
Longitude force180Domain() const
This returns a longitude that is constricted to -180 to 180 degrees.
Longitude force360Domain() const
This returns a longitude that is constricted to 0-360 degrees.
Base class for Map Projections.
@ RingPlane
These projections are used to map ring planes.
WorldMapper * m_mapper
This points to a mapper passed into the SetWorldMapper method.
double XCoord() const
This returns the projection X provided SetGround, SetCoordinate, SetUniversalGround,...
double m_maximumX
See minimumX description.
virtual bool HasGroundRange() const
This indicates if the longitude direction type is positive west (as opposed to postive east).
bool m_groundRangeGood
Indicates if the ground range (min/max lat/lons) were read from the labels.
double YCoord() const
This returns the projection Y provided SetGround, SetCoordinate, SetUniversalGround,...
bool m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
double m_minimumX
The data elements m_minimumX, m_minimumY, m_maximumX, and m_maximumY are convience data elements when...
PvlGroup m_mappingGrp
Mapping group that created this projection.
double m_minimumY
See minimumX description.
void SetXY(double x, double y)
This protected method is a helper for derived classes.
bool IsGood() const
This indicates if the last invocation of SetGround, SetCoordinate, SetUniversalGround,...
void setProjectionType(const ProjectionType ptype)
Sets the projection subclass type.
double m_maximumY
See minimumX description.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Contains multiple PvlContainers.
Container for cube-like labels.
Base class for Map Projections of plane shapes.
static double ToClockwise(const double ringLongitude, const int domain)
This method converts an ring longitude into the clockwise direction.
double m_minimumRingLongitude
Contains the minimum longitude for the entire ground range.
bool Has360Domain() const
This indicates if the ring longitude domain is 0 to 360 (as opposed to -180 to 180).
double UniversalRingLongitude()
This returns a universal ring longitude (clockwise in 0 to 360 domain).
static double To360Domain(const double lon)
This method converts an ring longitude into the 0 to 360 domain.
double MaximumRingLongitude() const
This returns the maximum ring longitude of the area of interest.
double RingRadius() const
This returns a radius.
virtual PvlGroup MappingRingLongitudes()
This function returns the ring longitude keywords that this projection uses.
double UniversalRingRadius()
This returns a universal radius, which is just the radius in meters.
RingPlaneProjection(Pvl &label)
Constructs an empty RingPlaneProjection object.
virtual double TrueScaleRingRadius() const
This method returns the radius of true scale.
virtual ~RingPlaneProjection()
Destroys the Projection object.
bool IsClockwise() const
This indicates if the longitude direction type is positive west (as opposed to postive east).
int m_ringLongitudeDomain
This integer is either 180 or 360 and is read from the labels.
virtual PvlGroup Mapping()
This method is used to find the XY range for oblique aspect projections (non-polar projections) by "w...
virtual bool operator==(const Projection &proj)
This method determines whether two map projection objects are equal by comparing the ring longitude d...
double m_maximumRingRadius
Contains the maximum ring radius for the entire ground range.
double LocalRadius() const
This returns a local radius.
static double To180Domain(const double lon)
This method converts a ring longitude into the -180 to 180 domain.
bool IsCounterClockwise() const
This indicates if the longitude direction type is positive east (as opposed to postive west).
double m_maximumRingLongitude
Contains the maximum longitude for the entire ground range.
std::string RingLongitudeDirectionString() const
This method returns the ring longitude direction as a string.
void XYRangeCheck(const double ringRadius, const double ringLongitude)
This convience function is established to assist in the development of the XYRange virtual method.
double m_ringRadius
This contain a ring radius value in m.
bool SetUniversalGround(const double ringRadius, const double ringLongitude)
This method is used to set the ring radius/longitude which must be PositiveEast/Domain360 (ring longi...
virtual PvlGroup MappingRingRadii()
This function returns the ring radius keywords that this projection uses.
virtual bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
double m_ringLongitude
This contain a ring longitude value.
static double ToCounterClockwise(const double ringLongitude, const int domain)
This method converts an ring longitude into the counterclockwise direction.
double Scale() const
This method returns the scale for mapping world coordinates into projection coordinates.
double MaximumRingRadius() const
This returns the maximum radius of the area of interest.
std::string RingLongitudeDomainString() const
This method returns the ring longitude domain as a string.
@ Clockwise
Ring longitude values increase in the clockwise direction.
@ CounterClockwise
Ring longitude values increase in the counterclockwise direction.
RingLongitudeDirection m_ringLongitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
bool Has180Domain() const
This indicates if the longitude domain is -180 to 180 (as opposed to 0 to 360).
double MinimumRingLongitude() const
This returns the minimum ring longitude of the area of interest.
double MinimumRingRadius() const
This returns the minimum radius of the area of interest.
double RingLongitude() const
This returns a ring longitude with correct ring longitude direction and domain as specified in the la...
virtual 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...
double m_minimumRingRadius
Contains the minimum ring radius for the entire ground range.
virtual bool SetGround(const double ringRadius, const double ringLongitude)
This method is used to set the ring radius/longitude (assumed to be of the correct LatitudeType,...
virtual double Resolution() const
This virtual method will the resolution of the world system relative to one unit in the projection sy...
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 DEG2RAD
Multiplier for converting from degrees to radians.
const double Null
Value for an Isis Null pixel.
Namespace for the standard library.