Files
MapLibreParticleLab/src/mbgl/layout/symbol_instance.hpp
Chris Loer c0cb210ddc [core] Switch from background to foreground placement
- Background placement code now just generates static symbol buffers
 - Don't render GeometryTiles until their symbols are loaded. This is necessary for the CrossTileSymbolIndex to successfully prevent flicker.
 - SymbolInstances are transferred to SymbolBucket for use on foreground during collision detection
 - Symbols are sorted on foreground by sorting their index buffer but leaving vertex buffers intact (only works within one segment)
 - Vertical glyphs are generated at same time as horizontal glyphs. `reprojectLineLabels` chooses which one to use at render time and hides the other.
 - Icons are now always represented with a single collision box, even if they're placed along a line (this means their rotation alignment may be wrong, but the approach of representing them with multiple collision boxes wasn't very accurate either).
 - Generate vertices for new debug collision boxes and collision circles
 - Only add symbols within tile boundaries (reduces work, avoids double-draw)
 - Update symbol_projection.cpp to support line label projection calls from CollisionIndex.
2017-11-17 10:05:15 -08:00

59 lines
1.8 KiB
C++

#pragma once
#include <mbgl/text/quads.hpp>
#include <mbgl/text/glyph_atlas.hpp>
#include <mbgl/text/collision_feature.hpp>
#include <mbgl/style/layers/symbol_layer_properties.hpp>
namespace mbgl {
class Anchor;
class IndexedSubfeature;
class SymbolInstance {
public:
SymbolInstance(Anchor& anchor,
GeometryCoordinates line,
const std::pair<Shaping, Shaping>& shapedTextOrientations,
optional<PositionedIcon> shapedIcon,
const style::SymbolLayoutProperties::Evaluated&,
const float layoutTextSize,
const uint32_t index,
const float textBoxScale,
const float textPadding,
style::SymbolPlacementType textPlacement,
const std::array<float, 2> textOffset,
const float iconBoxScale,
const float iconPadding,
const std::array<float, 2> iconOffset,
const GlyphPositionMap&,
const IndexedSubfeature&,
const std::size_t featureIndex,
const std::u16string& key,
const float overscaling);
Anchor anchor;
GeometryCoordinates line;
uint32_t index;
bool hasText;
bool hasIcon;
SymbolQuads horizontalGlyphQuads;
SymbolQuads verticalGlyphQuads;
optional<SymbolQuad> iconQuad;
CollisionFeature textCollisionFeature;
CollisionFeature iconCollisionFeature;
WritingModeType writingModes;
std::size_t featureIndex;
std::array<float, 2> textOffset;
std::array<float, 2> iconOffset;
std::u16string key;
bool isDuplicate;
optional<size_t> placedTextIndex;
optional<size_t> placedVerticalTextIndex;
optional<size_t> placedIconIndex;
uint32_t crossTileID = 0;
};
} // namespace mbgl