src/polygoncache.h

changeset 150
b6cbba6e29a1
child 183
97b591813c8b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polygoncache.h	Thu Mar 03 11:42:52 2022 +0200
@@ -0,0 +1,19 @@
+#pragma once
+#include "main.h"
+#include "model.h"
+
+class PolygonCache : QObject
+{
+	Q_OBJECT
+public:
+	PolygonCache(Model* model);
+	std::vector<gl::Polygon> getPolygons(class DocumentManager* documents);
+private:
+	void getObjectPolygons(
+		const int index,
+		std::vector<gl::Polygon>& polygons_out,
+		ldraw::GetPolygonsContext* context) const;
+	Model* const model;
+	std::vector<gl::Polygon> cachedPolygons;
+	bool needRecache = true;
+};

mercurial