casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
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 320 of file RSUtils.qo.h.


Constructor & Destructor Documentation

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

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

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

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

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

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

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


Member Function Documentation

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.

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 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.


Member Data Documentation

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

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

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

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

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

Conversion methods/constants //.

Units constants.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


The documentation for this class was generated from the following file: