struct mrpt::topography::TCoords

A coordinate that is stored as a simple “decimal” angle in degrees, but can be retrieved/set in the form of DEGREES + arc-MINUTES + arc-SECONDS.

#include <mrpt/topography/data_types.h>

struct TCoords
{
    //
fields

    double decimal_value;

    // construction

    TCoords(
        const int _deg,
        const int _min,
        const double _sec
        );

    TCoords(const double dec);
    TCoords();

    //
methods

    operator double () const;
    operator double & ();
    void setFromDecimal(const double dec);
    double getDecimalValue() const;
    void getDegMinSec(int& degrees, int& minutes, double& seconds) const;
    void setDegMinSec(const int degrees, const int minutes, const double seconds);
    std::string getAsString() const;
};

Fields

double decimal_value

Also obtained directly through the double(void) operator using a TCoords anywhere were a double is expected.

Methods

operator double () const

Automatic conversion to a double value (read-only)

operator double & ()

Automatic conversion to a double value (read-only)

void setFromDecimal(const double dec)

Set from a decimal value (XX.YYYYY) in degrees.

double getDecimalValue() const

Get the decimal value (XX.YYYYY), in degrees - you can also use the automatic conversion between TCoords and a double.

void getDegMinSec(int& degrees, int& minutes, double& seconds) const

Return the Deg Min’ Sec’’ representation of this value.

void setDegMinSec(const int degrees, const int minutes, const double seconds)

Set the coordinate from its Deg Min’ Deg’’ parts.

std::string getAsString() const

Return a std::string in the format “DEGdeg MIN’ SEC’’”.