casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
casa::RSValue Class Reference

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

#include <RSUtils.qo.h>

Public Member Functions

 RSValue (double d=0)
 
 RSValue (double d, casacore::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 casacore::String &fromUnits, RSValue &to)
 Converts the value in the given QString in the given units to the given RSValue. More...
 
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. More...
 
static bool convertBetween (const RSValue &from, RSValue &to, const casacore::String &toUnits)
 Converts the value in the given RSValue to the give RSValue which uses the given units. More...
 

Public Attributes

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

Static Public Attributes

static const casacore::String DEG
 casacore::Conversion methods/constants // More...
 
static const casacore::String RAD
 
static const casacore::String ARCSEC
 
static const casacore::String ARCMIN
 
static const casacore::String HMS
 
static const casacore::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. casacore::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 328 of file RSUtils.qo.h.

Constructor & Destructor Documentation

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

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

casa::RSValue::RSValue ( double  d,
casacore::Unit  u 
)
inline

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

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

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

casa::RSValue::~RSValue ( )
inline

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

Member Function Documentation

static bool casa::RSValue::convertBetween ( const QString &  from,
const casacore::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 casacore::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 casacore::String casa::RSValue::ARCMIN
static

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

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

const casacore::String casa::RSValue::ARCSEC
static

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

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

const casacore::String casa::RSValue::DEG
static

casacore::Conversion methods/constants //

Units constants.

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

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

const casacore::String casa::RSValue::DMS
static

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

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

const casacore::String casa::RSValue::HMS
static

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

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

long casa::RSValue::hOrD

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

bool casa::RSValue::isHMS

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

bool casa::RSValue::isMinusZero

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

bool casa::RSValue::isQuantum

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

long casa::RSValue::min

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

const casacore::String casa::RSValue::RAD
static
double casa::RSValue::sec

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

casacore::Quantum<double> casa::RSValue::val

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


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