61 Displacement(
double displacementInPixels,
double pixelsPerMeter);
70 void setMeters(
double displacementInMeters);
75 double pixels(
double pixelsPerMeter = 1.0)
const;
76 void setPixels(
double distanceInPixels,
double pixelsPerMeter = 1.0);
102 return *
this > otherDisplacement || *
this == otherDisplacement;
115 return *
this < otherDisplacement || *
this == otherDisplacement;
129 return !(*
this == otherDisplacement);
143 return m_displacementInMeters ==
144 otherDisplacement.m_displacementInMeters;
169 double m_displacementInMeters;
Displacement operator-(const Displacement &displacementToSub) const
Subtract another displacement from this displacement (1km - 5m = 995m).
Definition: Displacement.cpp:219
The distance is being specified in kilometers.
Definition: Displacement.h:54
void setKilometers(double displacementInKilometers)
Set the displacement in kilometers.
Definition: Displacement.cpp:118
double meters() const
Get the displacement in meters.
Definition: Displacement.cpp:86
bool isValid() const
Test if this displacement has been initialized or not.
Definition: Displacement.cpp:154
void operator*=(const double &valueToMult)
Multiply this displacement by a value and assign the result to ourself.
Definition: Displacement.cpp:355
bool operator>=(const Displacement &otherDisplacement) const
Compare the distances of 2 displacements with the >= operator.
Definition: Displacement.h:101
The distance is being specified in meters.
Definition: Displacement.h:52
Distance measurement, usually in meters.
Definition: Distance.h:47
bool operator<(const Displacement &otherDisplacement) const
Compare two displacements with the less than operator.
Definition: Displacement.cpp:186
void setPixels(double distanceInPixels, double pixelsPerMeter=1.0)
Set the displacement in pixels.
Definition: Displacement.cpp:143
double displacement(Units displacementUnit) const
This is a helper method to access displacements in a universal manner with uniform error checking...
Definition: Displacement.cpp:371
The distance is being specified in pixels.
Definition: Displacement.h:56
Units
This is a list of available units to access and store Distances in.
Definition: Displacement.h:50
bool operator==(const Displacement &otherDisplacement) const
Compare the lengths of 2 displacements with the == operator.
Definition: Displacement.h:142
bool operator>(const Displacement &otherDisplacement) const
Get the displacement in meters.
Definition: Displacement.cpp:167
bool operator<=(const Displacement &otherDisplacement) const
Compare the lengths of 2 displacements with the <= operator.
Definition: Displacement.h:114
void operator/=(const double &valueToDiv)
Divide this displacement by a value and assign the result to ourself.
Definition: Displacement.cpp:342
void operator-=(const Displacement &displacementToSub)
Subtract the given displacement from ourself and assign.
Definition: Displacement.cpp:316
Displacement is a signed length, usually in meters.
Definition: Displacement.h:43
Displacement operator*(const double &valueToMult) const
Multiply this displacement by a value (5m * 2 = 10m).
Definition: Displacement.cpp:277
double pixels(double pixelsPerMeter=1.0) const
Get the displacement in pixels using the given conversion ratio.
Definition: Displacement.cpp:130
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void setMeters(double displacementInMeters)
Set the displacement in meters.
Definition: Displacement.cpp:97
double kilometers() const
Get the displacement in kilometers.
Definition: Displacement.cpp:107
void setDisplacement(const double &displacement, Units displacementUnit)
This is a helper method to set displacements in a universal manner with uniform error checking...
Definition: Displacement.cpp:413
Displacement operator+(const Displacement &displacementToAdd) const
Add another displacement to this displacement (1km + 5m = 1005m)
Definition: Displacement.cpp:204
~Displacement()
Free the memory allocated by this instance of the displacement class.
Definition: Displacement.h:67
bool operator!=(const Displacement &otherDisplacement) const
Compare the lengths of 2 displacements with the != operator.
Definition: Displacement.h:128
double operator/(const Displacement &displacementToDiv) const
Divide another displacement into this displacement (5m / 1m = 5).
Definition: Displacement.cpp:249
void operator+=(const Displacement &displacementToAdd)
Add and assign the given displacement to ourselves.
Definition: Displacement.cpp:303
Displacement()
This initializes the displacement to an invalid state.
Definition: Displacement.cpp:33