From 0985b4406dce208fc2e8aa7d54ef1b040c60f240 Mon Sep 17 00:00:00 2001 From: TheNumbat Date: Thu, 15 Oct 2020 12:28:31 -0400 Subject: [PATCH] give < op by default --- src/student/meshedit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/student/meshedit.cpp b/src/student/meshedit.cpp index 66e0e13..76e09b8 100644 --- a/src/student/meshedit.cpp +++ b/src/student/meshedit.cpp @@ -460,6 +460,16 @@ struct Edge_Record { float cost; }; +/* Comparison operator for Edge_Records so std::set will properly order them */ +bool operator<(const Edge_Record &r1, const Edge_Record &r2) { + if (r1.cost != r2.cost) { + return r1.cost < r2.cost; + } + Halfedge_Mesh::EdgeRef e1 = r1.edge; + Halfedge_Mesh::EdgeRef e2 = r2.edge; + return &*e1 < &*e2; +} + /** Helper type for quadric simplification * * A PQueue is a minimum-priority queue that -- GitLab