diff --git a/arbitrile.cpp b/arbitrile.cpp index 739d54bc..27f11cf2 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -801,6 +801,10 @@ struct hrmap_arbi : hrmap { transmatrix adj(cell *c, int dir) override { return adj(c->master, dir); } ld spin_angle(cell *c, int d) override { return SPIN_NOT_AVAILABLE; } + + int shvid(cell *c) override { + return id_of(c->master); + } }; EX hrmap *new_map() { return new hrmap_arbi; } diff --git a/archimedean.cpp b/archimedean.cpp index a1a9dc27..02038556 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -780,6 +780,13 @@ struct hrmap_archimedean : hrmap { } else hrmap::find_cell_connection(c, d); } + + int shvid(cell *c) override { + auto& ac = arcm::current; + int id = arcm::id_of(c->master); + if(ac.regular && id>=2 && id < 2*ac.N) id &= 1; + return id; + } }; EX hrmap *new_map() { return new hrmap_archimedean; } diff --git a/binary-tiling.cpp b/binary-tiling.cpp index 2ffcc73e..ffd8e878 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -431,6 +431,15 @@ EX namespace bt { } } + int shvid(cell *c) override { + if(geometry == gBinaryTiling) + return c->type-6; + else if(geometry == gBinary4 || geometry == gTernary) + return c->master->zebraval; + else + return 0; + } + int updir_at(heptagon *h) { if(geometry != gBinaryTiling) return updir(); else if(type_of(h) == 6) return bd_down; diff --git a/cell.cpp b/cell.cpp index 52bd889f..38904865 100644 --- a/cell.cpp +++ b/cell.cpp @@ -61,6 +61,7 @@ struct hrmap { virtual double spacedist(cell *c, int i) { return hdist0(tC0(adj(c, i))); } virtual void find_cell_connection(cell *c, int d); + virtual int shvid(cell *c) { return 0; } }; /** hrmaps which are based on regular non-Euclidean 2D tilings, possibly quotient @@ -78,6 +79,7 @@ struct hrmap_standard : hrmap { ld spin_angle(cell *c, int d) override; double spacedist(cell *c, int i) override; void find_cell_connection(cell *c, int d) override; + virtual int shvid(cell *c); }; void clearfrom(heptagon*); @@ -216,9 +218,6 @@ void hrmap_standard::find_cell_connection(cell *c, int d) { } hybrid::link(); } - else if(INVERSE) { - gp::inverse_move(c, d); - } #endif else if(PURE) { hrmap::find_cell_connection(c, d); diff --git a/floorshapes.cpp b/floorshapes.cpp index b60b8a28..939516f3 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -848,7 +848,7 @@ EX namespace gp { cgi.extra_vertices(); } - int get_plainshape_id(cell *c) { + EX int get_plainshape_id(cell *c) { int siid, sidir; cell *c1 = c; auto f = [&] { @@ -924,36 +924,18 @@ EX void set_floor(const transmatrix& spin, hpcshape& sh) { } EX int shvid(cell *c) { - if(hybri) { - cell *c1 = hybrid::get_where(c).first; - return PIU( shvid(c1) ); - } - else if(GOLDBERG_INV) + return currentmap->shvid(c); + } + +int hrmap_standard::shvid(cell *c) { + if(GOLDBERG) return gp::get_plainshape_id(c); #if CAP_IRR else if(IRREGULAR) return irr::cellindex[c]; #endif - #if CAP_ARCM - else if(arcm::in()) { - auto& ac = arcm::current; - int id = arcm::id_of(c->master); - if(ac.regular && id>=2 && id < 2*ac.N) id &= 1; - return id; - } - #endif - else if(arb::in()) - return arb::id_of(c->master); else if(geosupport_football() == 2) return pseudohept(c); - #if CAP_BT - else if(geometry == gBinaryTiling) - return c->type-6; - else if(kite::in()) - return kite::getshape(c->master); - else if(geometry == gBinary4 || geometry == gTernary) - return c->master->zebraval; - #endif else if(inforder::mixed()) { int t = c->type; static vector computed; diff --git a/goldberg.cpp b/goldberg.cpp index c9f6a9b7..24445e35 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -1273,6 +1273,13 @@ EX namespace gp { } } + void find_cell_connection(cell *c, int d) override { + inverse_move(c, d); + } + + int shvid(cell *c) override { + return gp::get_plainshape_id(c); + } }; EX hrmap* new_inverse() { return new hrmap_inverse; } diff --git a/kite.cpp b/kite.cpp index 74dd2b18..f9beefac 100644 --- a/kite.cpp +++ b/kite.cpp @@ -152,6 +152,10 @@ struct hrmap_kite : hrmap { kite::find_cell_connection(c, d); } + int shvid(cell *c) override { + return kite::getshape(c->master); + } + heptagon *newtile(pshape s, int dist) { heptagon *h = tailored_alloc (8); h->s = hstate(s); diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 088597fd..20873db1 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1275,6 +1275,11 @@ EX namespace hybrid { void find_cell_connection(cell *c, int d) override { hybrid::find_cell_connection(c, d); } + + int shvid(cell *c) override { + cell *c1 = hybrid::get_where(c).first; + return PIU( shvid(c1) ); + } virtual transmatrix spin_to(cell *c, int d, ld bonus) override { if(d >= c->type-2) return Id; c = get_where(c).first; return in_underlying([&] { return currentmap->spin_to(c, d, bonus); }); } virtual transmatrix spin_from(cell *c, int d, ld bonus) override { if(d >= c->type-2) return Id; c = get_where(c).first; return in_underlying([&] { return currentmap->spin_from(c, d, bonus); }); }