src/polygoncache.h

Wed, 15 Jun 2022 13:05:53 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Wed, 15 Jun 2022 13:05:53 +0300
changeset 230
a1f3f7d9078b
parent 211
b27b90fb993f
child 264
76a025db4948
permissions
-rw-r--r--

rename LibraryManager -> LibrariesModel

#pragma once
#include "basics.h"
#include "model.h"
#include "gl/common.h"

template<typename T>
struct WithId : T
{
	ModelId id;
};

struct GetPolygonsContext
{
	ModelId modelId;
	class DocumentManager* documents;
};

struct PolygonCache
{
	using vector_type = std::vector<WithId<PolygonElement>>;
	vector_type cachedPolygons;
	bool needRecache = true;
};

const PolygonCache::vector_type* getCachedPolygons(
	PolygonCache* cache,
	Model* model,
	class DocumentManager* documents);
PolygonCache* findPolygonCacheForModel(Model* model, DocumentManager* context);

mercurial