DmsPoint Class Reference

Adds text formatting for a latitude or longitude value. More...

#include <GeoPoint.h>

List of all members.

Public Types

enum  DmsTypeEnum { DMS_DECIMAL, DMS_LATITUDE, DMS_LONGITUDE }
typedef EnumWrapper< DmsTypeEnumDmsType

Public Member Functions

 DmsPoint (DmsType eType, double dValue=0.0)
 DmsPoint (DmsType eType, const std::string &valueText)
 ~DmsPoint ()
DmsType getType () const
void setValue (double dValue)
void setValue (const std::string &valueText)
double getValue () const
std::string getValueText (DmsFormatType format=DMS_FULL, int precision=-1) const
DmsPointoperator= (const DmsPoint &original)
bool operator== (const DmsPoint &rhs) const


Detailed Description

Adds text formatting for a latitude or longitude value.

This class provides common formatting to a single latutude or longitude value. When the data value is set, it can be retrieved either in the raw data value format, or in one of several text formats, as defined by the DmsType enum.

See also:
LatLonPoint

Definition at line 28 of file GeoPoint.h.


Member Typedef Documentation

typedef EnumWrapper<DmsTypeEnum> DmsPoint::DmsType

The EnumWrapper contains a given enum value and provides a isValid() method which returns true if the contained enum value is valid.

Please see How To Use EnumWrapper for more information. The wrapped enum values are DmsPoint::DmsTypeEnum.

Definition at line 50 of file GeoPoint.h.


Member Enumeration Documentation

Specifies the text formatting type for the data value.

See also:
DmsPoint::getValueText()
Enumerator:
DMS_DECIMAL  The value is interpreted as neither latitude or longitude, and a negative sign or the absence of one indicates the hemisphere in the text.

DMS_LATITUDE  The value is interpreted as latitude, and the hemisphere is designated by 'N' or 'S' in the text.

DMS_LONGITUDE  The value is interpreted as longitude, and the hemisphere is designated by 'E' or 'W' in the text.

Definition at line 36 of file GeoPoint.h.


Constructor & Destructor Documentation

DmsPoint::DmsPoint ( DmsType  eType,
double  dValue = 0.0 
)

Creates a DMS point with an initial raw value.

Parameters:
eType The DMS point type.
dValue The initial value for the DMS point.
See also:
DmsType

DmsPoint::DmsPoint ( DmsType  eType,
const std::string &  valueText 
)

Creates a DMS point with an initial string value.

Parameters:
eType The DMS point type.
valueText A string representing the initial value that can be converted to a numeric raw value.

DmsPoint::~DmsPoint (  ) 

Destroys the DMS point.


Member Function Documentation

DmsType DmsPoint::getType (  )  const

Returns the DMS point type.

Returns:
The DMS type of the DMS point.
See also:
DmsType

void DmsPoint::setValue ( double  dValue  ) 

Sets the value as a raw value.

Parameters:
dValue The new value for the DMS point.

void DmsPoint::setValue ( const std::string &  valueText  ) 

Sets the value as a string.

Parameters:
valueText A string representing the new value that can be converted to a numeric raw value.

double DmsPoint::getValue (  )  const

Returns the raw value of the DMS point.

Returns:
The DMS point raw value.
See also:
getValueText()

std::string DmsPoint::getValueText ( DmsFormatType  format = DMS_FULL,
int  precision = -1 
) const

Returns the value of the DMS point in a given text format.

Parameters:
format The text format for the string.
precision The number of digits after decimal point. Defaults to three for decimal degrees and seconds and two for decimal minutes.
Returns:
The value of the DMS point as an formatted string.
See also:
DmsFormatType, getValue()

DmsPoint& DmsPoint::operator= ( const DmsPoint original  ) 

Sets the type and value to that of another DMS point.

Parameters:
original The point from which to set this point's type and value.
Returns:
A reference to this DMS point, whose type and value have changed.

bool DmsPoint::operator== ( const DmsPoint rhs  )  const

Compares two DMS points.

Parameters:
rhs The point to compare the type and value against this point.
Returns:
Returns true if the type and value of the given point are identical to the type and value of this point; otherwise returns false.


Software Development Kit - Opticks 4.9.0 Build 16218