casa::RSValue Class Reference

Convenience class for the different units available for coordinates/sizes. More...

#include <RSUtils.qo.h>

List of all members.

Public Member Functions

 RSValue (double d=0)
 RSValue (double d, Unit u)
 RSValue (bool hms, long hd, long m, double s, bool minus=false)
 ~RSValue ()

Static Public Member Functions

static bool convertBetween (const QString &from, const String &fromUnits, RSValue &to)
 Converts the value in the given QString in the given units to the given RSValue.
static bool convertBetween (const RSValue &from, QString &to, int precision=-1)
 Converts the value in the given RSValue to the given QString, using the given precision for the doubles.
static bool convertBetween (const RSValue &from, RSValue &to, const String &toUnits)
 Converts the value in the given RSValue to the give RSValue which uses the given units.

Public Attributes

bool isQuantum
bool isHMS
bool isMinusZero
Quantum< double > val
long hOrD
long min
double sec

Static Public Attributes

static const String DEG
 Conversion methods/constants //.
static const String RAD
static const String ARCSEC
static const String ARCMIN
static const String HMS
static const String DMS

Detailed Description

Convenience class for the different units available for coordinates/sizes.

Two modes: quantum and HMS/DMS (distinguished by the "isQuantum" flag).

  1. Quantum: consists of a value and a unit, stored in "val".
  2. HMS/DMS: consists of three values and two flags. Hours/degrees are stored in "hOrD", minutes are stored in "min", and seconds are stored in "sec". The "isHMS" flag distinguishes between HMS and DMS. The "isMinusZero" flag is used when "hOrD" is zero, but the whole value is negative.

Definition at line 324 of file RSUtils.qo.h.


Constructor & Destructor Documentation

casa::RSValue::RSValue ( double  d = 0  )  [inline]

Definition at line 326 of file RSUtils.qo.h.

casa::RSValue::RSValue ( double  d,
Unit  u 
) [inline]

Definition at line 329 of file RSUtils.qo.h.

casa::RSValue::RSValue ( bool  hms,
long  hd,
long  m,
double  s,
bool  minus = false 
) [inline]

Definition at line 332 of file RSUtils.qo.h.

casa::RSValue::~RSValue (  )  [inline]

Definition at line 336 of file RSUtils.qo.h.


Member Function Documentation

static bool casa::RSValue::convertBetween ( const RSValue from,
RSValue to,
const String &  toUnits 
) [static]

Converts the value in the given RSValue to the give RSValue which uses the given units.

toUnits should either be: 1) HMS or DMS constants, 2) a relevant Unit.

static bool casa::RSValue::convertBetween ( const RSValue from,
QString &  to,
int  precision = -1 
) [static]

Converts the value in the given RSValue to the given QString, using the given precision for the doubles.

static bool casa::RSValue::convertBetween ( const QString &  from,
const String &  fromUnits,
RSValue to 
) [static]

Converts the value in the given QString in the given units to the given RSValue.

The output RSValue is in degrees. fromUnits should either be: 1) HMS or DMS constants, 2) a relevant Unit.


Member Data Documentation

const String casa::RSValue::ARCMIN [static]

Definition at line 355 of file RSUtils.qo.h.

Referenced by casa::QtEditRegionShape::sizeUnits().

const String casa::RSValue::ARCSEC [static]

Definition at line 354 of file RSUtils.qo.h.

Referenced by casa::QtEditRegionShape::sizeUnits().

const String casa::RSValue::DEG [static]

Conversion methods/constants //.

Units constants.

Definition at line 352 of file RSUtils.qo.h.

Referenced by casa::QtEditRegionShape::positionUnits(), and casa::QtEditRegionShape::sizeUnits().

const String casa::RSValue::DMS [static]

Definition at line 357 of file RSUtils.qo.h.

Referenced by casa::QtEditRegionShape::positionUnits().

const String casa::RSValue::HMS [static]

Definition at line 356 of file RSUtils.qo.h.

Referenced by casa::QtEditRegionShape::positionUnits().

Definition at line 343 of file RSUtils.qo.h.

Definition at line 339 of file RSUtils.qo.h.

Definition at line 340 of file RSUtils.qo.h.

Definition at line 338 of file RSUtils.qo.h.

Definition at line 344 of file RSUtils.qo.h.

const String casa::RSValue::RAD [static]

Definition at line 345 of file RSUtils.qo.h.

Quantum<double> casa::RSValue::val

Definition at line 342 of file RSUtils.qo.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1