Deterministic names for polygons.
This commit is contained in:
1 parent
95d8d8a42d
commit
d2f21c4b36
1 file changed
+10
-3
@@ -317,7 +317,7 @@ clusterize(std::vector<PolyInstrument> const &universe) {
|
||||
}
|
||||
}
|
||||
|
||||
// Add edges
|
||||
// Add edges
|
||||
while (g.size()) {
|
||||
LOG(Spartan, Info, "Graph has {} nodes", g.size());
|
||||
auto connected = g.shortest_path(g.begin()->first);
|
||||
@@ -341,7 +341,14 @@ std::string polygon_descriptor(Polygon const &p,
|
||||
};
|
||||
|
||||
std::ostringstream str;
|
||||
for (auto const &part : p.parts) {
|
||||
auto sorted_parts = p.parts;
|
||||
std::sort(sorted_parts.begin(), sorted_parts.end(),
|
||||
[&](auto const &p1, auto const &p2) {
|
||||
return get_sec(p1.sec_id).symbol() <
|
||||
get_sec(p2.sec_id).symbol();
|
||||
});
|
||||
|
||||
for (auto const &part : sorted_parts) {
|
||||
auto const &sec = get_sec(part.sec_id);
|
||||
|
||||
if (part.ratio > 0)
|
||||
@@ -359,7 +366,7 @@ std::string polygon_descriptor(Polygon const &p,
|
||||
str << " ";
|
||||
}
|
||||
auto result = str.str();
|
||||
result.resize(result.size()-1);
|
||||
result.resize(result.size() - 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user