diff -r 4787d05e9c89 -r e17e07661f4c src/polygoncache.cpp --- a/src/polygoncache.cpp Sat Jul 23 01:38:06 2022 +0300 +++ b/src/polygoncache.cpp Sat Jul 23 01:38:43 2022 +0300 @@ -4,7 +4,7 @@ #include "src/polygoncache.h" #include "src/parser.h" -Model* resolve(const QString& name, const ModelId callingModelId, DocumentManager* documents) +QTextDocument* resolve(const QString& name, const ModelId callingModelId, DocumentManager* documents) { return documents->findDependencyByName(callingModelId, name); } @@ -19,7 +19,7 @@ return element; } -PolygonCache* findPolygonCacheForModel(Model* model, DocumentManager* context) +PolygonCache* findPolygonCacheForModel(QTextDocument* model, DocumentManager* context) { std::optional modelId = context->findIdForModel(model); if (modelId.has_value()) { @@ -74,7 +74,7 @@ } } -static Model* findDependency(const SubfileReference& ref, GetPolygonsContext* context) +static QTextDocument* findDependency(const SubfileReference& ref, GetPolygonsContext* context) { return context->documents->findDependencyByName(context->modelId, ref.name); } @@ -118,7 +118,7 @@ add({line5.value, line5.value.color}); }, [&add, context, &reserve](const LineType1& line1) { - Model* const dependency = findDependency(line1.value, context); + QTextDocument* const dependency = findDependency(line1.value, context); if (PolygonCache* cache = (dependency != nullptr) ? findPolygonCacheForModel(dependency, context->documents) : nullptr @@ -144,7 +144,7 @@ } static std::vector> inlinePolygons( - const Model* model, + const QTextDocument* model, GetPolygonsContext* context) { Winding winding = NoWinding; @@ -169,7 +169,7 @@ return result; } -void recacheIfNeeded(PolygonCache *cache, Model *model, DocumentManager *documents) +void recacheIfNeeded(PolygonCache *cache, QTextDocument *model, DocumentManager *documents) { if (cache->needRecache) {