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

user_marks_provider.hpp « drape_frontend - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c9d8aff872900db0406496c702ff53f40b981778 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#pragma once

#include "drape_frontend/color_constants.hpp"
#include "drape_frontend/render_state.hpp"
#include "drape_frontend/shape_view_params.hpp"

#include "drape/drape_global.hpp"
#include "drape/pointers.hpp"

#include "kml/type_utils.hpp"

#include "indexer/feature_decl.hpp"

#include "geometry/polyline2d.hpp"

#include <vector>

namespace df
{
struct IDCollections
{
  kml::MarkIdCollection m_markIds;
  kml::TrackIdCollection m_lineIds;

  bool IsEmpty()
  {
    return m_markIds.empty() && m_lineIds.empty();
  }

  void Clear()
  {
    m_markIds.clear();
    m_lineIds.clear();
  }
};

class UserPointMark
{
public:
  using ColoredSymbolZoomInfo = std::map<int, df::ColoredSymbolViewParams>;
  using SymbolNameZoomInfo = std::map<int, std::string>;
  using TitlesInfo = std::vector<dp::TitleDecl>;
  using SymbolSizes = std::vector<m2::PointF>;
  using SymbolOffsets = std::vector<m2::PointF>;

  explicit UserPointMark(kml::MarkId id);
  virtual ~UserPointMark() = default;

  virtual bool IsDirty() const = 0;
  virtual void ResetChanges() const = 0;

  kml::MarkId GetId() const { return m_id; }
  virtual kml::MarkGroupId GetGroupId() const = 0;

  virtual m2::PointD const & GetPivot() const = 0;
  virtual m2::PointD GetPixelOffset() const = 0;
  virtual dp::Anchor GetAnchor() const = 0;
  virtual float GetDepth() const = 0;
  virtual RenderState::DepthLayer GetDepthLayer() const = 0;
  virtual bool IsVisible() const = 0;
  virtual drape_ptr<TitlesInfo> GetTitleDecl() const = 0;
  virtual drape_ptr<SymbolNameZoomInfo> GetSymbolNames() const = 0;
  virtual drape_ptr<SymbolNameZoomInfo> GetBadgeNames() const = 0;
  virtual drape_ptr<ColoredSymbolZoomInfo> GetColoredSymbols() const = 0;
  virtual drape_ptr<SymbolSizes> GetSymbolSizes() const = 0;
  virtual drape_ptr<SymbolOffsets> GetSymbolOffsets() const = 0;
  virtual uint16_t GetPriority() const = 0;
  virtual uint32_t GetIndex() const = 0;
  virtual bool HasSymbolPriority() const = 0;
  virtual bool HasTitlePriority() const = 0;
  virtual int GetMinZoom() const = 0;
  virtual int GetMinTitleZoom() const = 0;
  virtual FeatureID GetFeatureID() const = 0;
  virtual bool HasCreationAnimation() const = 0;
  virtual df::ColorConstant GetColorConstant() const = 0;

private:
  kml::MarkId m_id;
};

class UserLineMark
{
public:
  explicit UserLineMark(kml::TrackId id);
  virtual ~UserLineMark() = default;

  virtual bool IsDirty() const = 0;
  virtual void ResetChanges() const = 0;

  virtual kml::TrackId GetId() const { return m_id; }

  virtual int GetMinZoom() const = 0;
  virtual RenderState::DepthLayer GetDepthLayer() const = 0;
  virtual size_t GetLayerCount() const = 0;
  virtual dp::Color GetColor(size_t layerIndex) const = 0;
  virtual float GetWidth(size_t layerIndex) const = 0;
  virtual float GetDepth(size_t layerIndex) const = 0;
  virtual std::vector<m2::PointD> const & GetPoints() const = 0;

private:
  kml::TrackId m_id;
};

class UserMarksProvider
{
public:
  virtual ~UserMarksProvider() = default;
  virtual kml::GroupIdSet const & GetDirtyGroupIds() const = 0;
  virtual kml::GroupIdSet const & GetRemovedGroupIds() const = 0;
  virtual kml::GroupIdSet GetAllGroupIds() const = 0;
  virtual bool IsGroupVisible(kml::MarkGroupId groupId) const = 0;
  virtual bool IsGroupVisibilityChanged(kml::MarkGroupId groupId) const = 0;
  virtual kml::MarkIdSet const & GetGroupPointIds(kml::MarkGroupId groupId) const = 0;
  virtual kml::TrackIdSet const & GetGroupLineIds(kml::MarkGroupId groupId) const = 0;
  virtual kml::MarkIdSet const & GetCreatedMarkIds() const = 0;
  virtual kml::MarkIdSet const & GetRemovedMarkIds() const = 0;
  virtual kml::MarkIdSet const & GetUpdatedMarkIds() const = 0;
  virtual kml::TrackIdSet const & GetRemovedLineIds() const = 0;
  /// Never store UserPointMark reference.
  virtual UserPointMark const * GetUserPointMark(kml::MarkId markId) const = 0;
  /// Never store UserLineMark reference.
  virtual UserLineMark const * GetUserLineMark(kml::TrackId lineId) const = 0;
};
}  // namespace df