diff -r e1ced2523cad -r b6cbba6e29a1 src/documentmanager.h --- a/src/documentmanager.h Tue Nov 02 15:43:57 2021 +0200 +++ b/src/documentmanager.h Thu Mar 03 11:42:52 2022 +0200 @@ -19,6 +19,7 @@ #pragma once #include "libraries.h" #include "model.h" +#include "polygoncache.h" class DocumentManager : public QObject { @@ -55,10 +56,12 @@ QTextStream &errorStream); bool saveModel(const ModelId modelId, QTextStream& errors); std::optional findIdForModel(const Model* model) const; + PolygonCache* getPolygonCacheForModel(ModelId modelId); private: struct ModelInfo { std::unique_ptr model; + ModelId id; QString path; OpenType opentype; std::map dependencies = {}; @@ -67,11 +70,13 @@ int modelIdCounter = 0; int untitledNameCounter = 0; std::map openModels; + std::map polygonCaches; void loadDependenciesForModel(const ModelId modelId, const QString& path, LoadDepedenciesBag& bag); void collectReferences(QSet &referenced, const QString& name, const Model* model); void updateDependencies(ModelInfo* model); void prune(); bool isReferencedByAnything(const ModelId modelId) const; + void makePolygonCacheForModel(const ModelId modelId); }; QString pathToName(const QFileInfo& path);