diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-11-13 11:13:29 -0800 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-11-13 13:37:45 -0800 |
commit | cf24329e78197b3728f68ece2cd5c5da5c7541d3 (patch) | |
tree | 7776085e77940241f848cbcc8e4d4674776243bd | |
parent | d7d3db9c8b65b81957bed2baaa2e5bb9c52f6e82 (diff) | |
download | qtlocation-mapboxgl-cf24329e78197b3728f68ece2cd5c5da5c7541d3.tar.gz |
Standardize indentation for placement.hpp
-rw-r--r-- | src/mbgl/text/placement.hpp | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/src/mbgl/text/placement.hpp b/src/mbgl/text/placement.hpp index 4d5fad06a1..c6d1f259a5 100644 --- a/src/mbgl/text/placement.hpp +++ b/src/mbgl/text/placement.hpp @@ -9,82 +9,82 @@ namespace mbgl { - class RenderSymbolLayer; - class SymbolBucket; - - class OpacityState { - public: - OpacityState(bool placed, bool offscreen); - OpacityState(const OpacityState& prevOpacityState, float increment, bool placed); - bool isHidden() const; - float opacity; - bool placed; - }; - - class JointOpacityState { - public: - JointOpacityState(bool placedIcon, bool placedText, bool offscreen); - JointOpacityState(const JointOpacityState& prevOpacityState, float increment, bool placedIcon, bool placedText); - bool isHidden() const; - OpacityState icon; - OpacityState text; - }; - - class JointPlacement { - public: - JointPlacement(bool text_, bool icon_, bool offscreen_) - : text(text_), icon(icon_), offscreen(offscreen_) - {} - - const bool text; - const bool icon; - // offscreen = outside viewport, but within CollisionIndex::viewportPadding px of the edge - // Because these symbols aren't onscreen yet, we can skip the "fade in" animation, - // and if a subsequent viewport change brings them into view, they'll be fully - // visible right away. - const bool offscreen; - }; - - class Placement { - public: - Placement(const TransformState&, MapMode mapMode); - void placeLayer(RenderSymbolLayer&, const mat4&, bool showCollisionBoxes); - bool commit(const Placement& prevPlacement, TimePoint); - void updateLayerOpacities(RenderSymbolLayer&); - JointOpacityState getOpacity(uint32_t crossTileSymbolID) const; - float symbolFadeChange(TimePoint now) const; - bool hasTransitions(TimePoint now) const; - - const CollisionIndex& getCollisionIndex() const; - - bool stillRecent(TimePoint now) const; - void setRecent(TimePoint now); - void setStale(); - private: - - void placeLayerBucket( - SymbolBucket&, - const mat4& posMatrix, - const mat4& textLabelPlaneMatrix, - const mat4& iconLabelPlaneMatrix, - const float scale, - const float pixelRatio, - const bool showCollisionBoxes, - std::unordered_set<uint32_t>& seenCrossTileIDs); - - void updateBucketOpacities(SymbolBucket&, std::set<uint32_t>&); - - CollisionIndex collisionIndex; - - TransformState state; - MapMode mapMode; - TimePoint commitTime; - - std::unordered_map<uint32_t, JointPlacement> placements; - std::unordered_map<uint32_t, JointOpacityState> opacities; - - TimePoint recentUntil; - bool stale = false; - }; +class RenderSymbolLayer; +class SymbolBucket; + +class OpacityState { +public: + OpacityState(bool placed, bool offscreen); + OpacityState(const OpacityState& prevOpacityState, float increment, bool placed); + bool isHidden() const; + float opacity; + bool placed; +}; + +class JointOpacityState { +public: + JointOpacityState(bool placedIcon, bool placedText, bool offscreen); + JointOpacityState(const JointOpacityState& prevOpacityState, float increment, bool placedIcon, bool placedText); + bool isHidden() const; + OpacityState icon; + OpacityState text; +}; + +class JointPlacement { +public: + JointPlacement(bool text_, bool icon_, bool offscreen_) + : text(text_), icon(icon_), offscreen(offscreen_) + {} + + const bool text; + const bool icon; + // offscreen = outside viewport, but within CollisionIndex::viewportPadding px of the edge + // Because these symbols aren't onscreen yet, we can skip the "fade in" animation, + // and if a subsequent viewport change brings them into view, they'll be fully + // visible right away. + const bool offscreen; +}; + +class Placement { +public: + Placement(const TransformState&, MapMode mapMode); + void placeLayer(RenderSymbolLayer&, const mat4&, bool showCollisionBoxes); + bool commit(const Placement& prevPlacement, TimePoint); + void updateLayerOpacities(RenderSymbolLayer&); + JointOpacityState getOpacity(uint32_t crossTileSymbolID) const; + float symbolFadeChange(TimePoint now) const; + bool hasTransitions(TimePoint now) const; + + const CollisionIndex& getCollisionIndex() const; + + bool stillRecent(TimePoint now) const; + void setRecent(TimePoint now); + void setStale(); +private: + + void placeLayerBucket( + SymbolBucket&, + const mat4& posMatrix, + const mat4& textLabelPlaneMatrix, + const mat4& iconLabelPlaneMatrix, + const float scale, + const float pixelRatio, + const bool showCollisionBoxes, + std::unordered_set<uint32_t>& seenCrossTileIDs); + + void updateBucketOpacities(SymbolBucket&, std::set<uint32_t>&); + + CollisionIndex collisionIndex; + + TransformState state; + MapMode mapMode; + TimePoint commitTime; + + std::unordered_map<uint32_t, JointPlacement> placements; + std::unordered_map<uint32_t, JointOpacityState> opacities; + + TimePoint recentUntil; + bool stale = false; +}; } // namespace mbgl |