src/polygoncache.h

changeset 210
232e7634cc8a
parent 206
654661eab7f3
child 211
b27b90fb993f
equal deleted inserted replaced
209:c93e4a1eaadb 210:232e7634cc8a
1 #pragma once 1 #pragma once
2 #include "basics.h" 2 #include "basics.h"
3 #include "model.h" 3 #include "model.h"
4 #include "gl/common.h" 4 #include "gl/common.h"
5
6 template<typename T>
7 struct WithId : T
8 {
9 ModelId id;
10 };
5 11
6 struct GetPolygonsContext 12 struct GetPolygonsContext
7 { 13 {
8 ModelId modelId; 14 ModelId modelId;
9 class DocumentManager* documents; 15 class DocumentManager* documents;
10 }; 16 };
11 17
12 struct PolygonCache 18 struct PolygonCache
13 { 19 {
14 std::vector<gl::Polygon> cachedPolygons; 20 std::vector<WithId<PolygonElement>> cachedPolygons;
15 bool needRecache = true; 21 bool needRecache = true;
16 }; 22 };
17 23
18 const std::vector<gl::Polygon>& getCachedPolygons( 24 const std::vector<WithId<PolygonElement>>& getCachedPolygons(
19 PolygonCache* cache, 25 PolygonCache* cache,
20 Model* model, 26 Model* model,
21 class DocumentManager* documents); 27 class DocumentManager* documents);

mercurial