|
Isis 3.0 Developer's Reference (API) |
Home |
Defines an angle and provides unit conversions. More...
#include <Angle.h>
Inherited by Isis::Latitude, and Isis::Longitude.
Public Types | |
| enum | Units { Degrees, Radians } |
The set of usable angle measurement units. More... | |
Public Member Functions | |
| Angle () | |
| Constructs a blank angle object which needs a value to be set in order to do any calculations. | |
| Angle (double angle, Units unit) | |
| Constructs an angle object with the entered value and unit. | |
| Angle (const Angle &angle) | |
| Constructs an angle object from another Angle object. | |
| virtual | ~Angle () |
| Destroys the angle object. | |
| bool | isValid () const |
| This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state. | |
| Angle & | operator= (const Angle &angle2) |
| Assign angle object equal to another. | |
| Angle | operator+ (const Angle &angle2) const |
| Add angle value to another. | |
| Angle | operator- (const Angle &angle2) const |
| Subtract angle value from another and return the resulting angle. | |
| Angle | operator* (double value) const |
| Multiply this angle by a double and return the resulting angle. | |
| Angle | operator/ (double value) const |
| Divide this angle by a double. | |
| double | operator/ (Angle value) const |
| Divide this angle by another angle and return the ratio. | |
| bool | operator< (const Angle &angle2) const |
| Test if the other angle is less than the current angle. | |
| bool | operator> (const Angle &angle2) const |
| Test if the other angle is greater than the current angle. | |
| void | operator+= (const Angle &angle2) |
| Add angle value to another as double and replace original. | |
| void | operator-= (const Angle &angle2) |
| Subtract angle value from another and set this instance to the resulting angle. | |
| Angle | operator* (int value) const |
| Multiply this angle by an integer and return the resulting angle. | |
| void | operator*= (double value) |
| Multiply this angle by a double and set this instance to the resulting angle. | |
| Angle | operator/ (int value) const |
| Divide this angle by an integer and return the resulting angle. | |
| void | operator/= (double value) |
| Divide this angle by a double and return the resulting angle. | |
| bool | operator== (const Angle &angle2) const |
| Test if another angle is equal to this angle. | |
| bool | operator!= (const Angle &angle2) const |
| Test if another angle is not equal to this angle. | |
| bool | operator<= (const Angle &angle2) const |
| Test if the other angle is less than or equal to the current angle. | |
| bool | operator>= (const Angle &angle2) const |
| Test if the other angle is greater than or equal to the current angle. | |
| double | radians () const |
| Convert an angle to a double. | |
| double | degrees () const |
| Get the angle in units of Degrees. | |
| void | setRadians (double radians) |
| Set the angle in units of Radians. | |
| void | setDegrees (double degrees) |
| Set the angle in units of Degrees. | |
| virtual QString | toString (bool includeUnits=true) const |
| Get the angle in human-readable form. | |
Static Public Member Functions | |
| static Angle | fullRotation () |
| Makes an angle to represent a full rotation (0-360 or 0-2pi). | |
Protected Member Functions | |
| double | unitWrapValue (const Units &unit) const |
| Return wrap value in desired units. | |
| virtual double | angle (const Units &unit) const |
| Return angle value in desired units. | |
| virtual void | setAngle (const double &angle, const Units &unit) |
| Set angle value in desired units. | |
Friends | |
| Angle | operator* (double mult, Angle angle) |
Defines an angle and provides unit conversions.
| enum Isis::Angle::Units |
The set of usable angle measurement units.
| Isis::Angle::Angle | ( | ) |
Constructs a blank angle object which needs a value to be set in order to do any calculations.
References Isis::Null.
Referenced by Isis::Longitude::force180Domain(), fullRotation(), operator*(), operator+(), operator-(), operator/(), Isis::Latitude::planetographic(), Isis::Latitude::setAngle(), and Isis::Latitude::setPlanetographic().
| Isis::Angle::Angle | ( | double | angle, | |
| Units | unit | |||
| ) |
Constructs an angle object with the entered value and unit.
| angle | The initial angle value in units of the unit parameter | |
| unit | The unit of the initial angle (see Angle::Units) |
References setAngle().
| Isis::Angle::Angle | ( | const Angle & | fromAngle | ) |
Constructs an angle object from another Angle object.
| fromAngle | The angle object to copy on initialization |
| Isis::Angle::~Angle | ( | ) | [virtual] |
Destroys the angle object.
References Isis::Null.
| double Isis::Angle::angle | ( | const Units & | unit | ) | const [protected, virtual] |
Return angle value in desired units.
| unit | Desired units of the angle (see Angle::Units) |
References _FILEINFO_, Degrees, Isis::Null, Isis::IException::Programmer, Isis::RAD2DEG(), and Radians.
Referenced by degrees(), Isis::Longitude::force360Domain(), operator<(), operator==(), operator>(), Isis::Latitude::planetocentric(), Isis::Longitude::positiveEast(), Isis::Longitude::positiveWest(), and radians().
| double Isis::Angle::degrees | ( | ) | const [inline] |
Get the angle in units of Degrees.
References angle(), and Degrees.
Referenced by Isis::MosaicGridTool::autoGrid(), Isis::MosaicGridTool::drawGrid(), Isis::Longitude::force180Domain(), Isis::Longitude::force360Domain(), Isis::GridGraphicsItem::GridGraphicsItem(), Isis::Latitude::inRange(), Isis::DemShape::localRadius(), operator<<(), Isis::Latitude::planetographic(), Isis::ControlNetFilter::PointLatLonFilter(), Isis::MosaicGridToolConfigDialog::readSettings(), Isis::Latitude::setAngle(), Isis::VimsGroundMap::SetGround(), Isis::UniversalGroundMap::SetGround(), Isis::MosaicGridTool::toPvl(), Isis::ControlNetFileV0002::ToPvl(), toString(), Isis::Sensor::UniversalLatitude(), and Isis::Sensor::UniversalLongitude().
| Angle Isis::Angle::fullRotation | ( | ) | [static] |
Makes an angle to represent a full rotation (0-360 or 0-2pi).
References Angle(), and Degrees.
Referenced by Isis::Hillshade::shadedValue(), and Isis::Longitude::to360Range().
| bool Isis::Angle::isValid | ( | ) | const |
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(), Isis::Longitude::force180Domain(), Isis::Longitude::force360Domain(), Isis::SurfacePoint::GetLatSigmaDistance(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::GroundGrid::GroundGrid(), Isis::UniversalGroundMap::GroundRange(), Isis::VimsGroundMap::Init(), Isis::DemShape::localRadius(), Isis::SunShadowTool::mouseMove(), operator*(), operator+(), operator-(), operator/(), operator<(), operator>(), Isis::Latitude::planetographic(), Isis::ControlPoint::SetAprioriSurfacePoint(), Isis::Hillshade::setAzimuth(), Isis::VimsGroundMap::SetGround(), Isis::GroundGrid::SetGroundLimits(), Isis::SurfacePoint::SetSpherical(), Isis::SurfacePoint::SetSphericalSigmas(), Isis::Hillshade::setZenith(), Isis::Longitude::to360Range(), and toString().
| bool Isis::Angle::operator!= | ( | const Angle & | angle2 | ) | const [inline] |
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) |
| Angle Isis::Angle::operator* | ( | int | value | ) | const [inline] |
Multiply this angle by an integer and return the resulting angle.
| value | The integer value to multiply with this angle |
| Angle Isis::Angle::operator* | ( | double | value | ) | const |
| void Isis::Angle::operator*= | ( | double | value | ) | [inline] |
Multiply this angle by a double and set this instance to the resulting angle.
| value | The double value to multiply with this angle |
| void Isis::Angle::operator+= | ( | const Angle & | angle2 | ) | [inline] |
Add angle value to another as double and replace original.
| angle2 | The angle to add to this angle |
| void Isis::Angle::operator-= | ( | const Angle & | angle2 | ) | [inline] |
Subtract angle value from another and set this instance to the resulting angle.
| angle2 | The angle to subtract from this angle |
| Angle Isis::Angle::operator/ | ( | int | value | ) | const [inline] |
Divide this angle by an integer and return the resulting angle.
| value | The double value to use as the divisor |
| double Isis::Angle::operator/ | ( | Angle | value | ) | const |
Divide this angle by another angle and return the ratio.
| value | The ratio, Null if invalid |
References isValid(), Isis::Null, and radians().
| Angle Isis::Angle::operator/ | ( | double | value | ) | const |
| void Isis::Angle::operator/= | ( | double | value | ) | [inline] |
Divide this angle by a double and return the resulting angle.
| value | The double value to use as the divisor |
| bool Isis::Angle::operator< | ( | const Angle & | angle2 | ) | const |
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_, angle(), isValid(), Isis::IException::Programmer, and Radians.
| bool Isis::Angle::operator<= | ( | const Angle & | angle2 | ) | const [inline] |
Test if the other angle is less than or equal to the current angle.
| angle2 | The comparison angle (on right-hand-side of < operator) |
Assign angle object equal to another.
| angle2 | The angle value to copy |
Reimplemented in Isis::Latitude, and Isis::Longitude.
References Radians, radians(), and setAngle().
| bool Isis::Angle::operator== | ( | const Angle & | angle2 | ) | const [inline] |
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) |
| bool Isis::Angle::operator> | ( | const Angle & | angle2 | ) | const |
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_, angle(), isValid(), Isis::IException::Programmer, and Radians.
| bool Isis::Angle::operator>= | ( | const Angle & | angle2 | ) | const [inline] |
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::Angle::radians | ( | ) | const [inline] |
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 angle(), and Radians.
Referenced by Isis::Latitude::add(), Isis::SurfacePoint::GetDistanceToPoint(), Isis::SurfacePoint::GetLatSigmaDistance(), Isis::SurfacePoint::GetLatWeight(), Isis::Camera::GetLocalNormal(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::SurfacePoint::GetLonWeight(), Isis::GridGraphicsItem::GridGraphicsItem(), Isis::Longitude::inRange(), Isis::Latitude::Latitude(), Isis::EllipsoidShape::localRadius(), Isis::Longitude::Longitude(), Isis::SunShadowTool::mouseMove(), operator*(), operator+(), operator-(), operator/(), operator<<(), operator=(), Isis::Latitude::planetographic(), Isis::CameraGroundMap::PointPartial(), Isis::SurfacePoint::ResetLocalRadius(), Isis::VimsGroundMap::SetGround(), Isis::Latitude::setPlanetographic(), Isis::SurfacePoint::SetSphericalSigmas(), and Isis::Hillshade::shadedValue().
| void Isis::Angle::setAngle | ( | const double & | angle, | |
| const Units & | unit | |||
| ) | [protected, virtual] |
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) |
References _FILEINFO_, Isis::DEG2RAD(), Degrees, Isis::IsSpecial(), Isis::Null, Isis::IException::Programmer, and Radians.
Referenced by Angle(), operator=(), setDegrees(), Isis::Longitude::setPositiveEast(), Isis::Longitude::setPositiveWest(), and setRadians().
| void Isis::Angle::setDegrees | ( | double | degrees | ) | [inline] |
Set the angle in units of Degrees.
| degrees | The new angle value, Null for invalid angle |
References Degrees, and setAngle().
| void Isis::Angle::setRadians | ( | double | radians | ) | [inline] |
Set the angle in units of Radians.
| radians | The new angle value, Null for invalid angle |
References Radians, and setAngle().
| QString Isis::Angle::toString | ( | bool | includeUnits = true |
) | const [virtual] |
Get the angle in human-readable form.
| includeUnits | Include the angle's units in the text. |
References degrees(), and isValid().
Referenced by Isis::FeatureNomenclature::Feature::centerLatitudeString(), Isis::FeatureNomenclature::Feature::centerLongitudeString(), Isis::FeatureNomenclature::Feature::easternLongitudeString(), Isis::FeatureNomenclature::Feature::northernLatitudeString(), Isis::Hillshade::shadedValue(), Isis::FeatureNomenclature::Feature::southernLatitudeString(), and Isis::FeatureNomenclature::Feature::westernLongitudeString().
| double Isis::Angle::unitWrapValue | ( | const Units & | unit | ) | const [protected] |
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_, Degrees, Isis::PI(), Isis::IException::Programmer, and Radians.
Referenced by Isis::Longitude::positiveWest(), and Isis::Longitude::setPositiveWest().