src/polygoncache.cpp

changeset 232
8efa3a33172e
parent 211
b27b90fb993f
child 250
2837b549e616
equal deleted inserted replaced
231:a9bf6bab5ea2 232:8efa3a33172e
1 #include "polygoncache.h" 1 #include "polygoncache.h"
2 #include "documentmanager.h" 2 #include "documentmanager.h"
3 #include "invert.h" 3 #include "invert.h"
4 #include "circularprimitive.h"
4 5
5 Model* resolve(const QString& name, const ModelId callingModelId, DocumentManager* documents) 6 Model* resolve(const QString& name, const ModelId callingModelId, DocumentManager* documents)
6 { 7 {
7 return documents->findDependencyByName(callingModelId, name); 8 return documents->findDependencyByName(callingModelId, name);
8 } 9 }
74 polygon.id = id; 75 polygon.id = id;
75 result.push_back(polygon); 76 result.push_back(polygon);
76 } 77 }
77 } 78 }
78 }, 79 },
80 [&result, id](const Colored<CircularPrimitive>& circ) {
81 rasterize(circ, [&](const ModelElement& element){
82 std::visit<void>(overloaded{
83 // TODO: :-(
84 [&](const Colored<LineSegment>& edge) {
85 result.push_back({{edge, edge.color}, id});
86 },
87 [&](const Colored<Triangle>& triangle) {
88 result.push_back({{triangle, triangle.color}, id});
89 },
90 [&](const Colored<Quadrilateral>& quad) {
91 result.push_back({{quad, quad.color}, id});
92 },
93 [&](const Colored<ConditionalEdge>& cedge) {
94 result.push_back({{cedge, cedge.color}, id});
95 },
96 [&](const auto&){},
97 }, element);
98 });
99 },
79 [](const ModelElement&) {} 100 [](const ModelElement&) {}
80 }, element); 101 }, element);
81 } 102 }
82 return result; 103 return result;
83 } 104 }

mercurial