PageRenderTime 25ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

/ru/utils/GPSInfo.h

https://bitbucket.org/VladimirL/robotutils
C Header | 67 lines | 47 code | 16 blank | 4 comment | 0 complexity | a57011b1c6194af5f38e2edb3db75cc2 MD5 | raw file
 1// GPSInfo.h: interface for the GPSInfo class.
 2//
 3//////////////////////////////////////////////////////////////////////
 4
 5#if !defined(AFX_GPSINFO_H__2040A232_786E_4C7B_8EA5_0A9438ED6C1F__INCLUDED_)
 6#define AFX_GPSINFO_H__2040A232_786E_4C7B_8EA5_0A9438ED6C1F__INCLUDED_
 7
 8#if _MSC_VER > 1000
 9#pragma once
10#endif // _MSC_VER > 1000
11
12#include <QPoint>
13#include <math.h>
14
15#define DOUBLE double
16#define ULONG unsigned long
17#define UINT unsigned int
18#define CHAR char
19#define BOOL bool
20
21class GPSInfo;
22
23class UTMInfo
24{
25public:
26    double latitude;
27    double longitude;
28    int utmXZone;
29    char utmYZone;
30
31    UTMInfo();
32    UTMInfo(int utmXZone, char utmYZone, double latutude, double longitude);
33
34    //void fromGPSInfo(const GPSInfo& pos);
35
36    inline QPointF toQPointF() {
37        return QPointF(latitude, longitude);
38    }
39};
40
41class GPSInfo
42{
43public:
44	DOUBLE m_latitude;
45	DOUBLE m_longitude;
46    DOUBLE m_altitude;
47	ULONG m_nSentences;
48	UINT m_signalQuality;
49	UINT m_satelitesInUse;
50
51	GPSInfo();
52    GPSInfo(double lat, double lon);
53
54	virtual ~GPSInfo();
55    UTMInfo toUTMProj();
56    void fromUTMProj(const UTMInfo &pos);
57private:
58    void LatLonToUtm(double a, double f, int& utmXZone, char& utmYZone,
59                      double& easting, double& northing, double lat, double lon);
60    void UtmToLatLon (double a, double f, int utmXZone, char utmYZone,
61        double easting, double northing, double& lat, double& lon);
62};
63
64
65
66
67#endif // !defined(AFX_GPSINFO_H__2040A232_786E_4C7B_8EA5_0A9438ED6C1F__INCLUDED_)