-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.cpp
65 lines (53 loc) · 1.52 KB
/
mainwindow.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
#include "mainwindow.hpp"
#include "ui_mainwindow.h"
#include <iostream>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->DropdownListScene, SIGNAL(currentIndexChanged(const QString&)), SLOT(sceneDropdownChanged(const QString&)));
connect(ui->DropdownListAlgorithm, SIGNAL(currentIndexChanged(const QString&)), SLOT(algorithmDropdownChanged(const QString&)));
}
MainWindow::~MainWindow()
{
delete ui;
}
OgreWidget* MainWindow::RenderAreaPtr()
{
return ui->widget;
}
void MainWindow::SwitchCollisionInScene(bool SceneCollisionState)
{
if(SceneCollisionState)
ui->DisplayCollisionScene->display(1);
else
ui->DisplayCollisionScene->display(0);
}
void MainWindow::SwitchCollisionInAlgorithm(bool AlgorithmCollisionState)
{
if(AlgorithmCollisionState)
ui->DisplayCollisionAlgorithm->display(1);
else
ui->DisplayCollisionAlgorithm->display(0);
}
void MainWindow::sceneDropdownChanged(const QString& sceneQTitle)
{
emit sceneChanged(sceneQTitle.toStdString());
}
void MainWindow::algorithmDropdownChanged(const QString& algorithmQTitle)
{
emit algorithmChanged(algorithmQTitle.toStdString());
}
void MainWindow::AddScene(std::string sceneTitle)
{
ui->DropdownListScene->addItem(QString(sceneTitle.c_str()));
}
void MainWindow::AddAlgorithm(std::string algorithmTitle)
{
ui->DropdownListAlgorithm->addItem(QString(algorithmTitle.c_str()));
}
void MainWindow::setFPS(unsigned long fps)
{
ui->FPSLabel->setText(QString::number(fps));
}