From a88ede59cf0368d4b74bfd858802a3bb5331be37 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 24 Nov 2019 23:39:45 +0100 Subject: [PATCH] archimedean:: filtering by geometry --- archimedean.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/archimedean.cpp b/archimedean.cpp index de06784a..031e2b1c 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -1199,11 +1199,21 @@ EX void show() { } #endif if(!valid) continue; + if(current_filter == &gf_hyperbolic && ps.get_geometry().kind != gcHyperbolic) continue; + if(current_filter == &gf_spherical && ps.get_geometry().kind != gcSphere) continue; + if(current_filter == &gf_euclidean && ps.get_geometry().kind != gcEuclid) continue; dialog::addSelItem(ps.symbol, fts(ps.euclidean_angle_sum * 180) + "°" + suffix, 'a' + shown); dialog::lastItem().color = ps.coloring; dialog::add_action([&] () { enable(ps); }); shown++; } + dialog::addSelItem(XLAT("current filter"), current_filter ? XLAT(current_filter->name) : XLAT("none"), 'x'); + dialog::add_action([] { + if(current_filter == &gf_hyperbolic) current_filter = &gf_euclidean; + else if(current_filter == &gf_euclidean) current_filter = &gf_spherical; + else if(current_filter == &gf_spherical) current_filter = nullptr; + else current_filter = &gf_hyperbolic; + }); dialog::addItem(XLAT("next page"), '-'); if(shown == 0) nextpos = 0; dialog::add_action([nextpos] () {