arb:: comment displayed in geom-exp

This commit is contained in:
Zeno Rogue 2019-12-27 02:07:44 +01:00
parent 5940851f59
commit 3afae980fd
2 changed files with 15 additions and 1 deletions

View File

@ -28,6 +28,7 @@ struct arbi_tiling {
vector<shape> shapes; vector<shape> shapes;
string name; string name;
string comment;
geometryinfo1& get_geometry(); geometryinfo1& get_geometry();
eGeometryClass get_class() { return get_geometry().kind; } eGeometryClass get_class() { return get_geometry().kind; }
@ -77,6 +78,7 @@ void load(const string& fname) {
auto& c = current; auto& c = current;
c.shapes.clear(); c.shapes.clear();
c.name = unnamed; c.name = unnamed;
c.comment = "";
exp_parser ep; exp_parser ep;
ep.s = s; ep.s = s;
ld angleunit = 1, distunit = 1, angleofs = 0; ld angleunit = 1, distunit = 1, angleofs = 0;
@ -84,10 +86,17 @@ void load(const string& fname) {
ep.skip_white(); ep.skip_white();
if(ep.next() == 0) break; if(ep.next() == 0) break;
if(ep.eat("#")) { if(ep.eat("#")) {
bool doubled = ep.eat("#");
while(ep.eat(" ")) ; while(ep.eat(" ")) ;
string s = ""; string s = "";
while(ep.next() >= 32) s += ep.next(), ep.at++; while(ep.next() >= 32) s += ep.next(), ep.at++;
if(c.name == unnamed) c.name = s; if(doubled) {
if(c.name == unnamed) c.name = s;
else {
c.comment += s;
c.comment += "\n";
}
}
} }
else if(ep.eat("e2.")) { else if(ep.eat("e2.")) {
ginf[gArbitrary].g = giEuclid2; ginf[gArbitrary].g = giEuclid2;

View File

@ -803,6 +803,11 @@ EX void showEuclideanMenu() {
dialog::addTitle(XLAT("info about: %1", fgname), 0xFFFFFF, 150); dialog::addTitle(XLAT("info about: %1", fgname), 0xFFFFFF, 150);
if(WDIM == 2 && !arb::in() && !kite::in()) dialog::addSelItem(XLAT("faces per vertex"), spf, 0); if(WDIM == 2 && !arb::in() && !kite::in()) dialog::addSelItem(XLAT("faces per vertex"), spf, 0);
if(arb::in() && arb::current.comment != "") {
dialog::addBreak(100);
dialog::addHelp(arb::current.comment);
}
dialog::addSelItem(XLAT("size of the world"), dialog::addSelItem(XLAT("size of the world"),
#if CAP_BT #if CAP_BT