src/polygoncache.h

Wed, 09 Mar 2022 13:01:50 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 09 Mar 2022 13:01:50 +0200
changeset 173
8a3047468994
parent 150
b6cbba6e29a1
child 183
97b591813c8b
permissions
-rw-r--r--

Fix performance issues in Model::find

#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