casa
5.7.0-16
|
Class to represent a single coordinate (value + unit). More...
#include <DS9FileReader.h>
Public Member Functions | |
DS9Coordinate (DS9::CoordinateSystem s, DS9::CoordinateUnit u=DS9::UNSET) | |
Constructor which takes a system and a unit. More... | |
~DS9Coordinate () | |
Destructor. More... | |
void | set (DS9::CoordinateSystem system) |
Sets the coordinate system to the given. More... | |
void | set (DS9::CoordinateUnit unit) |
Sets the coordinate unit to the given. More... | |
void | set (double value) |
Sets the single value to the given. More... | |
void | set (double val1, double val2, double val3, bool minusZero=false) |
Sets the HMS/DMS value to the given. More... | |
DS9::CoordinateSystem | system () const |
Returns the coordinate system. More... | |
DS9::CoordinateUnit | unit () const |
Returns the unit. More... | |
double | value () const |
Returns the first value. More... | |
std::vector< double > | values () const |
Returns the value(s). More... | |
unsigned int | size () const |
Returns 1 for normal coordinates or 3 for HMS/DMS. More... | |
bool | isValid () const |
Returns true if this coordinate is valid, false otherwise. More... | |
casacore::String | toPrintString () const |
Returns a casacore::String version for use with DS9Region::toPrintString. More... | |
double | toDegrees () const |
Returns the value in degrees. More... | |
Private Attributes | |
DS9::CoordinateSystem | m_system |
DS9::CoordinateUnit | m_unit |
vector< double > | m_values |
bool | m_minusZero |
Class to represent a single coordinate (value + unit).
Definition at line 304 of file DS9FileReader.h.
casa::DS9Coordinate::DS9Coordinate | ( | DS9::CoordinateSystem | s, |
DS9::CoordinateUnit | u = DS9::UNSET |
||
) |
Constructor which takes a system and a unit.
casa::DS9Coordinate::~DS9Coordinate | ( | ) |
Destructor.
bool casa::DS9Coordinate::isValid | ( | ) | const |
Returns true if this coordinate is valid, false otherwise.
If the coordinate is invalid (such as an unset unit), the method will attempt to fix it.
void casa::DS9Coordinate::set | ( | DS9::CoordinateSystem | system | ) |
Sets the coordinate system to the given.
void casa::DS9Coordinate::set | ( | DS9::CoordinateUnit | unit | ) |
Sets the coordinate unit to the given.
void casa::DS9Coordinate::set | ( | double | value | ) |
Sets the single value to the given.
void casa::DS9Coordinate::set | ( | double | val1, |
double | val2, | ||
double | val3, | ||
bool | minusZero = false |
||
) |
Sets the HMS/DMS value to the given.
minusZero is used when the first value is zero, but the whole value is negative.
unsigned int casa::DS9Coordinate::size | ( | ) | const |
Returns 1 for normal coordinates or 3 for HMS/DMS.
DS9::CoordinateSystem casa::DS9Coordinate::system | ( | ) | const |
Returns the coordinate system.
double casa::DS9Coordinate::toDegrees | ( | ) | const |
Returns the value in degrees.
casacore::String casa::DS9Coordinate::toPrintString | ( | ) | const |
Returns a casacore::String version for use with DS9Region::toPrintString.
DS9::CoordinateUnit casa::DS9Coordinate::unit | ( | ) | const |
Returns the unit.
double casa::DS9Coordinate::value | ( | ) | const |
Returns the first value.
No conversion is used.
std::vector<double> casa::DS9Coordinate::values | ( | ) | const |
Returns the value(s).
Size will be 1 for normal coordinates, 3 for HMS/DMS. No conversion is used.
|
private |
Definition at line 357 of file DS9FileReader.h.
|
private |
Definition at line 354 of file DS9FileReader.h.
|
private |
Definition at line 355 of file DS9FileReader.h.
|
private |
Definition at line 356 of file DS9FileReader.h.