aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccolin2021-01-03 22:39:23 +0100
committerccolin2021-01-03 22:39:23 +0100
commite3cb8532fcc863897b6aa9430b0ab786f421cb95 (patch)
treef3ff3d2408021b124f7bb2a0995f626d0db3f2ac
parentcbf29fc087179fbda1527d3c4cea82c2b8e9f695 (diff)
rename "draw support lines" to "draw guides"
-rw-r--r--src/drone_controller.cc11
-rw-r--r--src/drone_controller.hh6
-rw-r--r--src/main_window.cc4
-rw-r--r--src/settings_pane.cc8
-rw-r--r--src/settings_pane.hh2
5 files changed, 16 insertions, 15 deletions
diff --git a/src/drone_controller.cc b/src/drone_controller.cc
index ffac66f..2ad3ec8 100644
--- a/src/drone_controller.cc
+++ b/src/drone_controller.cc
@@ -76,7 +76,7 @@ void DroneController::drawTrajectory(QOpenGLExtraFunctions *f, const Drone &d) c
}
-void DroneController::drawSupportLine(QOpenGLExtraFunctions *f, const Drone &d) const {
+void DroneController::drawGuide(QOpenGLExtraFunctions *f, const Drone &d) const {
OpenGLWidget::instance->getLineProgram()->bind();
OpenGLWidget::instance->getLineProgram()->setUniformValue("color", .2, .2, .2);
GLfloat data[6] = {
@@ -114,8 +114,8 @@ void DroneController::draw(QOpenGLExtraFunctions *f) const {
if (draw_trajectories) {
drawTrajectory(f, d);
}
- if (draw_support_lines) {
- drawSupportLine(f, d);
+ if (draw_guides) {
+ drawGuide(f, d);
}
}
}
@@ -219,7 +219,8 @@ void DroneController::setDrawTrajectories(bool enable) {
OpenGLWidget::instance->update();
}
-void DroneController::setDrawSupportLines(bool enable) {
- draw_support_lines = enable;
+
+void DroneController::setDrawGuides(bool enable) {
+ draw_guides = enable;
OpenGLWidget::instance->update();
}
diff --git a/src/drone_controller.hh b/src/drone_controller.hh
index fb6dd4e..742677b 100644
--- a/src/drone_controller.hh
+++ b/src/drone_controller.hh
@@ -24,7 +24,7 @@ class DroneController : public QObject, public Painter {
QTimer sphere_timer;
QMap<int, QVector<QPair<int, int>>> collisions;
bool draw_trajectories = false;
- bool draw_support_lines = false;
+ bool draw_guides = false;
static OpenGLMesh *sphere;
static const unsigned char sphere_neutral[];
@@ -32,7 +32,7 @@ class DroneController : public QObject, public Painter {
static bool collides(const Drone &a, const Drone &b, double radius);
void drawTrajectory(QOpenGLExtraFunctions *f, const Drone &d) const;
- void drawSupportLine(QOpenGLExtraFunctions *f, const Drone &d) const;
+ void drawGuide(QOpenGLExtraFunctions *f, const Drone &d) const;
public:
DroneController(const QJsonObject &json);
@@ -57,7 +57,7 @@ public slots:
void computeCollisions(double sphere_radius);
void displaySpheres(double sphere_radius);
void setDrawTrajectories(bool enable);
- void setDrawSupportLines(bool enable);
+ void setDrawGuides(bool enable);
};
diff --git a/src/main_window.cc b/src/main_window.cc
index ac7bd58..49c4180 100644
--- a/src/main_window.cc
+++ b/src/main_window.cc
@@ -91,8 +91,8 @@ void MainWindow::open(const QString &path) {
dc, &DroneController::displaySpheres);
connect(settings_pane, &SettingsPane::toggledTrajectories,
dc, &DroneController::setDrawTrajectories);
- connect(settings_pane, &SettingsPane::toggledSupportLines,
- dc, &DroneController::setDrawSupportLines);
+ connect(settings_pane, &SettingsPane::toggledGuides,
+ dc, &DroneController::setDrawGuides);
settings_pane->setEnabled(true);
glw.setPainter(dc);
diff --git a/src/settings_pane.cc b/src/settings_pane.cc
index 096bc08..281cd79 100644
--- a/src/settings_pane.cc
+++ b/src/settings_pane.cc
@@ -12,22 +12,22 @@ SettingsPane::SettingsPane(QWidget *parent)
QDoubleSpinBox *sphere_radius = new QDoubleSpinBox();
sphere_radius->setSingleStep(.1);
QCheckBox *show_trajectories = new QCheckBox();
- QCheckBox *show_support_lines = new QCheckBox();
+ QCheckBox *show_guides = new QCheckBox();
collisions = new QListWidget();
connect(sphere_radius, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &SettingsPane::sphereRadiusChanged);
connect(show_trajectories, &QCheckBox::stateChanged,
this, &SettingsPane::toggledTrajectories);
- connect(show_support_lines, &QCheckBox::stateChanged,
- this, &SettingsPane::toggledSupportLines);
+ connect(show_guides, &QCheckBox::stateChanged,
+ this, &SettingsPane::toggledGuides);
connect(collisions, &QListWidget::itemClicked,
[&](QListWidgetItem *item) { emit collisionClicked(((CollisionItem *) item)->getFrame()); });
QFormLayout *layout = new QFormLayout;
layout->addRow("Taille de la sphère de collision", sphere_radius);
layout->addRow("Afficher les trajectoires", show_trajectories);
- layout->addRow("Afficher les lignes de support", show_support_lines);
+ layout->addRow("Afficher les guides", show_guides);
QGroupBox *box = new QGroupBox();
box->setTitle("Collisions");
box->setFlat(true);
diff --git a/src/settings_pane.hh b/src/settings_pane.hh
index 25cdf6f..def73ae 100644
--- a/src/settings_pane.hh
+++ b/src/settings_pane.hh
@@ -32,7 +32,7 @@ public slots:
signals:
void sphereRadiusChanged(double sqRadius);
void toggledTrajectories(int shown);
- void toggledSupportLines(int shown);
+ void toggledGuides(int shown);
void collisionClicked(int frame);
};