forked from GPSBabel/gpsbabel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arcdist.h
94 lines (80 loc) · 2.61 KB
/
arcdist.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
84
85
86
87
88
89
90
91
92
93
94
/*
Distance from point to arc filter
Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
*/
#ifndef ARCDIST_H_INCLUDED_
#define ARCDIST_H_INCLUDED_
#include "defs.h" // for ARG_NOMINMAX, ARGTYPE_BOOL, Waypoint (ptr only)
#include "filter.h" // for Filter
#if FILTERS_ENABLED
class ArcDistanceFilter:public Filter
{
public:
arglist_t* get_args() override
{
return args;
}
void init() override;
void process() override;
private:
double pos_dist;
char* distopt = nullptr;
char* arcfileopt = nullptr;
char* rteopt = nullptr;
char* trkopt = nullptr;
char* exclopt = nullptr;
char* ptsopt = nullptr;
char* projectopt = nullptr;
typedef struct {
double distance;
double prjlatitude, prjlongitude;
double frac;
Waypoint* arcpt1, * arcpt2;
} extra_data;
arglist_t args[8] = {
{
"file", &arcfileopt, "File containing vertices of arc",
nullptr, ARGTYPE_FILE, ARG_NOMINMAX, nullptr
},
{
"rte", &rteopt, "Route(s) are vertices of arc",
nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
},
{
"trk", &trkopt, "Track(s) are vertices of arc",
nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
},
{
"distance", &distopt, "Maximum distance from arc",
nullptr, ARGTYPE_FLOAT | ARGTYPE_REQUIRED, ARG_NOMINMAX, nullptr
},
{
"exclude", &exclopt, "Exclude points close to the arc", nullptr,
ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
},
{
"points", &ptsopt, "Use distance from vertices not lines",
nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
},
{
"project", &projectopt, "Move waypoints to its projection on lines or vertices",
nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
},
ARG_TERMINATOR
};
void arcdist_arc_disp_wpt_cb(const Waypoint* arcpt2);
void arcdist_arc_disp_hdr_cb(const route_head*);
};
#endif // FILTERS_ENABLED
#endif // ARCDIST_H_INCLUDED_