-
Notifications
You must be signed in to change notification settings - Fork 3
/
Map.h
79 lines (57 loc) · 2.32 KB
/
Map.h
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
// -*- c++ -*-
// Copyright 2009 Isis Innovation Limited
//
// This header declares the Map class.
// This is pretty light-weight: All it contains is
// a vector of MapPoints and a vector of KeyFrames.
//
// N.b. since I don't do proper thread safety,
// everything is stored as lists of pointers,
// and map points are not erased if they are bad:
// they are moved to the trash list. That way
// old pointers which other threads are using are not
// invalidated!
#ifndef __MAP_H
#define __MAP_H
#include <vector>
#include <TooN/se3.h>
#include <cvd/image.h>
#include <deque>
#include "MapLockManager.h"
namespace PTAMM {
struct MapPoint;
class KeyFrame;
class Game;
class Map
{
public:
Map();
~Map();
inline bool IsGood() {return bGood;}
void Reset();
void MoveBadPointsToTrash();
void EmptyTrash();
int QueueSize() { return static_cast<int>(vpKeyFrameQueue.size()); } // How many KFs in the queue waiting to be added?
int MapID() { return mnMapNum; }
public:
std::vector<MapPoint*> vpPoints;
std::vector<MapPoint*> vpPointsTrash;
std::vector<KeyFrame*> vpKeyFrames;
// These have been moved from MapMaker, as now have multiple maps
std::vector<KeyFrame*> vpKeyFrameQueue; // Queue of keyframes from the tracker waiting to be processed
std::vector<std::pair<KeyFrame*, MapPoint*> > vFailureQueue; // Queue of failed observations to re-find
std::deque<MapPoint*> qNewQueue; // Queue of newly-made map points to re-find in other KeyFrames
bool bBundleConverged_Full; // Has global bundle adjustment converged?
bool bBundleConverged_Recent; // Has local bundle adjustment converged?
bool bGood; // Is the map valid (has content)?
bool bEditLocked; // Is the map locked from being edited?
//PTAMM Additions
Game * pGame; // The AR Game for this map
MapLockManager mapLockManager; // All threads must register to this and
// use when need complete control of a map
std::string sSaveFile; // where the map was loaded from
private:
int mnMapNum; // The map number
};
}
#endif