From 4ad1ebd4ed233f6b48f1133ec7f7e1e89f143452 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Wed, 26 Jun 2019 19:38:42 +0300 Subject: [PATCH] Add pose Y buttons --- applications/gui/src/pose_window.cpp | 16 ++++++++++++++-- applications/gui/src/src_window.cpp | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/applications/gui/src/pose_window.cpp b/applications/gui/src/pose_window.cpp index a3d5da3ba..3dc8d39dc 100644 --- a/applications/gui/src/pose_window.cpp +++ b/applications/gui/src/pose_window.cpp @@ -92,7 +92,13 @@ PoseWindow::PoseWindow(nanogui::Widget *parent, ftl::ctrl::Master *ctrl, const s tools->setFixedWidth(150); - new Widget(tools); + button = new Button(tools, "Up"); + button->setCallback([this]() { + Eigen::Affine3d transform(Eigen::Translation3d(0.0,-pose_precision_,0.0)); + Eigen::Matrix4d matrix = transform.matrix(); + pose_ *= matrix; + ctrl_->setPose(src_, pose_); + }); button = new Button(tools, "", ENTYPO_ICON_CHEVRON_UP); button->setCallback([this]() { Eigen::Affine3d transform(Eigen::Translation3d(0.0,0.0,-pose_precision_)); @@ -100,7 +106,13 @@ PoseWindow::PoseWindow(nanogui::Widget *parent, ftl::ctrl::Master *ctrl, const s pose_ *= matrix; ctrl_->setPose(src_, pose_); }); - new Widget(tools); + button = new Button(tools, "Down"); + button->setCallback([this]() { + Eigen::Affine3d transform(Eigen::Translation3d(0.0,pose_precision_,0.0)); + Eigen::Matrix4d matrix = transform.matrix(); + pose_ *= matrix; + ctrl_->setPose(src_, pose_); + }); button = new Button(tools, "", ENTYPO_ICON_CHEVRON_LEFT); button->setCallback([this]() { diff --git a/applications/gui/src/src_window.cpp b/applications/gui/src/src_window.cpp index 0a6b0feb6..b5e70e898 100644 --- a/applications/gui/src/src_window.cpp +++ b/applications/gui/src/src_window.cpp @@ -125,7 +125,8 @@ SourceWindow::SourceWindow(nanogui::Widget *parent, ftl::ctrl::Master *ctrl) auto button_pose = new Button(this, "Adjust Pose", ENTYPO_ICON_COMPASS); button_pose->setCallback([this]() { - new PoseWindow(screen(), ctrl_, src_->getURI()); + auto posewin = new PoseWindow(screen(), ctrl_, src_->getURI()); + posewin->setTheme(theme()); }); #ifdef HAVE_LIBARCHIVE -- GitLab