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

animator.hpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9b070b5c57d9ff1e14363730520bd310d9c0a0bd (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
#pragma once

#include "std/shared_ptr.hpp"

#include "geometry/point2d.hpp"
#include "geometry/any_rect2d.hpp"
#include "anim/task.hpp"

class Framework;
class RotateScreenTask;
class ChangeViewportTask;
class MoveScreenTask;
/// Class, which is responsible for
/// tracking all map animations.
class Animator
{
private:

  Framework * m_framework;

  shared_ptr<RotateScreenTask> m_rotateScreenTask;
  shared_ptr<ChangeViewportTask> m_changeViewportTask;
  shared_ptr<MoveScreenTask> m_moveScreenTask;

  void StopAnimation(shared_ptr<anim::Task> const & task);

public:

  /// constructor by Framework
  Animator(Framework * framework);
  /// rotate screen by shortest path.
  void RotateScreen(double startAngle,
                    double endAngle);
  /// stopping screen rotation
  void StopRotation();
  /// move screen from one point to another
  shared_ptr<ChangeViewportTask> const & ChangeViewport(m2::AnyRectD const & start,
                                         m2::AnyRectD const & endPt,
                                         double rotationSpeed);
  /// stop screen moving
  void StopChangeViewport();
  /// get screen rotation speed
  double GetRotationSpeed() const;
  /// move screen from one point to another
  shared_ptr<MoveScreenTask> const & MoveScreen(m2::PointD const & startPt,
                                                m2::PointD const & endPt,
                                                double speed);
  /// stopping screen movement
  void StopMoveScreen();
};