arb:: selectable in geom-exp

This commit is contained in:
Zeno Rogue 2019-12-27 02:08:04 +01:00
parent 3afae980fd
commit ce2d8d3d29
3 changed files with 26 additions and 5 deletions

View File

@ -365,5 +365,25 @@ auto hook = addHook(hooks_args, 100, readArgs);
EX bool in() { return geometry == gArbitrary; }
EX string tes = "tessellations/marjorie-rice.tes";
EX void choose() {
dialog::openFileDialog(tes, XLAT("open a tiling"), ".tes",
[] () {
stop_game();
set_geometry(gArbitrary);
try {
load(tes);
ginf[gArbitrary].tiling_name = current.name;
}
catch(hr_parse_exception& ex) {
println(hlog, "failed: ", ex.s);
set_geometry(gNormal);
}
start_game();
return true;
});
}
EX }
}

View File

@ -886,7 +886,7 @@ EX vector<geometryinfo> ginf = {
{"{3,4,4}","none", "{3,4,4} hyperbolic honeycomb", "344", 8, 4, qIDEAL, giHyperb3, 0x50000, {{7, 2}}, eVariation::pure},
{"{3,4,4}","Crystal", "4D crystal in H3", "Cryst3" , 8, 4, qIDEAL | qANYQ | qCRYSTAL, giHyperb3, 0x52000, {{7, 3}}, eVariation::pure},
{"cat", "cat", "Arnold's cat mapping torus", "cat", 12, 3, qBINARY | qSOL | qsBQ | qOPTQ, giSolNIH, 0x52200, {{6, 4}}, eVariation::pure},
{"arb", "none", "arbitrary", "arb", 7, 3, qEXPERIMENTAL, giEuclid2, 0, {{7, 5}}, eVariation::pure},
{"file", "none", "load from file", "file", 7, 3, qEXPERIMENTAL, giEuclid2, 0, {{7, 5}}, eVariation::pure},
{"{4,oo}", "none", "{4,∞} (infinite squares)", "oox4", 4, 100, qIDEAL, giHyperb2, 0x49400, {{5, 5}}, eVariation::pure},
};
// bits: 9, 10, 15, 16, (reserved for later) 17, 18

View File

@ -226,9 +226,9 @@ EX geometry_filter *current_filter;
bool forced_quotient() { return quotient && !(cgflags & qOPTQ); }
EX geometry_filter gf_hyperbolic = {"hyperbolic", [] { return (arcm::in() || hyperbolic) && !forced_quotient(); }};
EX geometry_filter gf_spherical = {"spherical", [] { return (arcm::in() || sphere) && !forced_quotient(); }};
EX geometry_filter gf_euclidean = {"Euclidean", [] { return (arcm::in() || euclid) && !forced_quotient(); }};
EX geometry_filter gf_hyperbolic = {"hyperbolic", [] { return (arcm::in() || arb::in() || hyperbolic) && !forced_quotient(); }};
EX geometry_filter gf_spherical = {"spherical", [] { return (arcm::in() || arb::in() || sphere) && !forced_quotient(); }};
EX geometry_filter gf_euclidean = {"Euclidean", [] { return (arcm::in() || arb::in() || euclid) && !forced_quotient(); }};
EX geometry_filter gf_other = {"non-isotropic", [] { return prod || nonisotropic; }};
EX geometry_filter gf_regular_2d = {"regular 2D tesselations", [] {
return standard_tiling() && WDIM == 2 && !forced_quotient();
@ -277,6 +277,8 @@ void set_or_configure_geometry(eGeometry g) {
else if(g == gArchimedean)
pushScreen(arcm::show);
#endif
else if(g == gArbitrary)
arb::choose();
else {
if(among(g, gProduct, gRotSpace)) {
if(WDIM == 3 || (g == gRotSpace && euclid)) {
@ -348,7 +350,6 @@ void ge_select_tiling() {
bool on = geometry == g;
bool in_2d = WDIM == 2;
dynamicval<eGeometry> cg(geometry, g);
if(g == gArbitrary) continue;
if(g == gTorus) continue;
if(arcm::in() && !CAP_ARCM) continue;
if(cryst && !CAP_CRYSTAL) continue;