#pragma once #include #include #include #include #include #include #include #include #include #include #include #include namespace mbgl { class PlacedSymbol { public: PlacedSymbol(Point anchorPoint_, uint16_t segment_, float lowerSize_, float upperSize_, std::array lineOffset_, WritingModeType writingModes_, GeometryCoordinates line_, std::vector tileDistances_) : anchorPoint(anchorPoint_), segment(segment_), lowerSize(lowerSize_), upperSize(upperSize_), lineOffset(lineOffset_), writingModes(writingModes_), line(std::move(line_)), tileDistances(std::move(tileDistances_)), hidden(false), vertexStartIndex(0) { } Point anchorPoint; uint16_t segment; float lowerSize; float upperSize; std::array lineOffset; WritingModeType writingModes; GeometryCoordinates line; std::vector tileDistances; std::vector glyphOffsets; bool hidden; size_t vertexStartIndex; }; class SymbolBucket : public Bucket { public: SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated, const std::map>&, const style::DataDrivenPropertyValue& textSize, const style::DataDrivenPropertyValue& iconSize, float zoom, bool sdfIcons, bool iconsNeedLinear, bool sortFeaturesByY, const std::vector&&); void upload(gl::Context&) override; bool hasData() const override; bool hasTextData() const; bool hasIconData() const; bool hasCollisionBoxData() const; bool hasCollisionCircleData() const; void updateOpacity(); void sortFeatures(const float angle); const style::SymbolLayoutProperties::PossiblyEvaluated layout; const bool sdfIcons; const bool iconsNeedLinear; const bool sortFeaturesByY; optional sortedAngle; bool staticUploaded = false; bool placementChangesUploaded = false; bool dynamicUploaded = false; bool sortUploaded = false; std::vector symbolInstances; std::map> paintPropertyBinders; std::unique_ptr textSizeBinder; struct TextBuffer { gl::VertexVector vertices; gl::VertexVector dynamicVertices; gl::VertexVector opacityVertices; gl::IndexVector triangles; SegmentVector segments; std::vector placedSymbols; optional> vertexBuffer; optional> dynamicVertexBuffer; optional> opacityVertexBuffer; optional> indexBuffer; } text; std::unique_ptr iconSizeBinder; struct IconBuffer { gl::VertexVector vertices; gl::VertexVector dynamicVertices; gl::VertexVector opacityVertices; gl::IndexVector triangles; SegmentVector segments; std::vector placedSymbols; PremultipliedImage atlasImage; optional> vertexBuffer; optional> dynamicVertexBuffer; optional> opacityVertexBuffer; optional> indexBuffer; } icon; struct CollisionBuffer { gl::VertexVector vertices; gl::VertexVector dynamicVertices; SegmentVector segments; optional> vertexBuffer; optional> dynamicVertexBuffer; }; struct CollisionBoxBuffer : public CollisionBuffer { gl::IndexVector lines; optional> indexBuffer; } collisionBox; struct CollisionCircleBuffer : public CollisionBuffer { gl::IndexVector triangles; optional> indexBuffer; } collisionCircle; uint32_t bucketInstanceId = 0; }; } // namespace mbgl