diff options
author | tatiana-kondakova <tatiana.kondakova@gmail.com> | 2018-01-29 16:56:56 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2018-02-01 18:13:38 +0300 |
commit | cbd1fab9598d99ccd1a1ef5fa317c409ef52039b (patch) | |
tree | 5de86dda4fdfd26239564cba1240555cac02578b /indexer/feature_covering.hpp | |
parent | e2db212ab16e5af127981d778834548a7dbe56b8 (diff) |
covering::IntervalsT -> covering::Intervals
Diffstat (limited to 'indexer/feature_covering.hpp')
-rw-r--r-- | indexer/feature_covering.hpp | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/indexer/feature_covering.hpp b/indexer/feature_covering.hpp index eff609a4d7..3cdca66957 100644 --- a/indexer/feature_covering.hpp +++ b/indexer/feature_covering.hpp @@ -3,9 +3,8 @@ #include "coding/point_to_integer.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" - +#include <cstdint> +#include <vector> class FeatureType; @@ -16,48 +15,47 @@ class LocalityObject; namespace covering { - typedef pair<int64_t, int64_t> IntervalT; - typedef vector<IntervalT> IntervalsT; +typedef std::pair<int64_t, int64_t> Interval; +typedef std::vector<Interval> Intervals; - // Cover feature with RectIds and return their integer representations. - vector<int64_t> CoverFeature(FeatureType const & feature, - int cellDepth, - uint64_t cellPenaltyArea); +// Cover feature with RectIds and return their integer representations. +std::vector<int64_t> CoverFeature(FeatureType const & feature, int cellDepth, + uint64_t cellPenaltyArea); - vector<int64_t> CoverLocality(indexer::LocalityObject const & o, int cellDepth, - uint64_t cellPenaltyArea); +std::vector<int64_t> CoverLocality(indexer::LocalityObject const & o, int cellDepth, + uint64_t cellPenaltyArea); - void AppendLowerLevels(RectId id, int cellDepth, IntervalsT & intervals); +void AppendLowerLevels(RectId id, int cellDepth, Intervals & intervals); - // Cover viewport with RectIds and append their RectIds as well. - void CoverViewportAndAppendLowerLevels(m2::RectD const & rect, int cellDepth, - IntervalsT & intervals); +// Cover viewport with RectIds and append their RectIds as well. +void CoverViewportAndAppendLowerLevels(m2::RectD const & rect, int cellDepth, + Intervals & intervals); - // Given a vector of intervals [a, b), sort them and merge overlapping intervals. - IntervalsT SortAndMergeIntervals(IntervalsT const & intervals); +// Given a vector of intervals [a, b), sort them and merge overlapping intervals. +Intervals SortAndMergeIntervals(Intervals const & intervals); - RectId GetRectIdAsIs(m2::RectD const & r); +RectId GetRectIdAsIs(m2::RectD const & r); - // Calculate cell coding depth according to max visual scale for mwm. - int GetCodingDepth(int scale); +// Calculate cell coding depth according to max visual scale for mwm. +int GetCodingDepth(int scale); - enum CoveringMode - { - ViewportWithLowLevels = 0, - LowLevelsOnly, - FullCover - }; +enum CoveringMode +{ + ViewportWithLowLevels = 0, + LowLevelsOnly, + FullCover +}; - class CoveringGetter - { - IntervalsT m_res[2]; +class CoveringGetter +{ + Intervals m_res[2]; - m2::RectD const & m_rect; - CoveringMode m_mode; + m2::RectD const & m_rect; + CoveringMode m_mode; - public: - CoveringGetter(m2::RectD const & r, CoveringMode mode) : m_rect(r), m_mode(mode) {} +public: + CoveringGetter(m2::RectD const & r, CoveringMode mode) : m_rect(r), m_mode(mode) {} - IntervalsT const & Get(int scale); + Intervals const & Get(int scale); }; } |