summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-06-03 15:48:29 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-06-13 07:02:53 +0200
commitf128b1de42cf8b2d9b50f57561a205073b9e250d (patch)
treed5c26c724296e0deb7cc22886c521623b29db929
parent92e41fff15f58e7764f91004650b0e6b9c4e2f1e (diff)
switch to structured bindings
-rw-r--r--tracker-pt/ftnoir_tracker_pt_dialog.cpp4
-rw-r--r--tracker-pt/module/frame.cpp4
-rw-r--r--tracker-steamvr/steamvr.cpp6
-rw-r--r--tracker-wii/wii_frame.cpp4
4 files changed, 5 insertions, 13 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
index 5bd1a4c8..9073907d 100644
--- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp
+++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
@@ -153,9 +153,7 @@ void TrackerDialog_PT::startstop_trans_calib(bool start)
calib_timer.stop();
qDebug() << "pt: stopping translation calibration";
{
- cv::Vec3f tmp;
- cv::Vec3i nsamples;
- std::tie(tmp, nsamples) = trans_calib.get_estimate();
+ auto [tmp, nsamples] = trans_calib.get_estimate();
s.t_MH_x = int(tmp[0]);
s.t_MH_y = int(tmp[1]);
s.t_MH_z = int(tmp[2]);
diff --git a/tracker-pt/module/frame.cpp b/tracker-pt/module/frame.cpp
index e403af07..f54c2e36 100644
--- a/tracker-pt/module/frame.cpp
+++ b/tracker-pt/module/frame.cpp
@@ -57,9 +57,7 @@ QImage Preview::get_bitmap()
void Preview::draw_head_center(double x, double y)
{
- double px_, py_;
-
- std::tie(px_, py_) = to_pixel_pos(x, y, frame_copy.cols, frame_copy.rows);
+ auto [px_, py_] = to_pixel_pos(x, y, frame_copy.cols, frame_copy.rows);
int px = iround(px_), py = iround(py_);
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp
index 7bb2fb22..52a1c44d 100644
--- a/tracker-steamvr/steamvr.cpp
+++ b/tracker-steamvr/steamvr.cpp
@@ -34,8 +34,7 @@ template<typename F>
auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), vr_error_t()))
{
QMutexLocker l(&device_list::mtx);
- vr_error_t e; vr_t v;
- std::tie(v, e) = device_list::vr_init();
+ auto [v, e] = device_list::vr_init();
return fun(v, e);
}
@@ -228,8 +227,7 @@ void steamvr::data(double* data)
{
if (device_index != -1)
{
- pose_t pose; bool ok;
- std::tie(ok, pose) = device_list::get_pose(device_index);
+ auto [ok, pose] = device_list::get_pose(device_index);
if (ok)
{
constexpr int c = 10;
diff --git a/tracker-wii/wii_frame.cpp b/tracker-wii/wii_frame.cpp
index 9332a704..92e7fd35 100644
--- a/tracker-wii/wii_frame.cpp
+++ b/tracker-wii/wii_frame.cpp
@@ -76,9 +76,7 @@ QImage WIIPreview::get_bitmap()
void WIIPreview::draw_head_center(double x, double y)
{
- double px_, py_;
-
- std::tie(px_, py_) = to_pixel_pos(x, y, frame_copy.cols, frame_copy.rows);
+ auto [px_, py_] = to_pixel_pos(x, y, frame_copy.cols, frame_copy.rows);
int px = iround(px_), py = iround(py_);