From a7a60c8f5328d8d1b6dbb2d73635ab64aa480d41 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 18 Jan 2018 09:40:23 +0100 Subject: tracker/pt: split impl and algorithm Issue: #718 --- tracker-pt/CMakeLists.txt | 5 +++- tracker-pt/export.hpp | 14 ++++++---- tracker-pt/module.cpp | 69 ----------------------------------------------- tracker-pt/module.cxx | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 75 deletions(-) delete mode 100644 tracker-pt/module.cpp create mode 100644 tracker-pt/module.cxx (limited to 'tracker-pt') diff --git a/tracker-pt/CMakeLists.txt b/tracker-pt/CMakeLists.txt index aa4c89f6..a02bdfe0 100644 --- a/tracker-pt/CMakeLists.txt +++ b/tracker-pt/CMakeLists.txt @@ -1,7 +1,10 @@ find_package(OpenCV 3.0 QUIET) if(OpenCV_FOUND) - otr_module(tracker-pt) + otr_module(tracker-pt-base STATIC) + target_include_directories(opentrack-tracker-pt-base SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS}) + set(modules opencv_core opencv_videoio opencv_imgproc) + otr_module(tracker-pt SOURCES module.cxx) target_link_libraries(opentrack-tracker-pt opentrack-cv ${modules}) target_include_directories(opentrack-tracker-pt SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS}) endif() diff --git a/tracker-pt/export.hpp b/tracker-pt/export.hpp index a733c9fe..cef63f83 100644 --- a/tracker-pt/export.hpp +++ b/tracker-pt/export.hpp @@ -2,10 +2,14 @@ #pragma once -#include "compat/linkage-macros.hpp" - -#ifdef BUILD_TRACKER_PT -# define OTR_PT_EXPORT OTR_GENERIC_EXPORT +#if 0 +# include "compat/linkage-macros.hpp" +# ifdef BUILD_TRACKER_PT +# define OTR_PT_EXPORT OTR_GENERIC_EXPORT +# else +# define OTR_PT_EXPORT OTR_GENERIC_IMPORT +# endif #else -# define OTR_PT_EXPORT OTR_GENERIC_IMPORT +// static link +# define OTR_PT_EXPORT #endif diff --git a/tracker-pt/module.cpp b/tracker-pt/module.cpp deleted file mode 100644 index 5c298ca5..00000000 --- a/tracker-pt/module.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "ftnoir_tracker_pt.h" -#include "api/plugin-api.hpp" - -#include "camera.h" -#include "frame.hpp" -#include "point_extractor.h" -#include "ftnoir_tracker_pt_dialog.h" - -#include "pt-api.hpp" - -#include - -static const QString module_name = "tracker-pt"; - -using namespace pt_module; - -struct pt_module_traits final : pt_runtime_traits -{ - pointer make_camera() const override - { - return pointer(new Camera(module_name)); - } - - pointer make_point_extractor() const override - { - return pointer(new PointExtractor(module_name)); - } - - QString get_module_name() const override - { - return module_name; - } - - pointer make_frame() const override - { - return pointer(new Frame); - } - - pointer make_preview(int w, int h) const override - { - return pointer(new Preview(w, h)); - } -}; - -struct tracker_pt : Tracker_PT -{ - tracker_pt() : Tracker_PT(pointer(new pt_module_traits)) - { - } -}; - -struct dialog_pt : TrackerDialog_PT -{ - dialog_pt(); -}; - -class metadata_pt : public Metadata -{ - QString name() { return _("PointTracker 1.1"); } - QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); } -}; - -// ns pt_module - -using namespace pt_module; - -dialog_pt::dialog_pt() : TrackerDialog_PT(module_name) {} - -OPENTRACK_DECLARE_TRACKER(tracker_pt, dialog_pt, metadata_pt) diff --git a/tracker-pt/module.cxx b/tracker-pt/module.cxx new file mode 100644 index 00000000..5c298ca5 --- /dev/null +++ b/tracker-pt/module.cxx @@ -0,0 +1,69 @@ +#include "ftnoir_tracker_pt.h" +#include "api/plugin-api.hpp" + +#include "camera.h" +#include "frame.hpp" +#include "point_extractor.h" +#include "ftnoir_tracker_pt_dialog.h" + +#include "pt-api.hpp" + +#include + +static const QString module_name = "tracker-pt"; + +using namespace pt_module; + +struct pt_module_traits final : pt_runtime_traits +{ + pointer make_camera() const override + { + return pointer(new Camera(module_name)); + } + + pointer make_point_extractor() const override + { + return pointer(new PointExtractor(module_name)); + } + + QString get_module_name() const override + { + return module_name; + } + + pointer make_frame() const override + { + return pointer(new Frame); + } + + pointer make_preview(int w, int h) const override + { + return pointer(new Preview(w, h)); + } +}; + +struct tracker_pt : Tracker_PT +{ + tracker_pt() : Tracker_PT(pointer(new pt_module_traits)) + { + } +}; + +struct dialog_pt : TrackerDialog_PT +{ + dialog_pt(); +}; + +class metadata_pt : public Metadata +{ + QString name() { return _("PointTracker 1.1"); } + QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); } +}; + +// ns pt_module + +using namespace pt_module; + +dialog_pt::dialog_pt() : TrackerDialog_PT(module_name) {} + +OPENTRACK_DECLARE_TRACKER(tracker_pt, dialog_pt, metadata_pt) -- cgit v1.2.3