--- a/src/vertexmap.cpp Mon Apr 10 14:46:36 2023 +0300 +++ b/src/vertexmap.cpp Tue Apr 11 11:11:28 2023 +0300 @@ -22,51 +22,50 @@ const glm::vec3& b; }; -inline void edges(const ModelElement& element, std::function<void(Edge&&)> fn) +static void edges(const PlainPolygonElement& element, std::function<void(Edge&&)> fn) { std::visit<void>(overloaded{ - [fn](const Colored<LineSegment>& edge) { + [fn](const LineSegment& edge) { fn(Edge{edge.p1, edge.p2}); }, - [fn](const Colored<Triangle>& triangle) { + [fn](const Triangle& triangle) { fn(Edge{triangle.p1, triangle.p2}); fn(Edge{triangle.p2, triangle.p3}); fn(Edge{triangle.p3, triangle.p1}); }, - [fn](const Colored<Quadrilateral>& quad) { + [fn](const Quadrilateral& quad) { fn(Edge{quad.p1, quad.p2}); fn(Edge{quad.p2, quad.p3}); fn(Edge{quad.p3, quad.p4}); fn(Edge{quad.p4, quad.p1}); }, - [fn](const Colored<ConditionalEdge>& cedge) { + [fn](const ConditionalEdge& cedge) { fn(Edge{cedge.p1, cedge.p2}); }, - [](const ModelElement&&){} }, element); } inline void points( - const ModelElement& element, + const PlainPolygonElement& element, std::function<void(const glm::vec3&)> fn) { std::visit<void>(overloaded{ - [fn](const Colored<LineSegment>& edge) { + [fn](const LineSegment& edge) { fn(edge.p1); fn(edge.p2); }, - [fn](const Colored<Triangle>& triangle) { + [fn](const Triangle& triangle) { fn(triangle.p1); fn(triangle.p2); fn(triangle.p3); }, - [fn](const Colored<Quadrilateral>& quad) { + [fn](const Quadrilateral& quad) { fn(quad.p1); fn(quad.p2); fn(quad.p3); fn(quad.p4); }, - [fn](const Colored<ConditionalEdge>& cedge) { + [fn](const ConditionalEdge& cedge) { fn(cedge.p1); fn(cedge.p2); fn(cedge.c1);