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

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

#include "geometry/rect2d.hpp"
#include "geometry/point2d.hpp"


namespace scales
{
  constexpr int UPPER_STYLE_SCALE = 19;

  /// Upper scale for data generation and indexer buckets.
  constexpr int GetUpperScale() { return 17; }
  /// Upper scale according to drawing rules.
  constexpr int GetUpperStyleScale() { return UPPER_STYLE_SCALE; }
  /// Upper scales for World visible styles and indexer buckets.
  constexpr int GetUpperWorldScale() { return 9; }
  /// Upper scale level for countries.
  constexpr int GetUpperCountryScale() { return GetUpperWorldScale() + 1; }
  /// Upper scale for user comfort view (e.g. location zoom).
  constexpr int GetUpperComfortScale() { return UPPER_STYLE_SCALE - 2; }
  /// Default navigation mode scale.
  constexpr int GetNavigationScale() { return UPPER_STYLE_SCALE - 3; }
  /// Default pedestrian navigation mode scale.
  constexpr int GetPedestrianNavigationScale() { return UPPER_STYLE_SCALE - 2; }
  /// Default navigation 3d mode scale.
  constexpr int GetNavigation3dScale() { return UPPER_STYLE_SCALE - 2; }
  /// Default pedestrian navigation 3d mode scale.
  constexpr int GetPedestrianNavigation3dScale() { return UPPER_STYLE_SCALE - 2; }
  /// Default scale in adding-new-place mode.
  constexpr int GetAddNewPlaceScale() { return 18; }

  int GetMinAllowableIn3dScale();

  double GetScaleLevelD(double ratio);
  double GetScaleLevelD(m2::RectD const & r);
  int GetScaleLevel(double ratio);
  int GetScaleLevel(m2::RectD const & r);

  /// @return such ration, that GetScaleLevel(ration) == level
  double GetRationForLevel(double level);

  /// @return such rect, that GetScaleLevel(rect) == level
  m2::RectD GetRectForLevel(double level, m2::PointD const & center);

  double GetEpsilonForLevel(int level);
  double GetEpsilonForSimplify(int level);
  bool IsGoodForLevel(int level, m2::RectD const & r);
}