Isis 3 Developer Reference
|
This class is designed to encapsulate the concept of a Longitude. More...
#include <Longitude.h>
Public Types | |
enum | Direction { PositiveEast, PositiveWest } |
Possible longitude directions: Is a positive longitude towards east or towards west? More... | |
enum | Domain { Domain360, Domain180 } |
Use LongitudeDomain360 if 0-360 is the primary range of the longitude values with 180 being the 'center'. More... | |
enum | Units { Degrees, Radians } |
The set of usable angle measurement units. More... | |
Public Member Functions | |
Longitude () | |
Create a blank Longitude object with 0-360 domain. More... | |
Longitude (double longitude, Angle::Units longitudeUnits, Direction lonDir=PositiveEast, Domain lonDomain=Domain360) | |
Create and initialize a Longitude value. More... | |
Longitude (Angle longitude, Direction lonDir=PositiveEast, Domain lonDomain=Domain360) | |
Create and initialize a Longitude value. More... | |
Longitude (double longitude, PvlGroup mapping, Angle::Units longitudeUnits) | |
Create and initialize a Longitude value. More... | |
Longitude (const Longitude &longitudeToCopy) | |
This copies the given longitude exactly. More... | |
~Longitude () | |
This cleans up the Longitude class. More... | |
double | positiveEast (Angle::Units units=Angle::Radians) const |
Get the longitude in the PositiveEast coordinate system. More... | |
void | setPositiveEast (double longitude, Angle::Units units=Angle::Radians) |
Set the longitude given a value in the PositiveEast longitude system. More... | |
double | positiveWest (Angle::Units units=Angle::Radians) const |
Get the longitude in the PositiveWest coordinate system. More... | |
void | setPositiveWest (double longitude, Angle::Units units=Angle::Radians) |
Set the longitude given a value in the PositiveWest longitude system. More... | |
Longitude | force180Domain () const |
This returns a longitude that is constricted to -180 to 180 degrees. More... | |
Longitude | force360Domain () const |
This returns a longitude that is constricted to 0-360 degrees. More... | |
bool | inRange (Longitude min, Longitude max) const |
Checks if this longitude value is within the given range. More... | |
Longitude & | operator= (const Longitude &longitudeToCopy) |
Same as positiveEast. More... | |
bool | isValid () const |
This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state. More... | |
Angle | operator+ (const Angle &angle2) const |
Add angle value to another. More... | |
Angle | operator- (const Angle &angle2) const |
Subtract angle value from another and return the resulting angle. More... | |
Angle | operator* (double value) const |
Multiply this angle by a double and return the resulting angle. More... | |
Angle | operator* (int value) const |
Multiply this angle by an integer and return the resulting angle. More... | |
Angle | operator/ (double value) const |
Divide this angle by a double. More... | |
double | operator/ (Angle value) const |
Divide this angle by another angle and return the ratio. More... | |
Angle | operator/ (int value) const |
Divide this angle by an integer and return the resulting angle. More... | |
bool | operator< (const Angle &angle2) const |
Test if the other angle is less than the current angle. More... | |
bool | operator> (const Angle &angle2) const |
Test if the other angle is greater than the current angle. More... | |
void | operator+= (const Angle &angle2) |
Add angle value to another as double and replace original. More... | |
void | operator-= (const Angle &angle2) |
Subtract angle value from another and set this instance to the resulting angle. More... | |
void | operator*= (double value) |
Multiply this angle by a double and set this instance to the resulting angle. More... | |
void | operator/= (double value) |
Divide this angle by a double and return the resulting angle. More... | |
bool | operator== (const Angle &angle2) const |
Test if another angle is equal to this angle. More... | |
bool | operator!= (const Angle &angle2) const |
Test if another angle is not equal to this angle. More... | |
bool | operator<= (const Angle &angle2) const |
Test if the other angle is less than or equal to the current angle. More... | |
bool | operator>= (const Angle &angle2) const |
Test if the other angle is greater than or equal to the current angle. More... | |
double | radians () const |
Convert an angle to a double. More... | |
double | degrees () const |
Get the angle in units of Degrees. More... | |
void | setRadians (double radians) |
Set the angle in units of Radians. More... | |
void | setDegrees (double degrees) |
Set the angle in units of Degrees. More... | |
virtual QString | toString (bool includeUnits=true) const |
Get the angle in human-readable form. More... | |
double | unitWrapValue (const Units &unit) const |
Return wrap value in desired units. More... | |
virtual double | angle (const Units &unit) const |
Return angle value in desired units. More... | |
virtual void | setAngle (const double &angle, const Units &unit) |
Set angle value in desired units. More... | |
Static Public Member Functions | |
static QList< QPair< Longitude, Longitude > > | to360Range (Longitude startLon, Longitude endLon) |
Calculates where the longitude range is in 0-360. More... | |
static Angle | fullRotation () |
Makes an angle to represent a full rotation (0-360 or 0-2pi). More... | |
This class is designed to encapsulate the concept of a Longitude.
This is used primary for surface points but is also a general purpose class. This class accepts values past the longitude domain limits. This adds the concept of longitude direction to the Angle class.
Use LongitudeDomain360 if 0-360 is the primary range of the longitude values with 180 being the 'center'.
use LongitudeDomain180 if 0 is the 'center' longitude. This is used for converting between longitude directions, because a 'center' longitude of 0 (-180 to 180) implies negation is all that needs done to reverse the longitude direction, whereas if you are in the 360 domain, where 180 is the center, more needs done.
Enumerator | |
---|---|
Domain360 | As the longitude increases the actual position is more east. |
Domain180 | As the longitude increases the actual position is more west. |
|
inherited |
The set of usable angle measurement units.
Isis::Longitude::Longitude | ( | ) |
Create a blank Longitude object with 0-360 domain.
References Domain360.
Referenced by force180Domain(), force360Domain(), and to360Range().
Isis::Longitude::Longitude | ( | double | longitude, |
Angle::Units | longitudeUnits, | ||
Direction | lonDir = PositiveEast , |
||
Domain | lonDomain = Domain360 |
||
) |
Create and initialize a Longitude value.
This value can wrap the planet any number of times regardless of the domain.
longitude | The longitude value this instance will represent |
longitudeUnits | The angular units of the longitude value (degs, rads) |
lonDir | True if moving east means an increase in longitude |
lonDomain | Domain of the given longitude value |
References _FILEINFO_, PositiveEast, PositiveWest, Isis::IException::Programmer, setPositiveEast(), and setPositiveWest().
Isis::Longitude::Longitude | ( | Angle | longitude, |
Direction | lonDir = PositiveEast , |
||
Domain | lonDomain = Domain360 |
||
) |
Create and initialize a Longitude value.
This value can wrap the planet any number of times regardless of the domain.
longitude | The longitude value this instance will represent |
lonDir | True if moving east means an increase in longitude |
lonDomain | Domain of the given longitude value |
References _FILEINFO_, PositiveEast, PositiveWest, Isis::IException::Programmer, Isis::Angle::Radians, Isis::Angle::radians(), setPositiveEast(), and setPositiveWest().
Isis::Longitude::Longitude | ( | double | longitude, |
PvlGroup | mapping, | ||
Angle::Units | longitudeUnits | ||
) |
Create and initialize a Longitude value.
This value can wrap the planet any number of times regardless of the domain. The longitude domain and direction are read from the mapping group.
longitude | The longitude value this instance will represent |
mapping | The mapping group containing the longitude direction and domain |
longitudeUnits | The angular units of the longitude value (degs, rads) |
References _FILEINFO_, Domain180, Domain360, Isis::IException::Programmer, setPositiveEast(), and setPositiveWest().
Isis::Longitude::Longitude | ( | const Longitude & | longitudeToCopy | ) |
This copies the given longitude exactly.
longitudeToCopy | The latitude we're duplicating |
Isis::Longitude::~Longitude | ( | ) |
This cleans up the Longitude class.
|
virtualinherited |
Return angle value in desired units.
unit | Desired units of the angle (see Angle::Units) |
References _FILEINFO_, Isis::Angle::Degrees, Isis::Null, Isis::IException::Programmer, Isis::RAD2DEG, and Isis::Angle::Radians.
Referenced by Isis::Angle::Angle(), Isis::Angle::degrees(), force360Domain(), Isis::Angle::operator<(), Isis::Angle::operator==(), Isis::Angle::operator>(), Isis::Latitude::planetocentric(), positiveEast(), positiveWest(), Isis::Angle::radians(), Isis::Latitude::setAngle(), and Isis::Angle::setAngle().
|
inlineinherited |
Get the angle in units of Degrees.
References Isis::Angle::angle(), and Isis::Angle::Degrees.
Referenced by Isis::Angle::Angle(), Isis::MosaicGridTool::autoGrid(), Isis::PhotometricFunction::compute(), Isis::MosaicGridTool::drawGrid(), Isis::AdjustedLatitudeFilter::evaluate(), Isis::APrioriLatitudeFilter::evaluate(), Isis::APrioriLongitudeFilter::evaluate(), Isis::AdjustedLongitudeFilter::evaluate(), force180Domain(), force360Domain(), Isis::BundleControlPoint::formatBundleLatitudinalOutputDetailString(), Isis::BundleTargetBody::formatBundleOutputString(), Isis::AbstractPointItem::getData(), Isis::GridGraphicsItem::GridGraphicsItem(), Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), Isis::DemShape::localRadius(), operator<<(), Isis::ControlNetFilter::PointLatLonFilter(), Isis::MosaicGridToolConfigDialog::readSettings(), Isis::Latitude::setAngle(), Isis::Angle::setDegrees(), Isis::VimsGroundMap::SetGround(), Isis::UniversalGroundMap::SetGround(), Isis::CameraGroundMap::SetGround(), Isis::Camera::SetGround(), Isis::BundleTargetBody::setSolveSettings(), Isis::UniversalGroundMap::SetUnboundGround(), TEST(), Isis::RingPlaneProjection::To180Domain(), Isis::TProjection::To180Domain(), Isis::RingPlaneProjection::To360Domain(), Isis::TProjection::To360Domain(), Isis::MosaicGridTool::toPvl(), Isis::ControlNetVersioner::toPvl(), Isis::Angle::toString(), Isis::Sensor::UniversalLatitude(), and Isis::Sensor::UniversalLongitude().
Longitude Isis::Longitude::force180Domain | ( | ) | const |
This returns a longitude that is constricted to -180 to 180 degrees.
References Isis::Angle::Angle(), Isis::Angle::Degrees, Isis::Angle::degrees(), force360Domain(), Isis::Angle::isValid(), and Longitude().
Referenced by TEST(), Isis::RingPlaneProjection::To180Domain(), and Isis::TProjection::To180Domain().
Longitude Isis::Longitude::force360Domain | ( | ) | const |
This returns a longitude that is constricted to 0-360 degrees.
References Isis::Angle::angle(), Isis::Angle::Degrees, Isis::Angle::degrees(), Isis::Angle::isValid(), and Longitude().
Referenced by force180Domain(), inRange(), TEST(), Isis::RingPlaneProjection::To360Domain(), and Isis::TProjection::To360Domain().
|
staticinherited |
Makes an angle to represent a full rotation (0-360 or 0-2pi).
References Isis::Angle::Angle(), and Isis::Angle::Degrees.
Referenced by Isis::Hillshade::shadedValue(), and to360Range().
Checks if this longitude value is within the given range.
Defines the range as the change from the minimum longitude to the maximum longitude (an angle), and returns whether the change from the minimum longitude to this longitude is less than or equal to the maximum change allowed (the range).
All longitude values are restricted to a 0-360 range for the sake of comparison. If the provided min and max longitude values are nominally different, but resolve to the same value when clamped to the 0-360 range, (for example: min=0 and max=360 => adjustedMin=0 and adjustedMax=0), then every point will be considered valid (because the whole planet is the range).
min | The beginning of the valid longitude range |
max | The end of the valid longitude range |
References force360Domain(), Isis::PI, Isis::Angle::radians(), and to360Range().
Referenced by Isis::QnetPointRangeFilter::filter(), and TEST().
|
inherited |
This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state.
References Isis::Null.
Referenced by Isis::GroundGrid::CreateGrid(), force180Domain(), force360Domain(), Isis::UniversalGroundMap::GroundRange(), Isis::DemShape::localRadius(), Isis::SunShadowTool::mouseMove(), Isis::Angle::operator*(), Isis::Angle::operator+(), Isis::Angle::operator-(), Isis::Angle::operator/(), Isis::Angle::operator<(), Isis::Angle::operator>(), Isis::Latitude::planetographic(), Isis::NaifDskPlateModel::point(), Isis::Shape::save(), Isis::Image::save(), Isis::ControlPoint::SetAprioriSurfacePoint(), Isis::Hillshade::setAzimuth(), Isis::GroundGrid::SetGroundLimits(), Isis::SurfacePoint::SetSpherical(), Isis::SurfacePoint::SetSphericalSigmas(), Isis::Hillshade::setZenith(), to360Range(), and Isis::Angle::toString().
|
inlineinherited |
Test if another angle is not equal to this angle.
Takes the negated result of the '==' operator.
angle2 | The comparison angle (on right-hand-side of != operator) |
|
inherited |
Multiply this angle by a double and return the resulting angle.
If this is an invalid angle, then the result will be an invalid angle.
value | The value to multiply to this angle |
References Isis::Angle::Angle(), Isis::Angle::isValid(), Isis::Angle::Radians, and Isis::Angle::radians().
|
inlineinherited |
Multiply this angle by an integer and return the resulting angle.
value | The integer value to multiply with this angle |
|
inlineinherited |
Multiply this angle by a double and set this instance to the resulting angle.
value | The double value to multiply with this angle |
Add angle value to another.
If either of these are invalid angles, then the result will be an invalid angle.
angle2 | The angle to add to this angle |
References Isis::Angle::Angle(), Isis::Angle::isValid(), Isis::Angle::Radians, and Isis::Angle::radians().
|
inlineinherited |
Add angle value to another as double and replace original.
angle2 | The angle to add to this angle |
Subtract angle value from another and return the resulting angle.
If either of these are invalid angles, then the result will be an invalid angle.
angle2 | The angle to subtract from this angle |
References Isis::Angle::Angle(), Isis::Angle::isValid(), Isis::Angle::Radians, and Isis::Angle::radians().
|
inlineinherited |
Subtract angle value from another and set this instance to the resulting angle.
angle2 | The angle to subtract from this angle |
|
inherited |
Divide this angle by a double.
value | The double value to use as the divisor |
References Isis::Angle::Angle(), Isis::Angle::isValid(), Isis::Angle::Radians, and Isis::Angle::radians().
|
inherited |
Divide this angle by another angle and return the ratio.
value | The ratio, Null if invalid |
References Isis::Angle::isValid(), Isis::Null, and Isis::Angle::radians().
|
inlineinherited |
Divide this angle by an integer and return the resulting angle.
value | The double value to use as the divisor |
|
inlineinherited |
Divide this angle by a double and return the resulting angle.
value | The double value to use as the divisor |
|
inherited |
Test if the other angle is less than the current angle.
If either is invalid, then an exception will be thrown.
angle2 | The comparison angle (on right-hand-side of < operator) |
References _FILEINFO_, Isis::Angle::angle(), Isis::Angle::isValid(), Isis::IException::Programmer, and Isis::Angle::Radians.
|
inlineinherited |
Test if the other angle is less than or equal to the current angle.
angle2 | The comparison angle (on right-hand-side of < operator) |
Same as positiveEast.
Assign the values in the given longitude to ourselves.
operator double() const { return positiveEast(); }
This will make an exact duplicate.
longitudeToCopy | The longitude we're duplicating with the current instance |
References positiveEast(), and setPositiveEast().
|
inlineinherited |
Test if another angle is equal to this angle.
This does not compensate for going around a circle: Angle(360, Angle::Degrees) does not equal Angle(0, Angle::Degrees)
Invalid angles are equal to each other.
angle2 | The comparison angle (on right-hand-side of == operator) |
References Isis::Angle::angle(), and Isis::Angle::Radians.
|
inherited |
Test if the other angle is greater than the current angle.
If either is invalid, then an exception will be thrown.
angle2 | The comparison angle (on right-hand-side of > operator) |
References _FILEINFO_, Isis::Angle::angle(), Isis::Angle::isValid(), Isis::IException::Programmer, and Isis::Angle::Radians.
|
inlineinherited |
Test if the other angle is greater than or equal to the current angle.
angle2 | The comparison angle (on right-hand-side of < operator) |
double Isis::Longitude::positiveEast | ( | Angle::Units | units = Angle::Radians | ) | const |
Get the longitude in the PositiveEast coordinate system.
units | The angular units to get the longitude in |
References Isis::Angle::angle().
Referenced by operator=(), Isis::NaifDskPlateModel::point(), and TEST().
double Isis::Longitude::positiveWest | ( | Angle::Units | units = Angle::Radians | ) | const |
Get the longitude in the PositiveWest coordinate system.
units | The angular units to get the longitude in |
References Isis::Angle::angle(), Domain360, Isis::IsSpecial(), and Isis::Angle::unitWrapValue().
Referenced by TEST().
|
inlineinherited |
Convert an angle to a double.
This will return the radians version of the angle.
operator double() const { return angle(Radians); } Get the angle in units of Radians.
References Isis::Angle::angle(), and Isis::Angle::Radians.
Referenced by Isis::Latitude::add(), Isis::CameraGroundMap::EllipsoidPartial(), Isis::SurfacePoint::GetDistanceToPoint(), Isis::Camera::GetLocalNormal(), Isis::GridGraphicsItem::GridGraphicsItem(), inRange(), Isis::Latitude::Latitude(), Isis::EllipsoidShape::localRadius(), Isis::BundleTargetBody::localRadius(), Longitude(), Isis::SunShadowTool::mouseMove(), Isis::Angle::operator*(), Isis::Angle::operator+(), Isis::Angle::operator-(), Isis::Angle::operator/(), operator<<(), Isis::Angle::operator=(), Isis::Latitude::planetographic(), Isis::CameraGroundMap::PointPartial(), Isis::SurfacePoint::ResetLocalRadius(), Isis::LinearAlgebra::rotate(), Isis::Shape::save(), Isis::Image::save(), Isis::SpiceRotation::setEphemerisTimePckPolyFunction(), Isis::VimsGroundMap::SetGround(), Isis::Latitude::setPlanetographic(), Isis::Angle::setRadians(), Isis::BundleTargetBody::setSolveSettings(), Isis::SurfacePoint::SetSphericalMatrix(), Isis::SurfacePoint::SetSphericalSigmas(), and Isis::Hillshade::shadedValue().
|
virtualinherited |
Set angle value in desired units.
angle | The angle value in units of the unit parameter |
unit | Desired units of the angle (see Angle::Units) |
Reimplemented in Isis::Latitude.
References _FILEINFO_, Isis::Angle::angle(), Isis::DEG2RAD, Isis::Angle::Degrees, Isis::IsSpecial(), Isis::Null, Isis::IException::Programmer, and Isis::Angle::Radians.
Referenced by Isis::Angle::Angle(), Isis::Angle::operator=(), Isis::Latitude::setAngle(), Isis::Angle::setDegrees(), setPositiveEast(), setPositiveWest(), and Isis::Angle::setRadians().
|
inlineinherited |
Set the angle in units of Degrees.
degrees | The new angle value, Null for invalid angle |
References Isis::Angle::Degrees, Isis::Angle::degrees(), and Isis::Angle::setAngle().
void Isis::Longitude::setPositiveEast | ( | double | longitude, |
Angle::Units | units = Angle::Radians |
||
) |
Set the longitude given a value in the PositiveEast longitude system.
longitude | The positive east longitude to set ourselves to |
units | The angular units longitude is in |
References Isis::Angle::setAngle().
Referenced by Longitude(), operator=(), and TEST().
void Isis::Longitude::setPositiveWest | ( | double | longitude, |
Angle::Units | units = Angle::Radians |
||
) |
Set the longitude given a value in the PositiveWest longitude system.
longitude | The positive west longitude to set ourselves to |
units | The angular units longitude is in |
References Domain360, Isis::IsSpecial(), Isis::Angle::setAngle(), and Isis::Angle::unitWrapValue().
Referenced by Longitude(), and TEST().
|
inlineinherited |
Set the angle in units of Radians.
radians | The new angle value, Null for invalid angle |
References Isis::Angle::Radians, Isis::Angle::radians(), and Isis::Angle::setAngle().
Referenced by Isis::LinearAlgebra::toAxisAngle(), and Isis::LinearAlgebra::toEulerAngles().
|
static |
Calculates where the longitude range is in 0-360.
This method will return 2 subranges if the total range intersects the 0/360 line. For instance, if the input range is -10-10, the output ranges will be 350-360 and 0-10. If the longitude range is invalid then an empty list will result.
startLon | the western edge of the longitude range |
endLon | the eastern edge of the range |
References Isis::Angle::Degrees, Isis::Angle::fullRotation(), Isis::Angle::isValid(), and Longitude().
Referenced by inRange(), and Isis::FeatureNomenclature::queryFeatures().
|
virtualinherited |
Get the angle in human-readable form.
includeUnits | Include the angle's units in the text. |
References Isis::Angle::degrees(), Isis::Angle::isValid(), and Isis::toString().
Referenced by Isis::Latitude::inRange(), Isis::Latitude::Latitude(), Isis::operator<<(), Isis::Latitude::planetographic(), and Isis::Hillshade::shadedValue().
|
inherited |
Return wrap value in desired units.
The 'wrap' value is the value where one circle occurs - angles greater than this are conceptually 'wrapping' back to zero. For example, this is 2*PI in radians because 2*PI == 0 on a circle. Please keep in mind we still differentiate those two angles.
unit | Desired units of the Angle wrap constant (see Angle::Units) |
References _FILEINFO_, Isis::Angle::Degrees, Isis::PI, Isis::IException::Programmer, and Isis::Angle::Radians.
Referenced by positiveWest(), and setPositiveWest().