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

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

#include "map/user_mark.hpp"

#include "drape_frontend/drape_engine_safe_ptr.hpp"

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

#include <base/macros.hpp>

#include <functional>
#include <memory>
#include <set>

class UserMarkLayer
{
public:
  UserMarkLayer(UserMark::Type type);
  virtual ~UserMarkLayer();

  bool IsDirty() const { return m_isDirty; }
  void ResetChanges();

  bool IsVisible() const;
  bool IsVisibilityChanged() const;
  UserMark::Type GetType() const;

  kml::MarkIdSet const & GetUserMarks() const { return m_userMarks; }
  kml::TrackIdSet const & GetUserLines() const { return m_tracks; }

  void AttachUserMark(kml::MarkId markId);
  void DetachUserMark(kml::MarkId markId);

  void AttachTrack(kml::TrackId trackId);
  void DetachTrack(kml::TrackId trackId);

  void Clear();
  bool IsEmpty() const;

  virtual void SetIsVisible(bool isVisible);

protected:
  virtual void SetDirty() { m_isDirty = true; }

  UserMark::Type m_type;

  kml::MarkIdSet m_userMarks;
  kml::TrackIdSet m_tracks;

  bool m_isDirty = true;
  bool m_isVisible = true;
  bool m_wasVisible = false;

  DISALLOW_COPY_AND_MOVE(UserMarkLayer);
};