-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcity.cpp
More file actions
62 lines (54 loc) · 1.66 KB
/
Copy pathcity.cpp
File metadata and controls
62 lines (54 loc) · 1.66 KB
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
#include "city.h"
#include <QMessageBox>
#include "webviewbridge.h"
#include "overlay.h"
#include "sql.h"
City::City(QObject *parent) : QObject(parent)
{
setObjectName(name());
}
//QList<Overlay*> City::overlayList() {return overlays;}
void City::addOverlay(Overlay* ov)
{
if(!ov->name.isEmpty())
{
city_overlayMap->insert(ov->name, ov);
bDirty = true;
}
}
void City::addConnection(Connection* connection)
{
if(connection->description().contains("\n"))
connection->description().remove("\n");
if(!connectionMap.contains(connection->uniqueId().toString()))
{
connectionMap.insert(connection->uniqueId().toString(), connection);
connections.append(connection);
connection->setId(connections.count()-1);
//curConnectionId = connections.count()-1;
//curConnectionId = connection->id();
_connectionUniqueId = connection->uniqueId();
connectionMap3.clear();
foreach (Connection * connect, connections) {
connectionMap3.insert(connect, connect->description());
}
}
emit connectionAdded(connection);
}
void City::removeOverlay(Overlay* ov)
{
while(city_overlayMap->contains(ov->name))
{
city_overlayMap->remove(ov->name);
bDirty = true;
}
}
void City::setDirty(bool b) {bDirty = b;}
bool City::isDirty() {return bDirty;}
void City::setCityBounds(WebViewBridge* m_bridge)
{
QMessageBox::question(nullptr, "Set City Bounds", "Zoom in or out until the entire 'region in the display covers the region. Then click on the Set Bounds' button");
m_bridge->processScript("addCityBoundsButton");
}
void City::setCenter(LatLng center){this->center = center;}
void City::setId(int id){this->id = id;}