55 PointPerspective::PointPerspective(
Pvl &label,
bool allowDefaults) :
63 if ((allowDefaults) && (!mapGroup.
hasKeyword(
"CenterLongitude"))) {
70 if ((allowDefaults) && (!mapGroup.
hasKeyword(
"CenterLatitude"))) {
99 QString message =
"Invalid label group [Mapping]";
117 if (!Projection::operator==(proj))
return false;
123 (point->
m_distance != this->m_distance))
return false;
133 return "PointPerspective";
180 double lonRadians = lon *
PI / 180.0;
185 double latRadians = lat;
187 latRadians *=
PI / 180.0;
191 double sinphi = sin(latRadians);
192 double cosphi = cos(latRadians);
193 double coslon = cos(deltaLon);
197 if (g < (1.0 /
m_P)) {
202 double ksp = (
m_P - 1.0) / (
m_P - g);
208 if (sqrt(x*x+y*y)> projectionRadius) {
240 double rho, rp, con, com, z, sinz, cosz;
241 const double epsilon = 1.0e-10;
248 if (rp > (sqrt(con / com))) {
255 if (fabs(rho) <= epsilon) {
263 sinz = (
m_P - sqrt(1.0 - rp * rp * com / con)) / (con / rp + rp / con);
269 if (con > 1.0) con = 1.0;
270 if (con < -1.0) con = -1.0;
274 if (fabs(con) <= epsilon) {
284 if ((fabs(con) >= epsilon) || (fabs(
GetX()) >= epsilon)) {
345 minX =
XCoord() - projectionRadius;
346 maxX =
XCoord() + projectionRadius;
347 minY =
YCoord() - projectionRadius;
348 maxY =
YCoord() + projectionRadius;
407 bool allowDefaults) {
double m_distance
Distance fromp perspective point to planet center.
PointPerspective Map Projection.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
bool SetGround(const double lat, const double lon)
This method is used to set the latitude/longitude (assumed to be of the correct LatitudeType, LongitudeDirection, and LongitudeDomain.
PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
const double PI
The mathematical constant PI.
Longitude values increase in the westerly direction.
PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
Base class for Map TProjections.
const double HALFPI
The mathematical constant PI/2.
Namespace for the standard library.
~PointPerspective()
Destroys the PointPerspective object.
double GetX() const
Calculates the unrotated form of current x value.
double XCoord() const
This returns the projection X provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
double TrueScaleLatitude() const
Returns the latitude of true scale, in degrees.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
A type of error that occurred when performing an actual I/O operation.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
double m_latitude
This contains the currently set latitude value.
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
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.
double m_centerLatitude
The center latitude for the map projection.
bool IsPlanetocentric() const
This indicates if the latitude type is planetocentric (as opposed to planetographic).
double m_maximumLongitude
Contains the maximum longitude for the entire ground range.
double m_minimumLatitude
Contains the minimum latitude for the entire ground range.
bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
QString Name() const
Returns the name of the map projection, "PointPerspective".
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_maximumLatitude
Contains the maximum latitude for the entire ground range.
Base class for Map Projections.
double m_equatorialRadius
Polar radius of the target.
int m_longitudeDomain
This integer is either 180 or 360 and is read from the labels.
static double To180Domain(const double lon)
This method converts a longitude into the -180 to 180 domain.
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
A single keyword-value pair.
double m_P
Perspective Point.
double YCoord() const
This returns the projection Y provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
double m_centerLongitude
The center longitude for the map projection.
Container for cube-like labels.
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
bool m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
static double To360Domain(const double lon)
This method converts a longitude into the 0 to 360 domain.
double m_cosph0
Cosine of the center latitude.
Isis::Projection * PointPerspectivePlugin(Isis::Pvl &lab, bool allowDefaults)
This is the function that is called in order to instantiate a PointPerspectve object.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
QString Version() const
Returns the version of the map projection.
Namespace for ISIS/Bullet specific routines.
double GetY() const
Calculates the unrotated form of the current y value.
double ToPlanetocentric(const double lat) const
This method converts a planetographic latitude to a planetocentric latitude.
double m_sinph0
Sine of the center latitude.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
void SetXY(double x, double y)
This protected method is a helper for derived classes.
double m_minimumLongitude
Contains the minimum longitude for the entire ground range.
PvlGroup m_mappingGrp
Mapping group that created this projection.
PvlGroup Mapping()
This function returns the keywords that this projection uses.