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

feature_visibility.hpp « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6f3fea925c7f4971be9ace6a7c27cac643a66d49 (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
55
56
57
58
59
60
61
62
63
64
#pragma once

#include "drawing_rule_def.hpp"

#include "../base/base.hpp"

#include "../std/vector.hpp"
#include "../std/string.hpp"
#include "../std/utility.hpp"


class FeatureBase;

namespace feature
{
  class TypesHolder;

  // Note! do not change this values. Should be equal with EGeomType.
  enum FeatureGeoType {
    FEATURE_TYPE_POINT = 0,
    FEATURE_TYPE_LINE = 1,
    FEATURE_TYPE_AREA = 2,
    FEATURE_TYPE_LINE_AREA = 3
  };

  bool IsDrawableAny(uint32_t type);
  bool IsDrawableLike(vector<uint32_t> const & types, FeatureGeoType ft);
  bool IsDrawableForIndex(FeatureBase const & f, int level);

  bool RemoveNoDrawableTypes(vector<uint32_t> & types, FeatureGeoType ft);

  int GetMinDrawableScale(FeatureBase const & f);

  /// @return [-1, -1] if no any text exists
  //@{
  /// @name Get scale range when feature is visible.
  pair<int, int> GetDrawableScaleRange(uint32_t type);
  pair<int, int> GetDrawableScaleRange(TypesHolder const & types);

  /// @name Get scale range when feature's text is visible.
  pair<int, int> GetDrawableScaleRangeForText(TypesHolder const & types);
  pair<int, int> GetDrawableScaleRangeForText(FeatureBase const & f);
  //@}

  /// @return (geometry type, is coastline)
  pair<int, bool> GetDrawRule(FeatureBase const & f, int level,
                              vector<drule::Key> & keys, string & names);

  bool IsHighway(vector<uint32_t> const & types);
  //bool IsJunction(vector<uint32_t> const & types);

  bool UsePopulationRank(uint32_t type);

  template <class IterT>
  inline bool UsePopulationRank(IterT beg, IterT end)
  {
    while (beg != end)
    {
      if (UsePopulationRank(*beg++))
        return true;
    }
    return false;
  }
}