summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-20 13:25:33 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-20 13:25:33 +0200
commit0c1b4510b3f7a744cc4cad94e0d4dde45925269d (patch)
tree3fe5d5a56ee4d611c4876059ab7c1eeb8f68f5a4 /ftnoir_tracker_pt
parentfa58baa2bb84fe51a6b835c72a92a7a9050cbf73 (diff)
cleanup #ifdefs
We're the only maintainer of the PT tracker now, so don't clutter the file so much.
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r--ftnoir_tracker_pt/camera.cpp17
-rw-r--r--ftnoir_tracker_pt/camera.h15
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.h12
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp17
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h6
-rw-r--r--ftnoir_tracker_pt/point_tracker.cpp6
6 files changed, 8 insertions, 65 deletions
diff --git a/ftnoir_tracker_pt/camera.cpp b/ftnoir_tracker_pt/camera.cpp
index 7c4af38f..2989c1fe 100644
--- a/ftnoir_tracker_pt/camera.cpp
+++ b/ftnoir_tracker_pt/camera.cpp
@@ -12,23 +12,6 @@
using namespace cv;
-#ifdef OPENTRACK_API
-#else
-// ----------------------------------------------------------------------------
-void get_camera_device_names(std::vector<std::string>& device_names)
-{
- videoInput VI;
- VI.listDevices();
- std::string device_name;
- for(int index = 0; ; ++index) {
- device_name = VI.getDeviceName(index);
- if (device_name.empty()) break;
- device_names.push_back(device_name);
- }
-}
-#endif
-
-// ----------------------------------------------------------------------------
void Camera::set_device_index(int index)
{
if (desired_index != index)
diff --git a/ftnoir_tracker_pt/camera.h b/ftnoir_tracker_pt/camera.h
index 5451ec09..343446ac 100644
--- a/ftnoir_tracker_pt/camera.h
+++ b/ftnoir_tracker_pt/camera.h
@@ -8,21 +8,10 @@
#pragma once
#include <opencv2/core/core.hpp>
-#ifndef OPENTRACK_API
-# include <boost/shared_ptr.hpp>
-#else
-# include <memory>
-# include <opencv2/highgui/highgui.hpp>
-# include <opencv2/highgui/highgui_c.h>
-#endif
+#include <memory>
+#include <opencv2/highgui.hpp>
#include <string>
-#ifndef OPENTRACK_API
-// ----------------------------------------------------------------------------
-void get_camera_device_names(std::vector<std::string>& device_names);
-#endif
-
-// ----------------------------------------------------------------------------
struct CamInfo
{
CamInfo() : res_x(0), res_y(0), fps(0) {}
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
index aeda7dd7..97aa54aa 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
@@ -8,9 +8,7 @@
#ifndef FTNOIR_TRACKER_PT_H
#define FTNOIR_TRACKER_PT_H
-#ifdef OPENTRACK_API
-# include "opentrack/plugin-api.hpp"
-#endif
+#include "opentrack/plugin-api.hpp"
#include "ftnoir_tracker_pt_settings.h"
#include "camera.h"
#include "point_extractor.h"
@@ -24,11 +22,7 @@
#include <QMutexLocker>
#include <QTime>
#include <atomic>
-#ifndef OPENTRACK_API
-# include <boost/shared_ptr.hpp>
-#else
-# include <memory>
-#endif
+#include <memory>
#include <vector>
class TrackerDialog_PT;
@@ -48,7 +42,7 @@ public:
Affine pose() { QMutexLocker lock(&mutex); return point_tracker.pose(); }
int get_n_points() { QMutexLocker lock(&mutex); return point_extractor.get_points().size(); }
- void get_cam_info(CamInfo* info) { QMutexLocker lock(&mutex); *info = camera.get_info(); }
+ void get_cam_info(CamInfo* info) { QMutexLocker lock(&camera_mtx); *info = camera.get_info(); }
public slots:
void apply_settings();
protected:
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp
index 40262893..9fdab441 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp
@@ -10,12 +10,8 @@
#include <QMessageBox>
#include <QDebug>
#include <opencv2/core/core.hpp>
-#ifndef OPENTRACK_API
-# include <boost/shared_ptr.hpp>
-#else
-# include <memory>
-# include "opentrack/camera-names.hpp"
-#endif
+#include <memory>
+#include "opentrack/camera-names.hpp"
#include <vector>
using namespace std;
@@ -28,16 +24,7 @@ TrackerDialog_PT::TrackerDialog_PT()
{
ui.setupUi( this );
-#ifdef OPENTRACK_API
ui.camdevice_combo->addItems(get_camera_names());
-#else
- vector<string> device_names;
- get_camera_device_names(device_names);
- for (vector<string>::iterator iter = device_names.begin(); iter != device_names.end(); ++iter)
- {
- ui.camdevice_combo->addItem(iter->c_str());
- }
-#endif
tie_setting(s.camera_name, ui.camdevice_combo);
tie_setting(s.cam_res_x, ui.res_x_spin);
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h
index 7e75d2a4..3502e227 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h
@@ -8,11 +8,7 @@
#ifndef FTNOIR_TRACKER_PT_DIALOG_H
#define FTNOIR_TRACKER_PT_DIALOG_H
-#ifdef OPENTRACK_API
-# include "opentrack/plugin-api.hpp"
-#else
-#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h"
-#endif
+#include "opentrack/plugin-api.hpp"
#include "ftnoir_tracker_pt_settings.h"
#include "ftnoir_tracker_pt.h"
#include "trans_calib.h"
diff --git a/ftnoir_tracker_pt/point_tracker.cpp b/ftnoir_tracker_pt/point_tracker.cpp
index bae89dbe..f141fe36 100644
--- a/ftnoir_tracker_pt/point_tracker.cpp
+++ b/ftnoir_tracker_pt/point_tracker.cpp
@@ -33,12 +33,10 @@ static void set_row(Matx33f& m, int i, const Vec3f& v)
m(i,2) = v[2];
}
-#ifdef OPENTRACK_API
static bool d_vals_sort(const pair<float,int> a, const pair<float,int> b)
{
return a.first < b.first;
}
-#endif
void PointModel::get_d_order(const std::vector<cv::Vec2f>& points, int d_order[], cv::Vec2f d) const
{
@@ -50,11 +48,7 @@ void PointModel::get_d_order(const std::vector<cv::Vec2f>& points, int d_order[]
std::sort(d_vals.begin(),
d_vals.end(),
-#ifdef OPENTRACK_API
d_vals_sort
-#else
- comp
-#endif
);
for (unsigned i = 0; i<points.size(); ++i)