forked from alexgoussev/TrackProcessor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SRTMAlt.h
83 lines (73 loc) · 2.42 KB
/
SRTMAlt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//---------------------------------------------------------------------------
#ifndef SRTMAltH
#define SRTMAltH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <IdHTTP.hpp>
#include <IdStream.hpp>
#include <IdBaseComponent.hpp>
#include <IdComponent.hpp>
#include <IdTCPClient.hpp>
#include <IdTCPConnection.hpp>
#include <IdIOHandler.hpp>
#include <IdIOHandlerSocket.hpp>
#include <IdIOHandlerStack.hpp>
#include <IdSSL.hpp>
#include <IdSSLOpenSSL.hpp>
#include <System.Zip.hpp>
#include <string>
#include <map>
#include <functional>
#include "GPXData.h"
//---------------------------------------------------------------------------
typedef struct tagHGTDATA {
char szName[8];
int nIndex;
} HGTDATA;
typedef struct tagDIRITEM {
char szDir[16];
int nDirNo;
} DIRITEM;
typedef HGTDATA* LPHGTDATA;
typedef DIRITEM* LPDIRITEM;
typedef std::map<std::string, int> StringMap;
class TSTRMAltitude : public TForm
{
__published: // IDE-managed Components
TProgressBar *ProgressBar;
TIdHTTP *IdHTTP;
TCheckBox *Download;
TButton *m_Ok;
TButton *m_Cancel;
TLabel *Status;
TLabeledEdit *AltSmoothFactor;
TPanel *Panel1;
TIdSSLIOHandlerSocketOpenSSL *IdSSLIOHandlerSocketOpenSSL;
void __fastcall HTTPGetSRTMWorkBegin(TObject *ASender, TWorkMode AWorkMode, __int64 AWorkCountMax);
void __fastcall HTTPGetSRTMWork(TObject *ASender, TWorkMode AWorkMode, __int64 AWorkCount);
// void __fastcall ZipProgress(TObject *Sender, String FileName, const TZipHeader &Header, __int64 Position);
void __fastcall m_OkClick(TObject *Sender);
private: // User declarations
protected:
int m_nCurPoint;
AnsiString m_asHGTPath;
AnsiString m_asSRTMBaseURL;
double m_dBeta;
double __fastcall CalcAlt(AnsiString asFileName, double dLat, double dLon);
bool __fastcall DownloadFile(AnsiString asFileName);
double __fastcall Degrees2Seconds(double Degrees);
double __fastcall ReadDEMFile(int handle, int i, int j);
int __fastcall GetHGTFileOffset(int nLatI, int nLonJ);
public:
PGPXTrack m_pTrack; // User declarations
__fastcall TSTRMAltitude(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TSTRMAltitude *STRMAltitude;
//---------------------------------------------------------------------------
#endif