diff options
author | Maxim Pimenov <m@maps.me> | 2016-05-27 19:40:55 +0300 |
---|---|---|
committer | Maxim Pimenov <m@maps.me> | 2016-05-31 14:54:46 +0300 |
commit | f672cb0b8227ddafcd6b271724dda3e05df9bfef (patch) | |
tree | 423ac795cf5da4a96136416827e943040f19a1b5 /search/nested_rects_cache.hpp | |
parent | 59f40d7669598a229ffa4f6269e17234f9af9506 (diff) |
[search] Got rid of the v2 directory and namespace.
Diffstat (limited to 'search/nested_rects_cache.hpp')
-rw-r--r-- | search/nested_rects_cache.hpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/search/nested_rects_cache.hpp b/search/nested_rects_cache.hpp new file mode 100644 index 0000000000..919ed29a74 --- /dev/null +++ b/search/nested_rects_cache.hpp @@ -0,0 +1,46 @@ +#pragma once + +#include "indexer/feature_decl.hpp" + +#include "geometry/point2d.hpp" + +class Index; + +namespace search +{ +class NestedRectsCache +{ +public: + explicit NestedRectsCache(Index & index); + + void SetPosition(m2::PointD const & position, int scale); + + double GetDistanceToFeatureMeters(FeatureID const & id) const; + + void Clear(); + +private: + enum RectScale + { + RECT_SCALE_TINY, + RECT_SCALE_SMALL, + RECT_SCALE_MEDIUM, + RECT_SCALE_LARGE, + + RECT_SCALE_COUNT + }; + + static double GetRadiusMeters(RectScale scale); + + void Update(); + + Index & m_index; + int m_scale; + m2::PointD m_position; + bool m_valid; + + // Sorted lists of features. + vector<FeatureID> m_features[RECT_SCALE_COUNT]; +}; + +} // namespace search |