diff --git a/screenshot.cpp b/screenshot.cpp index ceddb26c..ec503b2d 100644 --- a/screenshot.cpp +++ b/screenshot.cpp @@ -1081,6 +1081,8 @@ EX void menu() { dialog::add_action([] { centering = eCentering::edge; fullcenter(); }); dialog::addBoolItem(XLAT("vertex"), centering == eCentering::vertex, 'V'); dialog::add_action([] { centering = eCentering::vertex; fullcenter(); }); + dialog::addItem(XLAT("exhaustive list of viewpoints"), 'L'); + dialog::add_action(generate_viewpoints); }; }); } @@ -1116,6 +1118,73 @@ EX void menu() { dialog::display(); } +EX vector viewpoints; + +EX set ids_seen; + +EX size_t get_id(cell *c) { + if(is_highly_symmetric(geometry)) return shvid(c); + if(closed_manifold) return (size_t) c; + return shvid(c); + } + +EX int num_directions(cell *c) { + vector nid; + for(int i=0; itype; i++) nid.push_back(get_id(c->cmove(i))); + for(int a=1; atype; a++) { + bool ok = true; + for(int b=a; btype; b++) if(nid[b] != nid[b-a]) ok = false; + if(ok) return a; + } + return c->type; + } + +int viewpoint_id; + +EX void generate_viewpoints() { + vector vqueue; + viewpoints.clear(); + vqueue.clear(); + ids_seen.clear(); + auto enqueue = [&] (cellwalker cw) { + auto id = get_id(cw.at); + println(hlog, cw, " has id ", int(id)); + if(ids_seen.count(id)) return; + ids_seen.insert(id); + vqueue.push_back(cw); + }; + enqueue(cwt); + for(int i=0; i