src/polygoncache.h

changeset 210
232e7634cc8a
parent 206
654661eab7f3
child 211
b27b90fb993f
--- a/src/polygoncache.h	Thu Jun 09 11:51:42 2022 +0300
+++ b/src/polygoncache.h	Thu Jun 09 13:32:55 2022 +0300
@@ -3,6 +3,12 @@
 #include "model.h"
 #include "gl/common.h"
 
+template<typename T>
+struct WithId : T
+{
+	ModelId id;
+};
+
 struct GetPolygonsContext
 {
 	ModelId modelId;
@@ -11,11 +17,11 @@
 
 struct PolygonCache
 {
-	std::vector<gl::Polygon> cachedPolygons;
+	std::vector<WithId<PolygonElement>> cachedPolygons;
 	bool needRecache = true;
 };
 
-const std::vector<gl::Polygon>& getCachedPolygons(
+const std::vector<WithId<PolygonElement>>& getCachedPolygons(
 	PolygonCache* cache,
 	Model* model,
 	class DocumentManager* documents);

mercurial