1#pragma once
2
3#include <mapbox/geometry/wagyu/config.hpp>
4#include <mapbox/geometry/wagyu/local_minimum.hpp>
5
6#include <algorithm>
7
8namespace mapbox {
9namespace geometry {
10namespace wagyu {
11
12template <typename T>
13using scanbeam_list = std::vector<T>;
14
15template <typename T>
16bool pop_from_scanbeam(T& Y, scanbeam_list<T>& scanbeam) {
17 if (scanbeam.empty()) {
18 return false;
19 }
20 std::sort(scanbeam.begin(), scanbeam.end());
21 scanbeam.erase(std::unique(scanbeam.begin(), scanbeam.end()), scanbeam.end());
22 Y = scanbeam.back();
23 scanbeam.pop_back();
24 return true;
25}
26
27template <typename T>
28void setup_scanbeam(local_minimum_list<T>& minima_list, scanbeam_list<T>& scanbeam) {
29
30 for (auto lm = minima_list.begin(); lm != minima_list.end(); ++lm) {
31 scanbeam.push_back(lm->y);
32 }
33}
34}
35}
36}
37

source code of qtlocation/src/3rdparty/mapbox-gl-native/deps/wagyu/0.4.3/include/mapbox/geometry/wagyu/scanbeam.hpp