src/polygoncache.h

Wed, 09 Mar 2022 14:22:22 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 09 Mar 2022 14:22:22 +0200
changeset 177
f69d53c053df
parent 150
b6cbba6e29a1
child 183
97b591813c8b
permissions
-rw-r--r--

Show type of object in the object editor

150
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 #include "main.h"
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 #include "model.h"
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 class PolygonCache : QObject
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 {
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 Q_OBJECT
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 public:
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 PolygonCache(Model* model);
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 std::vector<gl::Polygon> getPolygons(class DocumentManager* documents);
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 private:
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 void getObjectPolygons(
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 const int index,
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 std::vector<gl::Polygon>& polygons_out,
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 ldraw::GetPolygonsContext* context) const;
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 Model* const model;
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 std::vector<gl::Polygon> cachedPolygons;
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 bool needRecache = true;
b6cbba6e29a1 extract polygon cache out of Model
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 };

mercurial