src/polygoncache.h

Wed, 08 Jun 2022 23:14:55 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 08 Jun 2022 23:14:55 +0300
changeset 208
930928b760a2
parent 206
654661eab7f3
child 210
232e7634cc8a
permissions
-rw-r--r--

Add model icons back into the list view

150
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
206
654661eab7f3 More refactor, merged main.h, basics.h and utility.h into one header file basics.h and removed plenty of unused code
Teemu Piippo <teemu@hecknology.net>
parents: 200
diff changeset
2 #include "basics.h"
150
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 #include "model.h"
200
ca23936b455b Giant refactor
Teemu Piippo <teemu@hecknology.net>
parents: 193
diff changeset
4 #include "gl/common.h"
ca23936b455b Giant refactor
Teemu Piippo <teemu@hecknology.net>
parents: 193
diff changeset
5
ca23936b455b Giant refactor
Teemu Piippo <teemu@hecknology.net>
parents: 193
diff changeset
6 struct GetPolygonsContext
ca23936b455b Giant refactor
Teemu Piippo <teemu@hecknology.net>
parents: 193
diff changeset
7 {
ca23936b455b Giant refactor
Teemu Piippo <teemu@hecknology.net>
parents: 193
diff changeset
8 ModelId modelId;
ca23936b455b Giant refactor
Teemu Piippo <teemu@hecknology.net>
parents: 193
diff changeset
9 class DocumentManager* documents;
ca23936b455b Giant refactor
Teemu Piippo <teemu@hecknology.net>
parents: 193
diff changeset
10 };
150
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11
193
b4beff48bb7a Simplify PolygonCache
Teemu Piippo <teemu@hecknology.net>
parents: 183
diff changeset
12 struct PolygonCache
150
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 {
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 std::vector<gl::Polygon> cachedPolygons;
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 bool needRecache = true;
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 };
193
b4beff48bb7a Simplify PolygonCache
Teemu Piippo <teemu@hecknology.net>
parents: 183
diff changeset
17
b4beff48bb7a Simplify PolygonCache
Teemu Piippo <teemu@hecknology.net>
parents: 183
diff changeset
18 const std::vector<gl::Polygon>& getCachedPolygons(
b4beff48bb7a Simplify PolygonCache
Teemu Piippo <teemu@hecknology.net>
parents: 183
diff changeset
19 PolygonCache* cache,
b4beff48bb7a Simplify PolygonCache
Teemu Piippo <teemu@hecknology.net>
parents: 183
diff changeset
20 Model* model,
b4beff48bb7a Simplify PolygonCache
Teemu Piippo <teemu@hecknology.net>
parents: 183
diff changeset
21 class DocumentManager* documents);

mercurial