#pragma once #include #include #include #include #include #include #include #include #include namespace mbgl { class BucketParameters; class RenderLineLayer; class LineBucket final : public Bucket { public: using PossiblyEvaluatedPaintProperties = style::LinePaintProperties::PossiblyEvaluated; using PossiblyEvaluatedLayoutProperties = style::LineLayoutProperties::PossiblyEvaluated; LineBucket(const PossiblyEvaluatedLayoutProperties layout, const std::map>& layerPaintProperties, const float zoom, const uint32_t overscaling); ~LineBucket() override; void addFeature(const GeometryTileFeature&, const GeometryCollection&, const mbgl::ImagePositions& patternPositions, const PatternLayerMap&) override; bool hasData() const override; void upload(gfx::UploadPass&) override; float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; PossiblyEvaluatedLayoutProperties layout; gfx::VertexVector vertices; gfx::IndexVector triangles; SegmentVector segments; optional> vertexBuffer; optional indexBuffer; std::map paintPropertyBinders; private: void addGeometry(const GeometryCoordinates&, const GeometryTileFeature&); struct TriangleElement { TriangleElement(uint16_t a_, uint16_t b_, uint16_t c_) : a(a_), b(b_), c(c_) {} uint16_t a, b, c; }; class Distances; void addCurrentVertex(const GeometryCoordinate& currentVertex, double& distance, const Point& normal, double endLeft, double endRight, bool round, std::size_t startVertex, std::vector& triangleStore, optional distances); void addPieSliceVertex(const GeometryCoordinate& currentVertex, double distance, const Point& extrude, bool lineTurnsLeft, std::size_t startVertex, std::vector& triangleStore, optional distances); std::ptrdiff_t e1; std::ptrdiff_t e2; std::ptrdiff_t e3; const float zoom; const uint32_t overscaling; }; } // namespace mbgl