blob: 9e1256489f585f772e07cf87061712acb9aeedc6 (
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
|
#include "map/user_mark_layer.hpp"
#include "map/search_mark.hpp"
#include "drape_frontend/drape_engine.hpp"
#include "drape_frontend/tile_key.hpp"
#include "base/macros.hpp"
#include "base/scope_guard.hpp"
#include "base/stl_helpers.hpp"
#include <algorithm>
#include <utility>
UserMarkLayer::UserMarkLayer(UserMark::Type type)
: m_type(type)
{
}
UserMarkLayer::~UserMarkLayer()
{
Clear();
}
bool UserMarkLayer::IsVisible() const
{
return m_isVisible;
}
bool UserMarkLayer::IsVisibilityChanged() const
{
return m_isVisible != m_wasVisible;
}
UserMark::Type UserMarkLayer::GetType() const
{
return m_type;
}
void UserMarkLayer::Clear()
{
SetDirty();
m_userMarks.clear();
m_tracks.clear();
}
bool UserMarkLayer::IsEmpty() const
{
return m_userMarks.empty() && m_tracks.empty();
}
void UserMarkLayer::SetIsVisible(bool isVisible)
{
if (m_isVisible != isVisible)
{
SetDirty();
m_isVisible = isVisible;
}
}
void UserMarkLayer::ResetChanges()
{
m_isDirty = false;
m_wasVisible = m_isVisible;
}
void UserMarkLayer::AttachUserMark(kml::MarkId markId)
{
SetDirty();
m_userMarks.insert(markId);
}
void UserMarkLayer::DetachUserMark(kml::MarkId markId)
{
SetDirty();
m_userMarks.erase(markId);
}
void UserMarkLayer::AttachTrack(kml::TrackId trackId)
{
SetDirty();
m_tracks.insert(trackId);
}
void UserMarkLayer::DetachTrack(kml::TrackId trackId)
{
SetDirty();
m_tracks.erase(trackId);
}
|