aboutsummaryrefslogtreecommitdiff
path: root/src/main_window.cc
diff options
context:
space:
mode:
authorccolin2021-01-02 01:10:54 +0100
committerccolin2021-01-02 01:10:54 +0100
commit861d505606d612bc328534dba3257e9ef9a1c269 (patch)
tree7ed7653ac0ec687317464b3518134b2244804a5a /src/main_window.cc
parent87f8c49cffe8a994c62c08cdb207e03ed4e0b6b8 (diff)
add basic collision detection
Diffstat (limited to 'src/main_window.cc')
-rw-r--r--src/main_window.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main_window.cc b/src/main_window.cc
index 7bc7855..e63bf0e 100644
--- a/src/main_window.cc
+++ b/src/main_window.cc
@@ -5,6 +5,7 @@
#include <QFileDialog>
#include <QJsonDocument>
#include <QStyle>
+#include <QDockWidget>
MainWindow::MainWindow(QWidget *parent) {
@@ -25,6 +26,12 @@ MainWindow::MainWindow(QWidget *parent) {
slider = new QSlider(Qt::Horizontal);
bottom_tb.addWidget(slider);
slider->setEnabled(false);
+
+ QDockWidget *dock = new QDockWidget("Outils", this);
+ dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+ settings_pane = new SettingsPane();
+ dock->setWidget(settings_pane);
+ addDockWidget(Qt::RightDockWidgetArea, dock);
}
@@ -65,6 +72,8 @@ void MainWindow::open(const QString &path) {
connect(slider, &QSlider::sliderReleased, dc, &DroneController::resume);
connect(slider, &QSlider::valueChanged, dc, &DroneController::seek);
connect(dc, &DroneController::frameChanged, slider, &QSlider::setValue);
+ connect(dc, &DroneController::collision, settings_pane, &SettingsPane::addCollision);
+ dc->computeCollisions(10);
pause();
slider->setEnabled(true);
}