From da861257794f0777ecb78d5abec81ecfb26425b0 Mon Sep 17 00:00:00 2001
From: Hauke Moenck <hauke_moenck@gmx.de>
Date: Fri, 19 Oct 2018 17:37:38 +0200
Subject: [PATCH] fixed staticMetaObject creation

---
 Src/CMakeLists.txt                            |  3 +-
 Src/Interfaces/API.h                          |  9 +++++
 Src/Interfaces/IBioTrackerContext.h           |  4 +--
 Src/Interfaces/IBioTrackerPlugin.h            |  3 +-
 Src/Interfaces/IController/IController.h      |  4 +--
 Src/Interfaces/IModel/IModel.h                |  4 +--
 Src/Interfaces/IModel/IModelAreaDescriptor.h  | 36 +++++++++----------
 Src/Interfaces/IModel/IModelDataExporter.h    | 10 +++---
 .../IModel/IModelTrackedComponent.h           | 16 ++++-----
 .../IModel/IModelTrackedComponentFactory.h    |  2 +-
 .../IModel/IModelTrackedTrajectory.h          |  2 +-
 .../IModel/IModelTrackingAlgorithm.h          |  2 +-
 Src/Interfaces/IModel/IObject.h               |  2 +-
 Src/Interfaces/IModel/Serializable.h          |  3 +-
 Src/Interfaces/IView/IView.h                  |  4 +--
 .../IView/IViewGraphicsPixmapItem.h           |  2 +-
 Src/Interfaces/IView/IViewGraphicsScene.h     |  2 +-
 Src/Interfaces/IView/IViewGraphicsView.h      |  2 +-
 Src/Interfaces/IView/IViewMainWindow.h        |  2 +-
 Src/Interfaces/IView/IViewOpenGLWidget.h      |  2 +-
 Src/Interfaces/IView/IViewTrackedComponent.h  |  2 +-
 Src/Interfaces/IView/IViewWidget.h            |  2 +-
 22 files changed, 65 insertions(+), 53 deletions(-)
 create mode 100644 Src/Interfaces/API.h

diff --git a/Src/CMakeLists.txt b/Src/CMakeLists.txt
index b0570a3..df3aecf 100644
--- a/Src/CMakeLists.txt
+++ b/Src/CMakeLists.txt
@@ -21,7 +21,7 @@ set_target_properties(${TN} PROPERTIES
     CXX_EXTENSIONS NO
 )
 
-target_compile_definitions(${TN} PRIVATE RF_INTERFACES_EXPORT)
+target_compile_definitions(${TN} PRIVATE BT_INTERFACES_EXPORT)
 
 target_sources(${TN}
 PRIVATE
@@ -48,6 +48,7 @@ PRIVATE
 )
 
 set(${TN}_PUBLIC_HEADERS
+    "${CMAKE_CURRENT_LIST_DIR}/Interfaces/API.h"
     "${CMAKE_CURRENT_LIST_DIR}/Interfaces/ENUMS.h"
     "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IBioTrackerContext.h"
     "${CMAKE_CURRENT_LIST_DIR}/Interfaces/IBioTrackerPlugin.h"
diff --git a/Src/Interfaces/API.h b/Src/Interfaces/API.h
new file mode 100644
index 0000000..1ed37d7
--- /dev/null
+++ b/Src/Interfaces/API.h
@@ -0,0 +1,9 @@
+#pragma once
+
+#include <QtCore/qglobal.h>
+
+#if defined(BT_INTERFACES_EXPORT)
+    #define BT_INTERFACES_API Q_DECL_EXPORT
+#else
+    #define BT_INTERFACES_API Q_DECL_IMPORT
+#endif
\ No newline at end of file
diff --git a/Src/Interfaces/IBioTrackerContext.h b/Src/Interfaces/IBioTrackerContext.h
index c1ca688..8c3f247 100644
--- a/Src/Interfaces/IBioTrackerContext.h
+++ b/Src/Interfaces/IBioTrackerContext.h
@@ -5,10 +5,10 @@
 #include "QMap"
 #include "QString"
 #include "Interfaces/ENUMS.h"
-
+#include <Interfaces/API.h>
 
 class IController;
-class IBioTrackerContext : public QObject
+class BT_INTERFACES_API IBioTrackerContext : public QObject
 {
     Q_OBJECT
 public:
diff --git a/Src/Interfaces/IBioTrackerPlugin.h b/Src/Interfaces/IBioTrackerPlugin.h
index 115eb82..10ad35a 100644
--- a/Src/Interfaces/IBioTrackerPlugin.h
+++ b/Src/Interfaces/IBioTrackerPlugin.h
@@ -9,8 +9,9 @@
 #include "Interfaces/IModel/IModelTrackedComponentFactory.h"
 #include "opencv2/core/core.hpp"
 #include "memory"
+#include <Interfaces/API.h>
 
-class IBioTrackerPlugin : public QObject
+class BT_INTERFACES_API IBioTrackerPlugin : public QObject
 {
     Q_OBJECT
 public:
diff --git a/Src/Interfaces/IController/IController.h b/Src/Interfaces/IController/IController.h
index 616c224..e557ae3 100644
--- a/Src/Interfaces/IController/IController.h
+++ b/Src/Interfaces/IController/IController.h
@@ -10,9 +10,9 @@
 #include "Interfaces/IModel/IModel.h"
 #include "Interfaces/IBioTrackerContext.h"
 #include "Interfaces/ENUMS.h"
+#include <Interfaces/API.h>
 
-
-class IController : public QObject {
+class BT_INTERFACES_API IController : public QObject {
     Q_OBJECT
   public:
     explicit IController(QObject *parent = 0, IBioTrackerContext *context = 0, ENUMS::CONTROLLERTYPE ctr = ENUMS::CONTROLLERTYPE::NO_CTR);
diff --git a/Src/Interfaces/IModel/IModel.h b/Src/Interfaces/IModel/IModel.h
index 171e473..82b36cb 100644
--- a/Src/Interfaces/IModel/IModel.h
+++ b/Src/Interfaces/IModel/IModel.h
@@ -4,8 +4,8 @@
 #include <QObject>
 
 #include "memory"
-
-class IModel : public QObject {
+#include <Interfaces/API.h>
+class BT_INTERFACES_API IModel : public QObject {
     Q_OBJECT
   public:
     explicit IModel(QObject *parent = 0);
diff --git a/Src/Interfaces/IModel/IModelAreaDescriptor.h b/Src/Interfaces/IModel/IModelAreaDescriptor.h
index 4f3efb4..011668f 100644
--- a/Src/Interfaces/IModel/IModelAreaDescriptor.h
+++ b/Src/Interfaces/IModel/IModelAreaDescriptor.h
@@ -4,30 +4,30 @@
 #include <string.h>
 #include <cv.h>
 
-class IModelAreaDescriptor :public IModel
+class BT_INTERFACES_API IModelAreaDescriptor :public IModel
 {
 	Q_OBJECT
 
 public:
 	IModelAreaDescriptor(QObject *parent = 0) : IModel(parent) {};
 	//~IModelAreaDescriptor();
-	
-public:
-
-	virtual bool inTrackingArea(cv::Point2f point_cm) = 0;
-
-	/**
-	* Transform the provided pixel coordinates into world coordinates and return world coordinates.
-	* @param: pixelCoords, a list of points.
-	* @return: world coordinates in as a list.
-	*/
-	virtual cv::Point2f pxToCm(cv::Point point_px) = 0;
-
-	/**
-	* Transform the provided pixel point into world coordinates and return world point.
-	* @param: point, a pixel point, used opencv point
-	* @return: world point.
-	*/
+	
+public:
+
+	virtual bool inTrackingArea(cv::Point2f point_cm) = 0;
+
+	/**
+	* Transform the provided pixel coordinates into world coordinates and return world coordinates.
+	* @param: pixelCoords, a list of points.
+	* @return: world coordinates in as a list.
+	*/
+	virtual cv::Point2f pxToCm(cv::Point point_px) = 0;
+
+	/**
+	* Transform the provided pixel point into world coordinates and return world point.
+	* @param: point, a pixel point, used opencv point
+	* @return: world point.
+	*/
 	virtual cv::Point2f cmToPx(cv::Point2f point_cm) = 0;
 public:
 
diff --git a/Src/Interfaces/IModel/IModelDataExporter.h b/Src/Interfaces/IModel/IModelDataExporter.h
index c33168f..4d4f7ac 100644
--- a/Src/Interfaces/IModel/IModelDataExporter.h
+++ b/Src/Interfaces/IModel/IModelDataExporter.h
@@ -5,12 +5,12 @@
 #include "Interfaces/IModel/IModelTrackedComponent.h"
 #include <string.h>
 #include <qfileinfo.h>
-/**
-* Interface for the data exporters in the core app
-* Besides serializing to files also includes deserializing from files
-* Current exporters are CSV, generic and JSON.
+/**
+* Interface for the data exporters in the core app
+* Besides serializing to files also includes deserializing from files
+* Current exporters are CSV, generic and JSON.
 */
-class IModelDataExporter :public IModel
+class BT_INTERFACES_API IModelDataExporter :public IModel
 {
 	Q_OBJECT
 
diff --git a/Src/Interfaces/IModel/IModelTrackedComponent.h b/Src/Interfaces/IModel/IModelTrackedComponent.h
index cc47f9d..db2943b 100644
--- a/Src/Interfaces/IModel/IModelTrackedComponent.h
+++ b/Src/Interfaces/IModel/IModelTrackedComponent.h
@@ -23,7 +23,7 @@
 *	Blank component
 */
 
-class IModelTrackedComponent : public IModel
+class BT_INTERFACES_API IModelTrackedComponent : public IModel
 {
 	Q_OBJECT
 	/*
@@ -85,7 +85,7 @@ QDataStream &operator>>(QDataStream &in, IModelTrackedComponent &painting);
 * and the width and height (in px and _coordinateUnit)
 *******************************************************************************/
 
-class IModelComponentEuclidian2D : public IModelTrackedComponent {
+class BT_INTERFACES_API IModelComponentEuclidian2D : public IModelTrackedComponent {
 public:
 	Q_OBJECT
 	/*
@@ -172,7 +172,7 @@ protected:
 * It expands it from 2D to 3D.
 * Reserved for future 3D tracking.
 *******************************************************************************/
-class IModelComponentEuclidian3D : public IModelComponentEuclidian2D {
+class BT_INTERFACES_API IModelComponentEuclidian3D : public IModelComponentEuclidian2D {
 public:
 	Q_OBJECT
 	/*
@@ -224,7 +224,7 @@ protected:
 * This class is derived from IModelComponentEuclidian2D.
 * It expands it to 2D with timestamps.
 *******************************************************************************/
-class IModelComponentTemporal2D : public IModelComponentEuclidian2D {
+class BT_INTERFACES_API IModelComponentTemporal2D : public IModelComponentEuclidian2D {
 public:
     Q_OBJECT 
 	/*
@@ -263,7 +263,7 @@ protected:
 * A circular point will be visualized with the radius of min(width,height)
 * The position is the center of the point.
 *******************************************************************************/
-class IModelTrackedPoint : public IModelComponentTemporal2D
+class BT_INTERFACES_API IModelTrackedPoint : public IModelComponentTemporal2D
 {
 	Q_OBJECT
 
@@ -282,7 +282,7 @@ public:
 * An irregular polygon defined by a list of polygons will be visualized.
 *******************************************************************************/
 
-class IModelTrackedPolygon : public IModelComponentTemporal2D
+class BT_INTERFACES_API IModelTrackedPolygon : public IModelComponentTemporal2D
 {
 	Q_OBJECT
 
@@ -311,7 +311,7 @@ protected:
 * This interface can be visualized in the core application if the tracking data implements it.
 * An ellipse will be visualized.  The position is the center of the ellipse.
 *******************************************************************************/
-class IModelTrackedEllipse : public IModelTrackedPoint
+class BT_INTERFACES_API IModelTrackedEllipse : public IModelTrackedPoint
 {
 	Q_OBJECT
 
@@ -330,7 +330,7 @@ public:
 * This interface can be visualized in the core application if the tracking data implements it.
 * A rectangle will be visualized. The position is the center of the rectangle.
 *******************************************************************************/
-class IModelTrackedRectangle : public IModelTrackedPoint
+class BT_INTERFACES_API IModelTrackedRectangle : public IModelTrackedPoint
 {
 	Q_OBJECT
 	
diff --git a/Src/Interfaces/IModel/IModelTrackedComponentFactory.h b/Src/Interfaces/IModel/IModelTrackedComponentFactory.h
index 4fe0b21..eab7362 100644
--- a/Src/Interfaces/IModel/IModelTrackedComponentFactory.h
+++ b/Src/Interfaces/IModel/IModelTrackedComponentFactory.h
@@ -4,7 +4,7 @@
 #include "Interfaces/IModel/IModel.h"
 #include "Interfaces/IModel/IModelTrackedComponent.h"
 
-class IModelTrackedComponentFactory : public IModel
+class BT_INTERFACES_API IModelTrackedComponentFactory : public IModel
 {
     Q_OBJECT
 
diff --git a/Src/Interfaces/IModel/IModelTrackedTrajectory.h b/Src/Interfaces/IModel/IModelTrackedTrajectory.h
index b608972..7d791a9 100644
--- a/Src/Interfaces/IModel/IModelTrackedTrajectory.h
+++ b/Src/Interfaces/IModel/IModelTrackedTrajectory.h
@@ -12,7 +12,7 @@
  *
  * Its the Plugin Developers full responsibility to choos an internal data structure. This could be e.g. Map, List or Vector.
  */
-class IModelTrackedTrajectory : public IModelTrackedComponent
+class BT_INTERFACES_API IModelTrackedTrajectory : public IModelTrackedComponent
 {
     Q_OBJECT
     Q_PROPERTY(QList<IModelTrackedComponent*> childNodes READ getChildNodes() WRITE setChildNodes STORED hasChildNodes);
diff --git a/Src/Interfaces/IModel/IModelTrackingAlgorithm.h b/Src/Interfaces/IModel/IModelTrackingAlgorithm.h
index 722ffef..1841eb8 100644
--- a/Src/Interfaces/IModel/IModelTrackingAlgorithm.h
+++ b/Src/Interfaces/IModel/IModelTrackingAlgorithm.h
@@ -4,7 +4,7 @@
 #include "IModel.h"
 #include "opencv2/core/core.hpp"
 
-class IModelTrackingAlgorithm :public IModel {
+class BT_INTERFACES_API IModelTrackingAlgorithm :public IModel {
     Q_OBJECT
   public:
     IModelTrackingAlgorithm(QObject *parent = 0);
diff --git a/Src/Interfaces/IModel/IObject.h b/Src/Interfaces/IModel/IObject.h
index 715e389..0a7d9dc 100644
--- a/Src/Interfaces/IModel/IObject.h
+++ b/Src/Interfaces/IModel/IObject.h
@@ -5,7 +5,7 @@
 
 // #include "biotracker/util/platform.h"
 
-class IObject : public IModel {
+class BT_INTERFACES_API IObject : public IModel {
     Q_OBJECT
   public:
     IObject();
diff --git a/Src/Interfaces/IModel/Serializable.h b/Src/Interfaces/IModel/Serializable.h
index d7083b5..50f629a 100644
--- a/Src/Interfaces/IModel/Serializable.h
+++ b/Src/Interfaces/IModel/Serializable.h
@@ -4,8 +4,9 @@
 #include <qobject.h>
 #include <QList>
 #include <QObject>
+#include "IModel.h"
 
-class Serializable : public QObject
+class BT_INTERFACES_API Serializable : public IModel
 {
 	Q_OBJECT
 };
diff --git a/Src/Interfaces/IView/IView.h b/Src/Interfaces/IView/IView.h
index 554a7b3..5897b69 100644
--- a/Src/Interfaces/IView/IView.h
+++ b/Src/Interfaces/IView/IView.h
@@ -3,9 +3,9 @@
 
 #include "Interfaces/IModel/IModel.h"
 #include "Interfaces/ENUMS.h"
-
+#include <Interfaces/API.h>
 class IController;
-class IView {
+class BT_INTERFACES_API IView {
 
   public:
     IView(IController *controller = 0, IModel *model = 0);
diff --git a/Src/Interfaces/IView/IViewGraphicsPixmapItem.h b/Src/Interfaces/IView/IViewGraphicsPixmapItem.h
index 16cf08a..5302abc 100644
--- a/Src/Interfaces/IView/IViewGraphicsPixmapItem.h
+++ b/Src/Interfaces/IView/IViewGraphicsPixmapItem.h
@@ -5,7 +5,7 @@
 #include "QObject"
 #include "QGraphicsPixmapItem"
 
-class IViewGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public IView
+class BT_INTERFACES_API IViewGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public IView
 {
     Q_OBJECT
 public:
diff --git a/Src/Interfaces/IView/IViewGraphicsScene.h b/Src/Interfaces/IView/IViewGraphicsScene.h
index 6b2e0db..0ed22f4 100644
--- a/Src/Interfaces/IView/IViewGraphicsScene.h
+++ b/Src/Interfaces/IView/IViewGraphicsScene.h
@@ -4,7 +4,7 @@
 #include "QGraphicsScene"
 #include "IView.h"
 
-class IViewGraphicsScene : public QGraphicsScene, public IView
+class BT_INTERFACES_API IViewGraphicsScene : public QGraphicsScene, public IView
 {
     Q_OBJECT
 public:
diff --git a/Src/Interfaces/IView/IViewGraphicsView.h b/Src/Interfaces/IView/IViewGraphicsView.h
index 486288d..05be9e5 100644
--- a/Src/Interfaces/IView/IViewGraphicsView.h
+++ b/Src/Interfaces/IView/IViewGraphicsView.h
@@ -4,7 +4,7 @@
 #include "QGraphicsView"
 #include "IView.h"
 
-class IViewGraphicsView : public QGraphicsView, public IView
+class BT_INTERFACES_API IViewGraphicsView : public QGraphicsView, public IView
 {
     Q_OBJECT
 public:
diff --git a/Src/Interfaces/IView/IViewMainWindow.h b/Src/Interfaces/IView/IViewMainWindow.h
index e61939e..8c0fdb5 100644
--- a/Src/Interfaces/IView/IViewMainWindow.h
+++ b/Src/Interfaces/IView/IViewMainWindow.h
@@ -4,7 +4,7 @@
 #include <QMainWindow>
 #include "Interfaces/IView/IView.h"
 
-class IViewMainWindow : public QMainWindow, public IView {
+class BT_INTERFACES_API IViewMainWindow : public QMainWindow, public IView {
   public:
     IViewMainWindow(QWidget *parent = 0, IController *controller = 0, IModel *model = 0);
     ~IViewMainWindow();
diff --git a/Src/Interfaces/IView/IViewOpenGLWidget.h b/Src/Interfaces/IView/IViewOpenGLWidget.h
index e3a23b4..f2f66f5 100644
--- a/Src/Interfaces/IView/IViewOpenGLWidget.h
+++ b/Src/Interfaces/IView/IViewOpenGLWidget.h
@@ -7,7 +7,7 @@
 #include <QOpenGLFunctions>
 
 
-class IViewOpenGLWidget: public QOpenGLWidget, protected QOpenGLFunctions, public IView {
+class BT_INTERFACES_API IViewOpenGLWidget: public QOpenGLWidget, protected QOpenGLFunctions, public IView {
   public:
     IViewOpenGLWidget(QWidget *parent = 0, IController *controller = 0, IModel *model = 0);
     ~IViewOpenGLWidget();
diff --git a/Src/Interfaces/IView/IViewTrackedComponent.h b/Src/Interfaces/IView/IViewTrackedComponent.h
index d2cc6df..ff7e0da 100644
--- a/Src/Interfaces/IView/IViewTrackedComponent.h
+++ b/Src/Interfaces/IView/IViewTrackedComponent.h
@@ -10,7 +10,7 @@
  * A IViewTrackedComponent has a QGraphicsItem.
  */
 
-class IViewTrackedComponent : public QGraphicsObject, public IView
+class BT_INTERFACES_API IViewTrackedComponent : public QGraphicsObject, public IView
 {
     Q_OBJECT
 public:
diff --git a/Src/Interfaces/IView/IViewWidget.h b/Src/Interfaces/IView/IViewWidget.h
index 375ffd4..fc97f05 100644
--- a/Src/Interfaces/IView/IViewWidget.h
+++ b/Src/Interfaces/IView/IViewWidget.h
@@ -4,7 +4,7 @@
 #include <QWidget>
 #include "Interfaces/IView/IView.h"
 
-class IViewWidget : public QWidget, public IView {
+class BT_INTERFACES_API IViewWidget : public QWidget, public IView {
     Q_OBJECT
   public:
     explicit IViewWidget(QWidget *parent = 0, IController *controller = 0, IModel *model = 0);
-- 
GitLab