summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/module.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-11 19:03:10 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-11 19:03:10 +0100
commitfbd961775001228f6ffd9cc3bf09aa2de610aeae (patch)
treeb54c35357ea0ec0fbf2d78d14a17bcf4047c9488 /tracker-pt/module.cpp
parent71374d0b5cd456e25252775fdec89fe3cf2aa5e6 (diff)
tracker/pt: allow for reuse
Issue: #718 This allows for replacing the camera and point extractor code. See `module.cpp' and `pt-api.hpp`.
Diffstat (limited to 'tracker-pt/module.cpp')
-rw-r--r--tracker-pt/module.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/tracker-pt/module.cpp b/tracker-pt/module.cpp
new file mode 100644
index 00000000..0d96c351
--- /dev/null
+++ b/tracker-pt/module.cpp
@@ -0,0 +1,50 @@
+#include "ftnoir_tracker_pt.h"
+#include "api/plugin-api.hpp"
+
+#include "camera.h"
+#include "point_extractor.h"
+#include "ftnoir_tracker_pt_dialog.h"
+
+#include "pt-api.hpp"
+
+#include <memory>
+
+static const QString module_name = "tracker-pt";
+
+struct pt_module_traits final : pt_runtime_traits
+{
+ std::unique_ptr<pt_camera> make_camera() const override
+ {
+ return std::unique_ptr<pt_camera>(new Camera);
+ }
+
+ std::unique_ptr<pt_point_extractor> make_point_extractor() const override
+ {
+ return std::unique_ptr<pt_point_extractor>(new PointExtractor(module_name));
+ }
+
+ QString get_module_name() const override
+ {
+ return module_name;
+ }
+};
+
+struct pt_tracker_module : Tracker_PT
+{
+ pt_tracker_module() : Tracker_PT(pt_module_traits())
+ {
+ }
+};
+
+struct pt_tracker_dialog_module : TrackerDialog_PT
+{
+ pt_tracker_dialog_module() : TrackerDialog_PT(module_name) {}
+};
+
+class pt_module_metadata : public Metadata
+{
+ QString name() { return _("PointTracker 1.1"); }
+ QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); }
+};
+
+OPENTRACK_DECLARE_TRACKER(pt_tracker_module, pt_tracker_dialog_module, pt_module_metadata)