77 Distance(
double distanceInPixels,
double pixelsPerMeter);
87 double pixels(
double pixelsPerMeter = 1.0)
const;
88 void setPixels(
double distanceInPixels,
double pixelsPerMeter = 1.0);
108 return *
this > otherDistance || *
this == otherDistance;
121 return *
this < otherDistance || *
this == otherDistance;
bool operator>=(const Distance &otherDistance) const
Compare two distances with the greater than or equal to operator.
double meters() const
Get the distance in meters.
void operator/=(const double &valueToDiv)
Divide this distance by a value and assign the result to ourself.
Distance operator+(const Distance &distanceToAdd) const
Add another distance to this distance (1km + 1m = 1005m)
bool operator<(const Distance &otherDistance) const
Compare two distances with the less than operator.
Units
This is a list of available units to access and store Distances in.
double solarRadii() const
Get the distance in solar radii (a unit of ~696,265km).
void operator+=(const Distance &distanceToAdd)
Add and assign the given distance to ourselves.
QString toString() const
Get a textual representation of this distance.
Displacement operator-(const Distance &distanceToSub) const
Subtract another distance from this distance (1km - 1m = 995m).
virtual double distance(Units distanceUnit) const
This is a helper method to access distances in a universal manner with uniform error checking...
void operator*=(const double &valueToMult)
Multiply this distance by a value and assign the result to ourself.
"Solar radius is a unit of distance used to express the size of stars in astronomy equal to the curre...
double m_distanceInMeters
This is the distance value that this class is encapsulating, always stored in meters.
The distance is being specified in kilometers.
double pixels(double pixelsPerMeter=1.0) const
Get the distance in pixels using the given conversion ratio.
Distance()
This initializes the distance to an invalid state.
double kilometers() const
Get the distance in kilometers.
Distance measurement, usually in meters.
double operator/(const Distance &distanceToDiv) const
Divide another distance into this distance (5m / 1m = 5).
void setMeters(double distanceInMeters)
Set the distance in meters.
bool operator!=(const Distance &otherDistance) const
Compare two distances with the != operator.
void setPixels(double distanceInPixels, double pixelsPerMeter=1.0)
Set the distance in pixels.
Distance operator*(const double &valueToMult) const
Multiply this distance by a value (5m * 2 = 10m).
bool operator>(const Distance &otherDistance) const
Compare two distances with the greater than operator.
virtual ~Distance()
This will free the memory allocated by this instance of the Distance class.
void setKilometers(double distanceInKilometers)
Set the distance in kilometers.
bool operator==(const Distance &otherDistance) const
Compare two distances with the == operator.
bool operator<=(const Distance &otherDistance) const
Compare two distances with the less than or equal to operator.
bool isValid() const
Test if this distance has been initialized or not.
void operator-=(const Distance &distanceToSub)
Subtract and assign the given distance from ourself.
Displacement is a signed length, usually in meters.
Namespace for ISIS/Bullet specific routines.
void setSolarRadii(double distanceInSolarRadii)
Set the distance in solar radii.
The distance is being specified in meters.
virtual void setDistance(const double &distance, Units distanceUnit)
This is a helper method to set distances in a universal manner with uniform error checking...
The distance is being specified in pixels.
Distance & operator=(const Distance &distanceToCopy)
Assign this distance to the value of another distance.