From 364e6ea9212a1b20a11bdd94bf895035c3ed60a3 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Wed, 4 Dec 2019 20:45:26 +0200
Subject: [PATCH] Add new reconstruction class

---
 applications/reconstruct/src/main.cpp         |  5 +++-
 .../reconstruct/src/reconstruction.hpp        | 27 +++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 applications/reconstruct/src/reconstruction.hpp

diff --git a/applications/reconstruct/src/main.cpp b/applications/reconstruct/src/main.cpp
index ddb17e42c..26d2e6e42 100644
--- a/applications/reconstruct/src/main.cpp
+++ b/applications/reconstruct/src/main.cpp
@@ -314,6 +314,7 @@ static void run(ftl::Configurable *root) {
 			fileout.open(std::string(timestamp) + ".ftl");
 
 			writer.begin();
+			// TODO: Add to all grounds / reconstructions
 			groups[0]->addRawCallback(std::function(recorder));
 
 			// TODO: Write pose+calibration+config packets
@@ -324,6 +325,7 @@ static void run(ftl::Configurable *root) {
 				sources[i]->inject(sources[i]->getPose()); 
 			}
 		} else {
+			// FIXME: Remove doesn't work, so multiple records fail.
 			groups[0]->removeRawCallback(recorder);
 			writer.end();
 			fileout.close();
@@ -365,6 +367,7 @@ static void run(ftl::Configurable *root) {
 			//if (slave.isPaused()) return true;
 			if (controls->value("paused", false)) return true;
 			
+			// TODO: busy needs to be an array now.
 			if (busy) {
 				LOG(INFO) << "Group frameset dropped: " << fs.timestamp;
 				return true;
@@ -382,7 +385,7 @@ static void run(ftl::Configurable *root) {
 				UNIQUE_LOCK(scene_A[i].mtx, lk);
 
 				pipeline1->apply(scene_A[i], scene_A[i], 0);
-				align->process(scene_A[i]);
+				//align->process(scene_A[i]);
 
 
 				// TODO: To use second GPU, could do a download, swap, device change,
diff --git a/applications/reconstruct/src/reconstruction.hpp b/applications/reconstruct/src/reconstruction.hpp
new file mode 100644
index 000000000..bde040007
--- /dev/null
+++ b/applications/reconstruct/src/reconstruction.hpp
@@ -0,0 +1,27 @@
+#ifndef _FTL_RECONSTRUCTION_HPP_
+#define _FTL_RECONSTRUCTION_HPP_
+
+namespace ftl {
+
+class Reconstruction : public ftl::Configurable {
+	public:
+	Reconstruction();
+	~Reconstruction();
+
+	void addSource(ftl::rgbd::Source *);
+
+	/**
+	 * Do the render for a specified virtual camera.
+	 */
+	void render(ftl::rgbd::VirtualSource *vs, ftl::rgbd::Frame &out);
+
+	private:
+	ftl::rgbd::Group *group_;
+	ftl::rgbd::FrameSet fs_;
+	ftl::operators::Graph *pipeline_;
+	ftl::render::Triangular *renderer_;
+};
+
+}
+
+#endif  // _FTL_RECONSTRUCTION_HPP_
-- 
GitLab