Welcome to mirror list, hosted at ThFree Co, Russian Federation.

compass_arrow.hpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30bb787bbb26755bde83df66b40a6a2b6eed4734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "std/shared_ptr.hpp"
#include "std/unique_ptr.hpp"


namespace anim
{
  class Task;
}

class Framework;

/// Compass Arrow, which shows up when the screen is rotated,
/// and rotates screen back to straight orientation when beeing pressed
class CompassArrow
{
  double m_angle;
  shared_ptr<anim::Task> m_animTask;

  void AlfaAnimEnded(bool isVisible);
  bool IsHidingAnim() const;
  float GetCurrentAlfa() const;
  void CreateAnim(double startAlfa, double endAlfa, double timeInterval, double timeOffset, bool isVisibleAtEnd);

  Framework * m_framework;
  bool isBaseVisible() const;

public:
  struct Params
  {
    Framework * m_framework;
    Params();
  };

  CompassArrow(Params const & p);

  void AnimateShow();
  void AnimateHide();

  void SetAngle(double angle);

  /// @name Override from graphics::Overlayelement and gui::Element.
  //@{

  bool isVisible() const;
  //bool hitTest(m2::PointD const & pt) const;

  void cache();
  void purge();

  //bool onTapEnded(m2::PointD const & pt);
  //@}
};