[core] Coordinate is now GeometryCoordinate

Also introduced GeometryCoordinates (vector of GeometryCoordinate
items), to better cope with GeometryCollection.
This commit is contained in:
Bruno de Oliveira Abinader
2016-02-18 17:09:26 +02:00
parent 411a562061
commit f3fc87261c
22 changed files with 75 additions and 65 deletions

View File

@@ -7,7 +7,7 @@
namespace mbgl {
Anchors resample(const std::vector<Coordinate> &line, const float offset, const float spacing,
Anchors resample(const GeometryCoordinates &line, const float offset, const float spacing,
const float angleWindowSize, const float maxAngle, const float labelLength, const bool continuedLine, const bool placeAtMiddle) {
const float halfLabelLength = labelLength / 2.0f;
@@ -23,8 +23,8 @@ Anchors resample(const std::vector<Coordinate> &line, const float offset, const
int i = 0;
for (auto it = line.begin(), end = line.end() - 1; it != end; it++, i++) {
const Coordinate &a = *(it);
const Coordinate &b = *(it + 1);
const GeometryCoordinate &a = *(it);
const GeometryCoordinate &b = *(it + 1);
const float segmentDist = util::dist<float>(a, b);
const float angle = util::angle_to(b, a);
@@ -65,7 +65,7 @@ Anchors resample(const std::vector<Coordinate> &line, const float offset, const
return anchors;
}
Anchors getAnchors(const std::vector<Coordinate> &line, float spacing,
Anchors getAnchors(const GeometryCoordinates &line, float spacing,
const float maxAngle, const float textLeft, const float textRight,
const float iconLeft, const float iconRight,
const float glyphSize, const float boxScale, const float overscaling) {