From 834d876a9c2b104c25bdf1e47d2578bebd228224 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Fri, 18 Mar 2016 13:19:55 +0300 Subject: [PATCH] POI displacement fixes. --- data/minsk-pass.mwm | Bin 309384 -> 309596 bytes indexer/displacement_manager.hpp | 27 +++++++++++---------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/data/minsk-pass.mwm b/data/minsk-pass.mwm index d446f116678755c1ab14b86c3e4eac22e8db9e15..480ad825e82e2870dad1a57cef88b117bed05ecc 100644 GIT binary patch delta 4349 zcmZWs2~<=^y1w_X>f4vwed)f4fb88$VpIggxRcS$GiS0ePTriHdGkWQh)eL8XIv5% zQD`76vMIr)OT`4}5R^rQCJM?Df&xZVz=#Se8e~x)YSKyG<7!~q)za2k-^)`Yp4sBCT~&UYrWwjwXbVvb=>%Nge1W-`n= zCx-d2*$iWt$1sO{$fsM8J&D+g__FA&$VVpqiDj5T%1x9(lv~TrZ%3Z2pV^A}RQ4Gk ztO#)mT@*HB_j}mL5v!)m}i|ChPh2SK{-VU^c^zdwG(-`>VD;Q zpu@U3dp*p&nKJ{0U_( zC(^J7Edkx_GWlMlVv+eSOR{6oOtLxxy;&9)f$~`}|497xsEAlcp{*MOFa-oaL7TI= z+0h(cT0N`OhS`Qbm2DS3n-M%Ws z?Sy?m^GxFW1v*3*uOxpCK^k)Z3-k)9)+2$Oib0%ZFPN;3rIu?fT888)uaWRrWe*?V5g81Z0Hvd_U7(O5Pp)~Q^ZEJu#sQgwm!w0ja?3O|B%Mf438^ zP0eYK_vk)9XYk>iK^PX;bRW4pd4C`BQ_nvucyjA(KWGvDK4AZ0yOw;l4;^scd2I2n z3))}^$(XONpC5Zro1o5Zk{6}(C(md}QX(pIEElS{dal{F)w+%Ew(U7Mf8hB1p>d7w z`0GUT2@Uk-gUFh=CsM~2Z$qxeFR0OwgnWdk_hb0@CT-q`mdKM)tX%{V<157koUSJP zVLqETje8dETUeHpj5O?fwRNvvFlaBiHu6ojEe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c6 100644 --- a/indexer/displacement_manager.hpp +++ b/indexer/displacement_manager.hpp @@ -18,12 +18,11 @@ namespace { -double constexpr kPOIDisplacementRadiusPixels = 16.; +double constexpr kPOIDisplacementRadiusPixels = 60.; -// Rendering dramatically affected by a screen resolution. So I will use high resolution to cover -// case when we have a lot of free space on the screen. -size_t constexpr kMaxScreenSizeXPixels = 2560; -size_t constexpr kMaxScreenSizeYPixels = 1440; +// Displacement radius in pixels * half of the world in degrees / meaned graphics tile size. +// So average displacement radius will be: this / tiles in row count. +double constexpr kPOIDisplacementRadiusMultiplier = kPOIDisplacementRadiusPixels * 180. / 512.; } // namespace namespace covering @@ -117,7 +116,9 @@ public: { m4::Tree acceptedNodes; - sort(m_storage.begin(), m_storage.end()); + // Sort in priority descend mode. + sort(m_storage.begin(), m_storage.end(), greater()); + for (auto const & node : m_storage) { uint32_t scale = node.m_minScale; @@ -194,7 +195,7 @@ private: m_priority = (static_cast(d) << 8) | rank; } - bool operator<(DisplaceableNode const & rhs) const { return m_priority < rhs.m_priority; } + bool operator>(DisplaceableNode const & rhs) const { return m_priority > rhs.m_priority; } m2::RectD const GetLimitRect() const { return m2::RectD(m_center, m_center); } }; @@ -207,15 +208,9 @@ private: float CalculateDeltaForZoom(int32_t zoom) const { - double const worldSizeDivisor = 1 << zoom; - // Mercator SizeX and SizeY is equal - double const rectSize = (MercatorBounds::maxX - MercatorBounds::minX) / worldSizeDivisor; - - ScreenBase geometryConvertor; - geometryConvertor.OnSize(0, 0, kMaxScreenSizeXPixels, kMaxScreenSizeYPixels); - geometryConvertor.SetFromRect(m2::AnyRectD(m2::RectD(0, 0, rectSize, rectSize))); - - return kPOIDisplacementRadiusPixels * geometryConvertor.GetScale(); + // zoom - 1 is similar to drape. + double const worldSizeDivisor = 1 << (zoom - 1); + return kPOIDisplacementRadiusMultiplier / worldSizeDivisor; } void AddNodeToSorter(DisplaceableNode const & node, uint32_t scale)