-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDouglasPeucker.h
36 lines (29 loc) · 1.15 KB
/
DouglasPeucker.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
//---------------------------------------------------------------------------
#ifndef DouglasPeuckerH
#define DouglasPeuckerH
#include "GPXData.h"
#define DPFILTER_POINT (WM_APP + 701)
//---------------------------------------------------------------------------
class DouglasPeucker
{
public:
__fastcall DouglasPeucker(HWND hParentWnd = NULL);
__fastcall ~DouglasPeucker();
void __fastcall Simplify();
__property PGPXTrack CurrentTrack = { read=GetCurrentTrack, write=SetCurrentTrack };
__property double Epsilon = { read=GetEpsilon, write=SetEpsilon };
protected:
HWND m_hParentWnd;
double __fastcall GetDistance(double x1, double y1, double x2, double y2, double x0, double y0);
void __fastcall SimplifySegment(int nFirst, int nLast);
double __fastcall DistPP(double x1, double y1, double x2, double y2);
double __fastcall DistPS(double x1, double y1, double x2, double y2, double x0, double y0);
private:
PGPXTrack m_pCurrentTrack;
double m_dEpsilon;
void __fastcall SetCurrentTrack(PGPXTrack value);
PGPXTrack __fastcall GetCurrentTrack();
void __fastcall SetEpsilon(double value);
double __fastcall GetEpsilon();
};
#endif