-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuilding.h
71 lines (58 loc) · 1.34 KB
/
building.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
/*building.h*/
//
// A building in the Open Street Map.
//
// Mark Fortes
// Northwestern University
// CS 211: Winter 2023
//
#pragma once
#include <string>
#include <vector>
#include <utility>
#include "node.h"
#include "nodes.h"
using namespace std;
//
// Building
//
// Defines a campus building with a name (e.g. "Mudd"), a street
// address (e.g. "2233 Tech Dr"), and the IDs of the nodes that
// define the position / outline of the building.
//
// NOTE: the Name could be empty "", the HouseNumber could be
// empty, and the Street could be empty. Imperfect data.
//
class Building
{
public:
long long ID;
string Name;
string StreetAddress;
vector<long long> NodeIDs;
//
// constructor
//
Building(long long id, string name, string streetAddr);
//
// containsThisNode
//
// Returns true if the building's nodes contains the given node id,
// false if not.
//
bool containsThisNode(long long nodeid);
//
// print
//
// prints information about a building --- id, name, etc. -- to
// the console. The function is passed the Nodes for searching
// purposes.
//
void print(Nodes& nodes);
//
// adds the given nodeid to the end of the vector.
//
void add(long long nodeid);
//lookup each node id and retrieve the node’s avg latitude and longitude
pair<double, double> getLocation(Nodes& N);
};