-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplaytextv2.cpp
More file actions
62 lines (49 loc) · 1.54 KB
/
displaytextv2.cpp
File metadata and controls
62 lines (49 loc) · 1.54 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 "displaytextv2.h"
#include "ui_displaytextv2.h"
AllRoutes *DisplayTextV2::getAllRoutes() const
{
return allRoutes;
}
void DisplayTextV2::setAllRoutes(AllRoutes *value)
{
allRoutes = value;
}
DisplayTextV2::DisplayTextV2(QWidget *parent) :
QDialog(parent),
ui(new Ui::DisplayTextV2)
{
ui->setupUi(this);
}
DisplayTextV2::~DisplayTextV2()
{
delete ui;
}
void DisplayTextV2::setupUI(){
APWidgetText2 *apglWidget = findChild<APWidgetText2 *>("apglwidget",Qt::FindChildrenRecursively);
//Set first Leg flag
Route tempRoute;
SubRoute tempSubRoute;
Leg tempLeg;
std::vector<Leg> tempLegs;
std::vector<SubRoute> tempSubRoutes;
std::vector<Route> tempRoutes;
tempRoutes = allRoutes->getRoutes();
for(int i = 0 ; i < allRoutes->getRoutes().size(); i++){
tempRoute = allRoutes->getRoutes().at(i);
tempSubRoutes = tempRoute.getSubRoutes();
for(int j = 0 ; j < tempRoute.getSubRoutes().size(); j++){
tempSubRoute = tempRoute.getSubRoutes().at(j);
tempLegs = tempSubRoute.getLegs();
tempLeg = tempLegs.at(0); // index of first leg
tempLeg.isFirstLeg = true;
tempLegs[0] = tempLeg;
tempSubRoute.setLegs(tempLegs);
tempSubRoutes[j] = tempSubRoute;
}
tempRoute.setSubRoutes(tempSubRoutes);
tempRoutes[i] = tempRoute;
}
allRoutes->setRoutes(tempRoutes);
apglWidget->allRoutes = allRoutes;
apglWidget->updateGL();
}