Bladeren bron

Add renderer class

Johannes Kreutz 3 jaren geleden
bovenliggende
commit
578b586de9

+ 1 - 0
trackpoint-app/CMakeLists.txt

@@ -69,6 +69,7 @@ QT_ADD_EXECUTABLE(TrackpointApp
   src/OptiTrackPoint.cpp
   src/OpenScadRenderer.cpp
   src/StringBasics.cpp
+  src/TrackPointRenderer.cpp
 )
 
 if(NOT BUILD_STATIC_RELEASE)

+ 3 - 0
trackpoint-app/include/OSGWidget.hpp

@@ -1,5 +1,8 @@
 #pragma once
 
+// Include modules
+#include "TrackPointRenderer.hpp"
+
 // Include dependencies
 #include <QPoint>
 #include <QOpenGLWidget>

+ 17 - 0
trackpoint-app/include/TrackPointRenderer.hpp

@@ -0,0 +1,17 @@
+#pragma once
+
+// Include modules
+#include "enums.hpp"
+
+// Include dependencies
+#include <osg/Group>
+
+class TrackPointRenderer {
+public:
+  TrackPointRenderer(osg::ref_ptr<osg::Group> renderRoot);
+  ~TrackPointRenderer();
+  void render(ActiveTrackingSystem activeTrackingSystem);
+
+private:
+  osg::ref_ptr<osg::Group> _renderRoot;
+};

+ 0 - 1
trackpoint-app/src/ProjectStore.cpp

@@ -15,7 +15,6 @@ ProjectStore::ProjectStore() {
 }
 
 ProjectStore::~ProjectStore() {
-
 }
 
 void ProjectStore::loadMesh(std::string meshFile) {

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

@@ -0,0 +1,30 @@
+// Include own header
+#include "TrackPointRenderer.hpp"
+
+// Include modules
+
+
+// Include dependencies
+
+
+TrackPointRenderer::TrackPointRenderer(osg::ref_ptr<osg::Group> renderRoot) {
+  _renderRoot = renderRoot;
+}
+
+TrackPointRenderer::~TrackPointRenderer() {
+}
+
+void TrackPointRenderer::render(ActiveTrackingSystem activeTrackingSystem) {
+  switch(activeTrackingSystem) {
+    case OptiTrack: {
+      std::vector<OptiTrackPoint*> points = MainWindow::getInstance()->getStore()->getOptiTrackPoints();
+      break;
+    }
+    case EMFTrack: {
+      break;
+    }
+    case SteamVRTrack: {
+      break;
+    }
+  }
+}