Browse Source

Add emf track point class

Johannes Kreutz 2 years ago
parent
commit
805b3c801d

+ 1 - 0
trackpoint-app/CMakeLists.txt

@@ -67,6 +67,7 @@ QT_ADD_EXECUTABLE(TrackpointApp
   src/PickHandler.cpp
   src/TrackPoint.cpp
   src/OptiTrackPoint.cpp
+  src/EMFTrackPoint.cpp
   src/ActionPoint.cpp
   src/SteamVRTrackPoint.cpp
   src/OpenScadRenderer.cpp

+ 21 - 0
trackpoint-app/include/EMFTrackPoint.hpp

@@ -0,0 +1,21 @@
+#pragma once
+
+// Include modules
+#include "defaults.hpp"
+#include "TrackPoint.hpp"
+#include "TrackSystemSettingsStructs.hpp"
+
+class EMFTrackPoint: public TrackPoint {
+public:
+  EMFTrackPoint(const osg::Vec3 point, const osg::Vec3 normal, const osg::Vec3 normalModifier, const double width = EMFTRACK_DEFAULT_WIDTH, const double height = EMFTRACK_DEFAULT_HEIGHT, const double depth = EMFTRACK_DEFAULT_DEPTH);
+  double getWidth();
+  double getHeight();
+  double getDepth();
+  EMFTrackSettings getEMFTrackSettings();
+  void updateEMFTrackSettings(EMFTrackSettings settings);
+
+private:
+  double _width;
+  double _height;
+  double _depth;
+};

+ 4 - 0
trackpoint-app/include/defaults.hpp

@@ -5,6 +5,10 @@
 #define OPTITRACK_DEFAULT_LENGTH 10.0
 #define OPTITRACK_DEFAULT_RADIUS 1.0
 
+#define EMFTRACK_DEFAULT_WIDTH 50.0
+#define EMFTRACK_DEFAULT_HEIGHT 10.0
+#define EMFTRACK_DEFAULT_DEPTH 50.0
+
 #define STEAMVR_DEFAULT_LENGTH 10.0
 #define STEAMVR_CONSTANT_RADIUS 3.5
 // The length of the thread used to attach the steamvr tracker

+ 30 - 0
trackpoint-app/src/EMFTrackPoint.cpp

@@ -0,0 +1,30 @@
+// Include own headers
+#include "EMFTrackPoint.hpp"
+
+EMFTrackPoint::EMFTrackPoint(const osg::Vec3 point, const osg::Vec3 normal, const osg::Vec3 normalModifier, const double width, const double height, const double depth): TrackPoint(point, normal, normalModifier) {
+  _width = width;
+  _height = height;
+  _depth = depth;
+}
+
+double EMFTrackPoint::getWidth() {
+  return _width;
+}
+
+double EMFTrackPoint::getHeight() {
+  return _height;
+}
+
+double EMFTrackPoint::getDepth() {
+  return _depth;
+}
+
+EMFTrackSettings EMFTrackPoint::getEMFTrackSettings() {
+  return EMFTrackSettings {_width, _height, _depth};
+}
+
+void EMFTrackPoint::updateEMFTrackSettings(EMFTrackSettings settings) {
+  _width = settings.width;
+  _height = settings.height;
+  _depth = settings.depth;
+}