diff options
Diffstat (limited to 'src/mbgl/util')
-rw-r--r-- | src/mbgl/util/clip_lines.cpp | 8 | ||||
-rw-r--r-- | src/mbgl/util/clip_lines.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/util/merge_lines.cpp | 10 | ||||
-rw-r--r-- | src/mbgl/util/merge_lines.hpp | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/mbgl/util/clip_lines.cpp b/src/mbgl/util/clip_lines.cpp index 071e9d09bd..41965876cb 100644 --- a/src/mbgl/util/clip_lines.cpp +++ b/src/mbgl/util/clip_lines.cpp @@ -3,10 +3,10 @@ namespace mbgl { namespace util { -std::vector<std::vector<Coordinate>> clipLines(const std::vector<std::vector<Coordinate>> &lines, +GeometryCollection clipLines(const GeometryCollection &lines, const int16_t x1, const int16_t y1, const int16_t x2, const int16_t y2) { - std::vector<std::vector<Coordinate>> clippedLines; + GeometryCollection clippedLines; for (auto& line : lines) { @@ -15,8 +15,8 @@ std::vector<std::vector<Coordinate>> clipLines(const std::vector<std::vector<Coo auto end = line.end() - 1; for (auto it = line.begin(); it != end; it++) { - Coordinate p0 = *(it); - Coordinate p1 = *(it + 1); + GeometryCoordinate p0 = *(it); + GeometryCoordinate p1 = *(it + 1); if (p0.x < x1 && p1.x < x1) { continue; diff --git a/src/mbgl/util/clip_lines.hpp b/src/mbgl/util/clip_lines.hpp index 6e49b48085..a4a5c5fb8a 100644 --- a/src/mbgl/util/clip_lines.hpp +++ b/src/mbgl/util/clip_lines.hpp @@ -10,7 +10,7 @@ namespace mbgl { namespace util { -std::vector<std::vector<Coordinate>> clipLines(const std::vector<std::vector<Coordinate>> &lines, +GeometryCollection clipLines(const GeometryCollection &lines, const int16_t x1, const int16_t y1, const int16_t x2, const int16_t y2); } // end namespace util diff --git a/src/mbgl/util/merge_lines.cpp b/src/mbgl/util/merge_lines.cpp index 4ff1caaf76..ee930c113e 100644 --- a/src/mbgl/util/merge_lines.cpp +++ b/src/mbgl/util/merge_lines.cpp @@ -11,7 +11,7 @@ unsigned int mergeFromRight(std::vector<SymbolFeature> &features, Index &rightIndex, Index::iterator left, size_t rightKey, - std::vector<std::vector<Coordinate>> &geom) { + GeometryCollection &geom) { unsigned int index = left->second; rightIndex.erase(left); @@ -27,7 +27,7 @@ unsigned int mergeFromLeft(std::vector<SymbolFeature> &features, Index &leftIndex, size_t leftKey, Index::iterator right, - std::vector<std::vector<Coordinate>> &geom) { + GeometryCollection &geom) { unsigned int index = right->second; leftIndex.erase(right); @@ -41,8 +41,8 @@ unsigned int mergeFromLeft(std::vector<SymbolFeature> &features, } size_t -getKey(const std::u32string& text, const std::vector<std::vector<Coordinate>>& geom, bool onRight) { - const Coordinate& coord = onRight ? geom[0].back() : geom[0].front(); +getKey(const std::u32string& text, const GeometryCollection& geom, bool onRight) { + const GeometryCoordinate& coord = onRight ? geom[0].back() : geom[0].front(); auto hash = std::hash<std::u32string>()(text); boost::hash_combine(hash, coord.x); @@ -57,7 +57,7 @@ void mergeLines(std::vector<SymbolFeature> &features) { for (unsigned int k = 0; k < features.size(); k++) { SymbolFeature &feature = features[k]; - std::vector<std::vector<Coordinate>> &geometry = feature.geometry; + GeometryCollection &geometry = feature.geometry; if (!feature.label.length()) { continue; diff --git a/src/mbgl/util/merge_lines.hpp b/src/mbgl/util/merge_lines.hpp index 4460a0bcea..55ad79036e 100644 --- a/src/mbgl/util/merge_lines.hpp +++ b/src/mbgl/util/merge_lines.hpp @@ -13,13 +13,13 @@ unsigned int mergeFromRight(std::vector<SymbolFeature> &features, std::map<std::string, unsigned int> &rightIndex, std::map<std::string, unsigned int>::iterator left, std::string &rightKey, - std::vector<std::vector<Coordinate>> &geom); + GeometryCollection &geom); unsigned int mergeFromLeft(std::vector<SymbolFeature> &features, std::map<std::string, unsigned int> &leftIndex, std::string &leftKey, std::map<std::string, unsigned int>::iterator right, - std::vector<std::vector<Coordinate>> &geom); + GeometryCollection &geom); void mergeLines(std::vector<SymbolFeature> &features); |