-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMap.cpp
86 lines (63 loc) · 1.44 KB
/
Map.cpp
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
//
// Created by buyi on 17-11-9.
//
#include "Map.h"
namespace DSDTM
{
Map::Map()
{
}
Map::~Map()
{
}
void Map::AddKeyFrame(KeyFrame *_frame)
{
std::unique_lock<std::mutex> lock(mMapMutex);
msKeyFrames.insert(_frame);
}
void Map::AddMapPoint(MapPoint *_point)
{
std::unique_lock<std::mutex> lock(mMapMutex);
msMapPoints.insert(_point);
}
KeyFrame* Map::Get_InitialKFrame()
{
std::unique_lock<std::mutex> lock(mMapMutex);
return *msKeyFrames.begin();
}
std::vector<MapPoint*> Map::GetAllMapPoints()
{
std::unique_lock<std::mutex> lock(mMapMutex);
return std::vector<MapPoint*>(msMapPoints.begin(), msMapPoints.end());
}
std::vector<KeyFrame*> Map::GetAllKeyFrames()
{
std::unique_lock<std::mutex> lock(mMapMutex);
return std::vector<KeyFrame*>(msKeyFrames.begin(), msKeyFrames.end());
}
int Map::ReturnKeyFramesSize()
{
std::unique_lock<std::mutex> lock(mMapMutex);
return msKeyFrames.size();
}
void Map::SetReferenceMapPoints(const std::vector<MapPoint *> tMps)
{
std::unique_lock<std::mutex> lock(mMapMutex);
mvpReferenceMapPoints = tMps;
}
std::vector<MapPoint*> Map::GetReferenceMapPoints()
{
std::unique_lock<std::mutex> lock(mMapMutex);
return mvpReferenceMapPoints;
}
void Map::EraseMapPoint(MapPoint *tMp)
{
std::unique_lock<std::mutex> lock(mMapMutex);
msMapPoints.erase(tMp);
}
void Map::Release()
{
msMapPoints.clear();
msKeyFrames.clear();
}
}// namespace DSDTM