src/polygoncache.cpp

changeset 338
719b909a7d2b
parent 333
07e65a4c6611
child 358
ef90ed0a5720
--- a/src/polygoncache.cpp	Wed Jul 20 21:35:55 2022 +0300
+++ b/src/polygoncache.cpp	Wed Jul 20 21:48:46 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> 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<WithId<PolygonElement>> 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)
 	{

mercurial