diff options
author | vng <viktor.govako@gmail.com> | 2011-09-27 18:29:19 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:24:35 +0300 |
commit | 1545e4a6d46d3b9e4a8fbca9c93f8ffcf2c624e1 (patch) | |
tree | 80daed1ecf279aaf25132320f6e9a9c7f55b4c77 /indexer/feature_covering.cpp | |
parent | f21e3ff4ac175a5c5f231d9fcc391748660cb30f (diff) |
Factor out CoveringGetter. Use in index and search.
Diffstat (limited to 'indexer/feature_covering.cpp')
-rw-r--r-- | indexer/feature_covering.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indexer/feature_covering.cpp b/indexer/feature_covering.cpp index 40d98593b9..dfc47aeea8 100644 --- a/indexer/feature_covering.cpp +++ b/indexer/feature_covering.cpp @@ -197,4 +197,30 @@ int GetCodingDepth(pair<int, int> const & scalesR) return (RectId::DEPTH_LEVELS - delta); } +IntervalsT const & CoveringGetter::Get(pair<int, int> const & scaleR) +{ + int const cellDepth = GetCodingDepth(scaleR); + int const ind = (cellDepth == RectId::DEPTH_LEVELS ? 0 : 1); + + if (m_res[ind].empty()) + { + switch (m_mode) + { + case 0: + CoverViewportAndAppendLowerLevels(m_rect, cellDepth, m_res[ind]); + break; + + case 1: + AppendLowerLevels(GetRectIdAsIs(m_rect), cellDepth, m_res[ind]); + break; + + case 2: + m_res[ind].push_back(IntervalsT::value_type(0, static_cast<int64_t>((1ULL << 63) - 1))); + break; + } + } + + return m_res[ind]; +} + } |