forked from GPSBabel/gpsbabel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter_vecs.h
210 lines (195 loc) · 5.21 KB
/
filter_vecs.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/*
Describe vectors containing filter operations.
Copyright (C) 2002-2014 Robert Lipe, [email protected]
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef FILTER_VECS_H_INCLUDED_
#define FILTER_VECS_H_INCLUDED_
#include <QString> // for QString
#include <QVector> // for QVector<>::iterator, QVector
#include "defs.h" // for arglist_t
#include "arcdist.h" // for ArcDistanceFilter
#include "bend.h" // for BendFilter
#include "discard.h" // for DiscardFilter
#include "duplicate.h" // for DuplicateFilter
#include "filter.h" // for Filter
#include "height.h" // for HeightFilter
#include "interpolate.h" // for InterpolateFilter
#include "nukedata.h" // for NukeDataFilter
#include "polygon.h" // for PolygonFilter
#include "position.h" // for PositionFilter
#include "radius.h" // for RadiusFilter
#include "reverse_route.h" // for ReverseRouteFilter
#include "smplrout.h" // for SimplifyRouteFilter
#include "sort.h" // for SortFilter
#include "stackfilter.h" // for StackFilter
#include "swapdata.h" // for SwapDataFilter
#include "trackfilter.h" // for TrackFilter
#include "transform.h" // for TransformFilter
#include "validate.h" // for ValidateFilter
class FilterVecs
{
// Meyers Singleton
public:
static FilterVecs& Instance()
{
static FilterVecs instance;
return instance;
}
FilterVecs(const FilterVecs&) = delete;
FilterVecs& operator= (const FilterVecs&) = delete;
FilterVecs(FilterVecs&&) = delete;
FilterVecs& operator=(FilterVecs&&) = delete;
private:
FilterVecs() = default;
~FilterVecs() = default;
private:
struct fl_vecs_t {
Filter* vec;
QString name;
QString desc;
};
public:
Filter* find_filter_vec(const QString& vecname);
static void free_filter_vec(Filter* filter);
void init_filter_vecs();
void exit_filter_vecs();
void disp_filter_vecs() const;
void disp_filter_vec(const QString& vecname) const;
void disp_filters(int version) const;
bool validate_filters() const;
private:
static void disp_help_url(const fl_vecs_t& vec, const arglist_t* arg);
static void disp_v1(const fl_vecs_t& vec);
static bool validate_filter_vec(const fl_vecs_t& vec);
private:
ArcDistanceFilter arcdist;
BendFilter bend;
DiscardFilter discard;
DuplicateFilter duplicate;
HeightFilter height;
InterpolateFilter interpolate;
NukeDataFilter nukedata;
PolygonFilter polygon;
PositionFilter position;
RadiusFilter radius;
ReverseRouteFilter reverse_route;
SimplifyRouteFilter routesimple;
SortFilter sort;
StackFilter stackfilt;
SwapDataFilter swapdata;
TrackFilter trackfilter;
TransformFilter transform;
ValidateFilter validate;
const QVector<fl_vecs_t> filter_vec_list = {
#if FILTERS_ENABLED
{
&arcdist,
"arc",
"Include Only Points Within Distance of Arc",
},
{
&bend,
"bend",
"Add points before and after bends in routes"
},
{
&discard,
"discard",
"Remove unreliable points with high hdop or vdop"
},
{
&duplicate,
"duplicate",
"Remove Duplicates",
},
{
&interpolate,
"interpolate",
"Interpolate between trackpoints"
},
{
&nukedata,
"nuketypes",
"Remove all waypoints, tracks, or routes"
},
{
&polygon,
"polygon",
"Include Only Points Inside Polygon",
},
{
&position,
"position",
"Remove Points Within Distance",
},
{
&radius,
"radius",
"Include Only Points Within Radius",
},
{
&routesimple,
"simplify",
"Simplify routes",
},
{
&sort,
"sort",
"Rearrange waypoints, routes and/or tracks by resorting",
},
{
&stackfilt,
"stack",
"Save and restore waypoint lists"
},
{
&reverse_route,
"reverse",
"Reverse stops within routes",
},
{
&trackfilter,
"track",
"Manipulate track lists"
},
{
&transform,
"transform",
"Transform waypoints into a route, tracks into routes, ..."
},
{
&height,
"height",
"Manipulate altitudes"
},
{
&swapdata,
"swap",
"Swap latitude and longitude of all loaded points"
},
{
&validate,
"validate",
"Validate internal data structures"
}
#elif defined (MINIMAL_FILTERS)
{
&trackfilter,
"track",
"Manipulate track lists"
}
#endif
};
};
#endif // FILTER_VECS_H_INCLUDED_