diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2015-10-23 13:45:29 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2015-12-29 16:35:59 +0300 |
commit | 9b5abcbf1c69914bc337150a76fba361af3a83ca (patch) | |
tree | cad4d5d8cb5084640ca23c2e1fb869505b075001 /drape/overlay_handle.hpp | |
parent | 3a0d04035390416ee0fdcb7202d3e69c8e3f3281 (diff) |
Overlays clipping for perspective mode.
Conflicts:
drape/overlay_handle.cpp
drape/overlay_handle.hpp
drape/overlay_tree.cpp
drape_frontend/poi_symbol_shape.cpp
drape_frontend/text_shape.cpp
Diffstat (limited to 'drape/overlay_handle.hpp')
-rw-r--r-- | drape/overlay_handle.hpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drape/overlay_handle.hpp b/drape/overlay_handle.hpp index ad17da2a7e..3f9861198c 100644 --- a/drape/overlay_handle.hpp +++ b/drape/overlay_handle.hpp @@ -39,18 +39,28 @@ class OverlayHandle public: typedef vector<m2::RectF> Rects; - OverlayHandle(FeatureID const & id, dp::Anchor anchor, uint64_t priority); + OverlayHandle(FeatureID const & id, + dp::Anchor anchor, + uint64_t priority, + bool isBillboard = false); virtual ~OverlayHandle() {} bool IsVisible() const; void SetIsVisible(bool isVisible); + bool IsBillboard() const; + m2::PointD GetPivot(ScreenBase const & screen) const; + m2::PointD GetPivotPerspective(ScreenBase const & screen) const; virtual bool Update(ScreenBase const & /*screen*/) { return true; } + virtual m2::RectD GetPixelRect(ScreenBase const & screen) const = 0; + virtual m2::RectD GetPixelRectPerspective(ScreenBase const & screen) const; + virtual void GetPixelShape(ScreenBase const & screen, Rects & rects) const = 0; + virtual void GetPixelShapePerspective(ScreenBase const & screen, Rects & rects) const = 0; double GetExtendingSize() const { return m_extendingSize; } void SetExtendingSize(double extendingSize) { m_extendingSize = extendingSize; } @@ -84,6 +94,7 @@ protected: FeatureID const m_id; dp::Anchor const m_anchor; uint64_t const m_priority; + bool m_isBillboard; int m_overlayRank; double m_extendingSize; @@ -93,6 +104,9 @@ protected: typedef pair<BindingInfo, MutateRegion> TOffsetNode; TOffsetNode const & GetOffsetNode(uint8_t bufferID) const; + m2::PointD GetPerspectivePoint(const m2::PointD & pixelPoint, ScreenBase const & screen) const; + m2::RectD GetPerspectiveRect(const m2::RectD & pixelRect, ScreenBase const & screen) const; + private: bool m_isVisible; @@ -119,11 +133,13 @@ public: dp::Anchor anchor, m2::PointD const & gbPivot, m2::PointD const & pxSize, - uint64_t priority); + uint64_t priority, + bool isBillboard = false); - virtual m2::RectD GetPixelRect(ScreenBase const & screen) const; - virtual void GetPixelShape(ScreenBase const & screen, Rects & rects) const; + virtual m2::RectD GetPixelRect(ScreenBase const & screen) const override; + virtual void GetPixelShape(ScreenBase const & screen, Rects & rects) const override; + virtual void GetPixelShapePerspective(ScreenBase const & screen, Rects & rects) const override; private: m2::PointD m_gbPivot; m2::PointD m_pxHalfSize; |