60 if(displacementUnit ==
Pixels)
76 double pixelsPerMeter) {
144 double pixelsPerMeter) {
169 IString msg =
"Displacement has not been initialized, you must initialize " 170 "it first before comparing with another displacement using [>]";
188 IString msg =
"Displacement has not been initialized, you must initialize " 189 "it first before comparing with another displacement using [<]";
205 if(!isValid() || !displacementToAdd.isValid())
return Displacement();
207 return Displacement(meters() + displacementToAdd.meters(), Meters);
220 if(!isValid() || !displacementToSub.isValid())
return Displacement();
222 Displacement result(meters() - displacementToSub.meters(), Meters);
236 if(!isValid() || !distanceToSub.isValid())
return Displacement();
238 Displacement result(meters() - distanceToSub.meters(), Meters);
373 double resultingDisplacement =
Null;
377 switch(displacementUnit) {
379 resultingDisplacement = displacementInMeters;
383 resultingDisplacement = displacementInMeters / 1000.0;
387 IString msg =
"Cannot call displacement with pixels, ask for another " 393 if(resultingDisplacement ==
Null) {
394 IString msg =
"Displacement does not understand the enumerated value [" +
395 IString(displacementUnit) +
"] as a unit";
399 return resultingDisplacement;
414 double displacementInMeters =
Null;
421 switch(displacementUnit) {
431 IString msg =
"Cannot setDisplacement with pixels, must convert to " 432 "another unit first";
437 if(displacementInMeters ==
Null) {
438 IString msg =
"Displacement does not understand the enumerated value [" +
439 IString(displacementUnit) +
"] as a unit";
double meters() const
Get the distance in meters.
const double Null
Value for an Isis Null pixel.
The distance is being specified in kilometers.
void setKilometers(double displacementInKilometers)
Set the displacement in kilometers.
double meters() const
Get the displacement in meters.
bool isValid() const
Test if this displacement has been initialized or not.
void operator*=(const double &valueToMult)
Multiply this displacement by a value and assign the result to ourself.
Angle operator*(double mult, Angle angle)
Multiply this angle by a double and return the resulting angle.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
This error is for when a programmer made an API call that was illegal.
The distance is being specified in meters.
Distance measurement, usually in meters.
bool operator<(const Displacement &otherDisplacement) const
Compare two displacements with the less than operator.
void setPixels(double distanceInPixels, double pixelsPerMeter=1.0)
Set the displacement in pixels.
double displacement(Units displacementUnit) const
This is a helper method to access displacements in a universal manner with uniform error checking...
The distance is being specified in pixels.
Units
This is a list of available units to access and store Distances in.
#define _FILEINFO_
Macro for the filename and line number.
bool operator>(const Displacement &otherDisplacement) const
Get the displacement in meters.
bool IsSpecial(const double d)
Returns if the input pixel is special.
bool isValid() const
Test if this distance has been initialized or not.
void operator/=(const double &valueToDiv)
Divide this displacement by a value and assign the result to ourself.
void operator-=(const Displacement &displacementToSub)
Subtract the given displacement from ourself and assign.
Displacement is a signed length, usually in meters.
Displacement operator*(const double &valueToMult) const
Multiply this displacement by a value (5m * 2 = 10m).
double pixels(double pixelsPerMeter=1.0) const
Get the displacement in pixels using the given conversion ratio.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
double m_displacementInMeters
This is the displacement value that this class is encapsulating, always stored in meters...
void setMeters(double displacementInMeters)
Set the displacement in meters.
double kilometers() const
Get the displacement in kilometers.
void setDisplacement(const double &displacement, Units displacementUnit)
This is a helper method to set displacements in a universal manner with uniform error checking...
double operator/(const Displacement &displacementToDiv) const
Divide another displacement into this displacement (5m / 1m = 5).
void operator+=(const Displacement &displacementToAdd)
Add and assign the given displacement to ourselves.
Displacement()
This initializes the displacement to an invalid state.