[2] | 1 | // %flair:license{
|
---|
[13] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[2] | 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file GeoCoordinate.h
|
---|
| 7 | * \brief Class defining a point by its lla coordinates
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2013/07/29
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 | #ifndef GEOCOORDINATE_H
|
---|
| 13 | #define GEOCOORDINATE_H
|
---|
| 14 |
|
---|
| 15 | #include <io_data.h>
|
---|
| 16 |
|
---|
[13] | 17 | namespace flair {
|
---|
| 18 | namespace core {
|
---|
[2] | 19 |
|
---|
[13] | 20 | /*! \class GeoCoordinate
|
---|
| 21 | *
|
---|
| 22 | * \brief Class defining a point by its lla coordinates
|
---|
| 23 | */
|
---|
| 24 | class GeoCoordinate : public io_data {
|
---|
| 25 | public:
|
---|
| 26 | class Type : public DataType {
|
---|
| 27 | public:
|
---|
| 28 | size_t GetSize() const {
|
---|
| 29 | return sizeof(latitude) + sizeof(longitude) + sizeof(altitude);
|
---|
| 30 | }
|
---|
| 31 | std::string GetDescription() const { return "lla"; }
|
---|
| 32 | };
|
---|
[2] | 33 |
|
---|
[13] | 34 | /*!
|
---|
| 35 | * \brief Constructor
|
---|
| 36 | *
|
---|
| 37 | * Construct GeoCoordinate using values from another class.
|
---|
| 38 | *
|
---|
| 39 | * \param parent parent
|
---|
| 40 | * \param name name
|
---|
| 41 | * \param point class to copy
|
---|
| 42 | * \param n number of samples
|
---|
| 43 | */
|
---|
| 44 | GeoCoordinate(const Object *parent, std::string name,
|
---|
| 45 | const GeoCoordinate *point, int n = 1);
|
---|
[2] | 46 |
|
---|
[13] | 47 | /*!
|
---|
| 48 | * \brief Constructor
|
---|
| 49 | *
|
---|
| 50 | * Construct GeoCoordinate using specified values.
|
---|
| 51 | *
|
---|
| 52 | * \param parent parent
|
---|
| 53 | * \param name name
|
---|
| 54 | * \param latitude latitude
|
---|
| 55 | * \param longitude longitude
|
---|
| 56 | * \param altitude altitude
|
---|
| 57 | * \param n number of samples
|
---|
| 58 | */
|
---|
| 59 | GeoCoordinate(const Object *parent, std::string name, double latitude,
|
---|
| 60 | double longitude, double altitude, int n = 1);
|
---|
[2] | 61 |
|
---|
[13] | 62 | /*!
|
---|
| 63 | * \brief Destructor
|
---|
| 64 | *
|
---|
| 65 | */
|
---|
| 66 | ~GeoCoordinate();
|
---|
[2] | 67 |
|
---|
[13] | 68 | /*!
|
---|
| 69 | * \brief Copy
|
---|
| 70 | *
|
---|
| 71 | * \param point class to copy
|
---|
| 72 | */
|
---|
| 73 | void CopyFrom(const GeoCoordinate *point);
|
---|
[2] | 74 |
|
---|
[13] | 75 | /*!
|
---|
| 76 | * \brief Set coordinates
|
---|
| 77 | *
|
---|
| 78 | * \param latitude latitude
|
---|
| 79 | * \param longitude longitude
|
---|
| 80 | * \param altitude altitude
|
---|
| 81 | */
|
---|
| 82 | void SetCoordinates(double latitude, double longitude, double altitude);
|
---|
[2] | 83 |
|
---|
[13] | 84 | /*!
|
---|
| 85 | * \brief Get coordinates
|
---|
| 86 | *
|
---|
| 87 | * \param latitude latitude
|
---|
| 88 | * \param longitude longitude
|
---|
| 89 | * \param altitude altitude
|
---|
| 90 | */
|
---|
| 91 | void GetCoordinates(double *latitude, double *longitude,
|
---|
| 92 | double *altitude) const;
|
---|
[2] | 93 |
|
---|
[13] | 94 | Type const &GetDataType() const { return dataType; }
|
---|
[2] | 95 |
|
---|
[13] | 96 | private:
|
---|
| 97 | /*!
|
---|
| 98 | * \brief Copy datas
|
---|
| 99 | *
|
---|
| 100 | * Reimplemented from io_data. \n
|
---|
| 101 | * See io_data::CopyDatas.
|
---|
| 102 | *
|
---|
| 103 | * \param dst destination buffer
|
---|
| 104 | */
|
---|
| 105 | void CopyDatas(char *ptr) const;
|
---|
[2] | 106 |
|
---|
[13] | 107 | double latitude;
|
---|
| 108 | double longitude;
|
---|
| 109 | double altitude;
|
---|
| 110 | Type dataType;
|
---|
| 111 | };
|
---|
| 112 |
|
---|
[2] | 113 | } // end namespace core
|
---|
| 114 | } // end namespace flair
|
---|
| 115 |
|
---|
| 116 | #endif // GEOCOORDINATE_H
|
---|