The surroundings on a plot of their own; the stadium views fill the window

The surroundings no longer show the ground: their fourteen objects stand along
an avenue on their own plot. Both views use the whole width of the window; the
lists on the right are gone, the pointer names a part and its state, and the
card of a chosen part lies over the picture.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-15 08:44:54 +01:00
1 parent 6e3475493f
commit b2500eb7b6
4 files changed
+96 -79

No files matched your search

+11
View File
@@ -219,3 +219,14 @@ body.midnight .stadium-plan-total,body.matchday .stadium-plan-total {color:#d5dd
.stadium-row-pips .pip {width:30dp;height:30dp;border:3dp var(--rule);border-radius:6dp;}
.stadium-row-pips .pip.on {background-color:#9a7a3a;border-color:#9a7a3a;}
.stadium-row .stadium-row-pips {display:flex;}
/* --- The model fills the window; the pointer names a part, the card lies over the picture. --- */
.stadium-model,#stadium-model-art {width:2612dp;}
.stadium-model-hit {overflow:visible;}
.stadium-model-hit:hover {z-index:6;}
.stadium-tip {display:none;position:absolute;width:620dp;height:128dp;padding:14dp 24dp;border:3dp #3d362a;border-radius:10dp;background-color:#fffbf2;color:#3d362a;text-align:left;pointer-events:none;}
.stadium-model-hit:hover .stadium-tip {display:block;}
.stadium-tip strong {display:block;font-family:Display;font-size:38dp;line-height:46dp;white-space:nowrap;}
.stadium-tip span {display:block;font-size:30dp;line-height:40dp;white-space:nowrap;}
.stadium-card {top:166dp;width:800dp;height:auto;z-index:8;}
body.silver .stadium-card {background-color:#fffbf2f6;border-color:#3d362a;}
+54 -53
View File
@@ -94,7 +94,7 @@ inline Scene build(const Json &overview, const std::string &seats, bool paper, i
const auto building = [](const Json &row) { return row.value("building", false); };
// the plate everything stands on
// inside, the plate runs beyond the picture; around, it is the plot with its edge
const double px = mode == 1 ? 345 : 900, py = mode == 1 ? 268 : 900;
const double px = mode == 1 ? 262 : 900, py = mode == 1 ? 208 : 900;
scene.faces.push_back({{{-px, -py, 0}, {px, -py, 0}, {px, py, 0}, {-px, py, 0}}, plate, "", false, false, true, 3, 1, "", {}, -1000});
// the pitch: its colour tells the state of the turf (facility 4)
const auto &facilities = overview.value("facilities", Json::array());
@@ -230,8 +230,8 @@ inline Scene build(const Json &overview, const std::string &seats, bool paper, i
// The surroundings (mode 1): every object in its own shape and at its own place, drawn at
// its level. Level 0 is a dashed footprint, a level being built a dashed frame in gold.
if (mode == 1) {
// the ground itself is scenery here
for (auto &face : scene.faces) face.part.clear();
// the surroundings stand on a plot of their own, without the ground: only the plate stays
scene.faces.resize(1);
scene.centres.clear();
scene.anchors.clear();
const std::string asphalt = paper ? "#b9b2a4" : "#3c444c", brick = "#c9a58c", plaster = "#efe6cf", tile = "#a8574f", slate = paper ? "#6b747d" : "#20272e",
@@ -277,36 +277,36 @@ inline Scene build(const Json &overview, const std::string &seats, bool paper, i
if (!periphery.empty()) {
const std::string part = "periphery:0";
const int level = level_at(0);
if (level <= 0) planned(part, 0, -215, 600, 26, busy_at(0));
if (level <= 0) planned(part, 0, -160, 480, 26, busy_at(0));
else {
flat(part, 0, -215, 680, 24, asphalt);
stripe(-340, -215, 340, -215, white, true);
flat(part, 0, -165, 22, 76, asphalt); // the approach to the ground
flat(part, 0, -160, 524, 24, asphalt);
stripe(-262, -160, 262, -160, white, true);
flat(part, 0, -30, 22, 236, asphalt); // the avenue through the quarter
if (level >= 2) { // bus stop: shelter and two buses
box(scene, part, -70, -196, 30, 5, 7, glass);
box(scene, part, -120, -212, 26, 7, 8, "#d9b13b");
box(scene, part, 60, -219, 26, 7, 8, "#d9b13b");
box(scene, part, -70, -141, 30, 5, 7, glass);
box(scene, part, -120, -157, 26, 7, 8, "#d9b13b");
box(scene, part, 60, -164, 26, 7, 8, "#d9b13b");
}
if (level >= 3) { // tram: rails and a tram
stripe(-340, -238, 340, -238, slate);
stripe(-340, -242, 340, -242, slate);
box(scene, part, 150, -240, 44, 6, 8, "#c8553d");
box(scene, part, 110, -231, 60, 4, 1.5, plaster);
stripe(-262, -183, 262, -183, slate);
stripe(-262, -187, 262, -187, slate);
box(scene, part, 150, -185, 44, 6, 8, "#c8553d");
box(scene, part, 110, -176, 60, 4, 1.5, plaster);
}
if (level >= 4) { // station hall
gabled(part, -230, -238, 90, 30, 16, 10, brick, slate);
windows(part, -230, -238, 90, 30, 4, 12, 9);
gabled(part, -180, -186, 90, 30, 16, 10, brick, slate);
windows(part, -180, -186, 90, 30, 4, 12, 9);
}
if (busy_at(0)) planned(part, -230, -238, 96, 36, true);
if (busy_at(0)) planned(part, -180, -186, 96, 36, true);
}
centre(0, level >= 4 ? -230 : -70, -215, 6);
centre(0, level >= 4 ? -180 : -70, -160, 6);
}
// 4 parking: a lot per level, with bays and cars
if (periphery.size() > 4) {
const std::string part = "periphery:4";
const int level = level_at(4), most = std::max(1, periphery[4].value("max_level", 3));
for (int lot = 0; lot < most; ++lot) {
const double x = -262, y = 78 - lot * 78;
const double x = -192, y = 132 - lot * 72;
if (lot >= level) { planned(part, x, y, 110, 62, lot == level && busy_at(4)); continue; }
flat(part, x, y, 110, 62, asphalt);
for (int bay = 0; bay <= 10; ++bay) { stripe(x - 50 + bay * 10, y - 28, x - 50 + bay * 10, y - 10, white); stripe(x - 50 + bay * 10, y + 10, x - 50 + bay * 10, y + 28, white); }
@@ -315,62 +315,62 @@ inline Scene build(const Json &overview, const std::string &seats, bool paper, i
if ((bay * 5 + lot) % 3 != 0) car(part, x - 45 + bay * 10, y + 19, bay * 2 + lot);
}
}
centre(4, -262, 78, 4);
centre(4, -192, 132, 4);
}
// 2 shopping centre: two wings, a glass front, a roof terrace
if (periphery.size() > 2) {
const std::string part = "periphery:2";
if (level_at(2) <= 0) planned(part, 215, 195, 130, 70, busy_at(2));
if (level_at(2) <= 0) planned(part, 150, 130, 130, 70, busy_at(2));
else {
box(scene, part, 215, 205, 130, 44, 20, plaster);
box(scene, part, 170, 170, 40, 30, 14, brick);
windows(part, 215, 205, 130, 44, 3, 16, 13);
windows(part, 170, 170, 40, 30, 3, 10, 4);
box(scene, part, 245, 205, 30, 16, 5, glass, false, 20);
box(scene, part, 190, 205, 14, 10, 3, slate, false, 20);
for (double x : {232.0, 252.0, 272.0}) tree(x, 168);
box(scene, part, 150, 140, 130, 44, 20, plaster);
box(scene, part, 105, 105, 40, 30, 14, brick);
windows(part, 150, 140, 130, 44, 3, 16, 13);
windows(part, 105, 105, 40, 30, 3, 10, 4);
box(scene, part, 180, 140, 30, 16, 5, glass, false, 20);
box(scene, part, 125, 140, 14, 10, 3, slate, false, 20);
for (double x : {167.0, 187.0, 207.0}) tree(x, 103);
}
centre(2, 215, 195, 12);
centre(2, 150, 130, 12);
}
// 1 arcade: a hall with a sign
if (periphery.size() > 1) {
const std::string part = "periphery:1";
if (level_at(1) <= 0) planned(part, -205, 205, 84, 50, busy_at(1));
if (level_at(1) <= 0) planned(part, -72, 140, 84, 50, busy_at(1));
else {
box(scene, part, -205, 205, 84, 46, 15, "#b9a6c9");
windows(part, -205, 205, 84, 46, 2, 8, 6);
box(scene, part, -205, 184, 46, 3, 7, "#d9b13b", false, 15);
box(scene, part, -180, 215, 16, 16, 4, slate, false, 15);
box(scene, part, -72, 140, 84, 46, 15, "#b9a6c9");
windows(part, -72, 140, 84, 46, 2, 8, 6);
box(scene, part, -72, 119, 46, 3, 7, "#d9b13b", false, 15);
box(scene, part, -47, 150, 16, 16, 4, slate, false, 15);
}
centre(1, -205, 205, 9);
centre(1, -72, 140, 9);
}
// 3 club house: a pitched roof, a terrace, trees
if (periphery.size() > 3) {
const std::string part = "periphery:3";
if (level_at(3) <= 0) planned(part, 0, 215, 70, 44, busy_at(3));
if (level_at(3) <= 0) planned(part, 82, 40, 70, 44, busy_at(3));
else {
gabled(part, 0, 220, 66, 30, 11, 9, plaster, tile);
windows(part, 0, 220, 66, 30, 3, 8, 6);
flat(part, 0, 197, 66, 14, wood, -400);
for (double x : {-24.0, -8.0, 8.0, 24.0}) box(scene, part, x, 197, 5, 5, 2.4, white);
tree(-46, 214); tree(46, 214);
gabled(part, 82, 45, 66, 30, 11, 9, plaster, tile);
windows(part, 82, 45, 66, 30, 3, 8, 6);
flat(part, 82, 22, 66, 14, wood, -400);
for (double x : {58.0, 74.0, 90.0, 106.0}) box(scene, part, x, 22, 5, 5, 2.4, white);
tree(38, 39); tree(126, 39);
}
centre(3, 0, 215, 8);
centre(3, 82, 40, 8);
}
// 5 restaurant: a house with an awning and tables
if (periphery.size() > 5) {
const std::string part = "periphery:5";
if (level_at(5) <= 0) planned(part, 262, 70, 60, 44, busy_at(5));
if (level_at(5) <= 0) planned(part, 205, 40, 60, 44, busy_at(5));
else {
gabled(part, 262, 78, 56, 30, 12, 8, brick, slate);
windows(part, 262, 78, 56, 30, 3, 9, 5);
scene.faces.push_back({{{234, 63, 9}, {290, 63, 9}, {290, 52, 6}, {234, 52, 6}}, "#c8553d", part, false, false, false, 2, 1, "", {}, 5});
for (double x : {242.0, 256.0, 270.0, 284.0}) box(scene, part, x, 46, 5, 5, 2.4, white);
gabled(part, 205, 48, 56, 30, 12, 8, brick, slate);
windows(part, 205, 48, 56, 30, 3, 9, 5);
scene.faces.push_back({{{177, 33, 9}, {233, 33, 9}, {233, 22, 6}, {177, 22, 6}}, "#c8553d", part, false, false, false, 2, 1, "", {}, 5});
for (double x : {185.0, 199.0, 213.0, 227.0}) box(scene, part, x, 16, 5, 5, 2.4, white);
}
centre(5, 262, 70, 8);
centre(5, 205, 40, 8);
}
// 6-9 snack bars: a kiosk with a striped awning
const std::array<std::array<double, 2>, 4> kiosks{{{{-128, -138}}, {{128, -138}}, {{-128, 138}}, {{128, 138}}}};
const std::array<std::array<double, 2>, 4> kiosks{{{{-72, 62}}, {{-72, -6}}, {{72, -22}}, {{152, -22}}}};
for (size_t n = 0; n < 4 && 6 + n < periphery.size(); ++n) {
const std::string part = "periphery:" + std::to_string(6 + n);
const double x = kiosks[n][0], y = kiosks[n][1];
@@ -387,7 +387,7 @@ inline Scene build(const Json &overview, const std::string &seats, bool paper, i
centre(6 + n, x, y, 5);
}
// 10-13 fan shops: a shop in the club's colour with a flag
const std::array<std::array<double, 2>, 4> shops{{{{256, -20}}, {{256, -95}}, {{200, -150}}, {{-200, -150}}}};
const std::array<std::array<double, 2>, 4> shops{{{{62, -88}}, {{132, -88}}, {{202, -88}}, {{-72, -84}}}};
for (size_t n = 0; n < 4 && 10 + n < periphery.size(); ++n) {
const std::string part = "periphery:" + std::to_string(10 + n);
const double x = shops[n][0], y = shops[n][1];
@@ -405,12 +405,13 @@ inline Scene build(const Json &overview, const std::string &seats, bool paper, i
// any further object of a data set: a house that grows with its level
for (size_t i = 14; i < periphery.size(); ++i) {
const std::string part = "periphery:" + std::to_string(i);
const double x = -300 + double(i - 14) * 60, y = -150;
const double x = -230 + double(i - 14) * 60, y = -100;
if (level_at(i) <= 0) planned(part, x, y, 40, 30, busy_at(i));
else box(scene, part, x, y, 30 + 6 * level_at(i), 24, 6 + 5 * level_at(i), brick);
centre(i, x, y, 6);
}
for (double x : {-330.0, -300.0, 300.0, 330.0}) tree(x, 245);
for (double x : {-245.0, -18.0, 18.0, 245.0}) tree(x, 190);
for (double y : {-112.0, -56.0, 0.0, 56.0}) { tree(-18, y); tree(18, y); } // the avenue
for (const auto &[id, at] : scene.centres) scene.anchors.push_back({id, at});
return scene;
}
@@ -497,7 +498,7 @@ inline Drawing draw(const Scene &scene, const Camera &camera, double width, doub
}
// The camera never moves: one station for the stadium, one for its surroundings.
inline Camera fixed_camera(bool surroundings) { return surroundings ? Camera{28, 42, 0.98, 0, 0} : Camera{28, 44, 1.72, 0, 0}; }
inline Camera fixed_camera(bool surroundings) { return surroundings ? Camera{22, 42, 1.42, 0, 0} : Camera{28, 44, 2.15, 0, 0}; }
// Where the camera stands for a focus: "" the whole ground with its surroundings, "stadium"
// the bowl, a part id that part, turned so that it lies in front.
+26 -21
View File
@@ -143,14 +143,14 @@ std::string App::render_stadium() {
out+="<header class=\"stadium-heading\"><div class=\"stadium-heading-copy\"><h2>"+esc(overview.at("name").get<std::string>())+"</h2><p>"+(view=="inside"?"Stadion · ein Bauteil anklicken":view=="panorama"?"Umfeld · ein Gebäude anklicken":"Stadiondaten")+"</p></div><div class=\"stadium-summary\"><div><span>"+(future?"Geplante Kapazität":"Verfügbare Kapazität")+std::string("</span><strong>")+number(overview.at("capacity").get<int64_t>())+" <small>Plätze</small></strong></div><div><span>"+std::string(engine_mode_?"Vereinskasse":"Ausbaubudget")+"</span><strong class=\""+std::string(engine_mode_?money_classes(overview.at("budget").get<int64_t>()):"")+"\">"+esc(stadium_cash(overview.at("budget")))+"</strong></div></div></header>";
if(view=="inside"||view=="panorama") {
// the ground as a card model seen from a fixed camera: the stadium with its stands and
// facilities, or its surroundings; a part is chosen in the picture and shown on a card
// facilities, or its surroundings; the pointer names a part, a click shows its card
const bool outer=view=="panorama";
std::string seat_colour;
if(const auto *own=world_->find("clubs",club);own&&!own->value("crest","").empty())seat_colour=renderer_.crest_colour(own->value("crest",""));
if(seat_colour.empty())seat_colour="#3d6f8f";
const auto scene=stadium3d::build(overview,seat_colour,theme_=="silver",outer?1:0);
if(!stadium_focus_.empty()&&(!scene.centres.contains(stadium_focus_)||stadium_focus_.starts_with("periphery:")!=outer))stadium_focus_.clear();
constexpr double mw=1790,mh=1600;
constexpr double mw=2612,mh=1600;
const bool part_focus=!stadium_focus_.empty();
const auto drawing=stadium3d::draw(scene,stadium3d::fixed_camera(outer),mw,mh,stadium_focus_);
out+="<div class=\"stadium-model\" id=\"stadium-model\"><div id=\"stadium-model-art\">"+picture(renderer_.diagram("stadium-model",drawing.svg,3580),mw,mh)+"</div>";
@@ -160,6 +160,26 @@ std::string App::render_stadium() {
if(id.starts_with("facility:"))return overview.at("facilities")[index].at("name").get<std::string>();
return overview.at("periphery")[index].at("name").get<std::string>();
};
// what the pointer finds on a part: its name and what stands there today
const auto tip_of=[&](const std::string &id,double x,double y,double reach)->std::string {
const auto index=size_t(std::stoul(id.substr(id.find(':')+1)));
std::string state;bool busy=false;
if(id.starts_with("block:")) {
const auto &b=overview.at("blocks")[index];busy=b.at("building").get<bool>();
state=number(b.at("display_places").get<int64_t>())+" von "+number(b.at("max_places").get<int64_t>())+" Plätzen · "+(b.at("display_seats").get<bool>()?"Sitzplätze":"Stehplätze")+(b.at("display_roof").get<bool>()?" · Dach":"");
} else if(id.starts_with("facility:")) {
const auto &f=overview.at("facilities")[index];busy=f.at("building").get<bool>();
state=f.at("display_label").get<std::string>();
} else {
const auto &p=overview.at("periphery")[index];busy=p.at("building").get<bool>();
const int level=p.at("level").get<int>(),most=p.at("max_level").get<int>();
state=level<=0?"noch nicht gebaut":most>1?"Stufe "+std::to_string(level)+" von "+std::to_string(most):"gebaut";
}
if(busy)state+=" · im Bau";
constexpr double tw=620,th=128;
const double left=std::clamp(x-tw/2,12.0,mw-tw-12)-(x-reach),top=y-reach*.8>th+24?-th-12:1.6*reach+56;
return "<span class=\"stadium-tip\" style=\"left:"+scalar(left)+"dp;top:"+scalar(top)+"dp;\"><strong>"+esc(name_of(id))+"</strong><span>"+esc(state)+"</span></span>";
};
if(part_focus)out+=btn("stadium-focus","","stadium-model-back","id=\"stadium-model-ground\" data-id=\"\" aria-label=\"Auswahl aufheben\" style=\""+rect(0,0,mw,mh)+"\"");
const double reach=outer?74:62;
std::map<std::string,int> spots;
@@ -170,7 +190,7 @@ std::string App::render_stadium() {
if(anchor.id==stadium_focus_)continue;
if(anchor.x<reach||anchor.y<reach||anchor.x>mw-reach||anchor.y>mh-reach)continue;
const auto name=name_of(anchor.id);const int spot=spots[anchor.id]++;
out+=btn("stadium-focus","","stadium-model-hit","id=\"stadium-part-"+esc(anchor.id.substr(0,anchor.id.find(':'))+"-"+anchor.id.substr(anchor.id.find(':')+1))+(spot?"-"+std::to_string(spot):std::string())+"\" data-id=\""+esc(anchor.id)+"\" data-stadium-hint=\""+esc(name)+"\" aria-label=\""+esc(name)+"\" style=\""+rect(anchor.x-reach,anchor.y-reach*.8,2*reach,1.6*reach)+"\"");
out+=btn("stadium-focus",tip_of(anchor.id,anchor.x,anchor.y,reach),"stadium-model-hit","id=\"stadium-part-"+esc(anchor.id.substr(0,anchor.id.find(':'))+"-"+anchor.id.substr(anchor.id.find(':')+1))+(spot?"-"+std::to_string(spot):std::string())+"\" data-id=\""+esc(anchor.id)+"\" data-stadium-hint=\""+esc(name)+"\" aria-label=\""+esc(name)+"\" style=\""+rect(anchor.x-reach,anchor.y-reach*.8,2*reach,1.6*reach)+"\"");
}
for(const auto &part:drawing.parts) {
if(part.cx<60||part.cy<60||part.cx>mw-60||part.cy>mh-60)continue;
@@ -204,27 +224,12 @@ std::string App::render_stadium() {
if(busy)facts+=fact("Im Bau","noch "+std::to_string(p.at("job").at("weeks").get<int>())+" Wochen");
full=level>=most;
}
out+="<aside class=\"stadium-card\" id=\"stadium-card\"><h3>"+esc(name_of(stadium_focus_))+"</h3>"+facts+
double chosen_x=0;for(const auto &part:drawing.parts)if(part.id==stadium_focus_)chosen_x=part.cx;
// the card lies over the picture, on the side away from the chosen part
out+="<aside class=\"stadium-card\" id=\"stadium-card\" style=\"left:"+scalar(chosen_x>mw/2?32.0:mw-32-800)+"dp;\"><h3>"+esc(name_of(stadium_focus_))+"</h3>"+facts+
"<p class=\"stadium-card-note\">"+std::string(busy?"Hier wird gebaut.":full?"Hier ist alles ausgebaut.":"Preis und Bauzeit nennt das Angebot der Baufirma.")+"</p>"+
btn(action,label,"primary stadium-card-build","id=\"stadium-card-build\" data-id=\""+std::to_string(index)+"\" "+(busy||full?"disabled=\"disabled\"":""))+
btn("stadium-focus","Zurück","stadium-card-back","id=\"stadium-card-back\" data-id=\"\"")+"</aside>";
} else if(outer) {
// nothing chosen: every object of the surroundings with its level
out+="<aside class=\"stadium-card stadium-list\" id=\"stadium-card\"><h3>Umfeld</h3>";
for(size_t i=0;i<overview.at("periphery").size();++i) {
const auto &row=overview.at("periphery")[i];const int level=row.at("level").get<int>(),most=row.at("max_level").get<int>();
std::string pips="<span class=\"stadium-row-pips\">";for(int k=0;k<most;++k)pips+=k<level?"<span class=\"pip on\"></span>":"<span class=\"pip\"></span>";
out+=btn("stadium-focus","<span class=\"name\">"+esc(row.at("name").get<std::string>())+"</span>"+(row.at("building").get<bool>()?"<span class=\"job\">Bau · "+std::to_string(row.at("job").at("weeks").get<int>())+" W.</span>":std::string())+pips+"</span>","stadium-row","id=\"stadium-row-"+std::to_string(i)+"\" data-id=\"periphery:"+std::to_string(i)+"\"");
}
out+="</aside>";
} else {
for(size_t i=0;i<8;++i) {
const auto &b=overview.at("blocks")[i];const bool building=b.at("building").get<bool>();
const auto &j=b.at("job");const auto detail=future?(building?"Im Bau: "+number(j.at("places").get<int64_t>())+" Plätze":"kein Bau"):number(b.at("display_places").get<int64_t>())+" Plätze";
const auto note=future?(building?"Bauzeit: "+std::to_string(j.at("weeks").get<int>())+" Wochen":""):("max. "+number(b.at("max_places").get<int64_t>()));
const double top=note.empty()?48.625:34.625;
out+=btn("stadium-block","<span class=\"stadium-block-copy\" style=\"top:"+scalar(top)+"dp;\"><strong>Block "+b.at("letter").get<std::string>()+"</strong><span>"+esc(detail)+"</span><small>"+esc(note)+"</small></span><span class=\"stadium-block-bar\"><span style=\"width:"+scalar(std::clamp(b.at("display_places").get<int64_t>()*100.0/double(std::max<int64_t>(1,b.at("max_places").get<int64_t>())),0.0,100.0))+"%;\"></span></span><span class=\"stadium-block-icons\">"+feature("seats",b.at("display_seats").get<bool>(),76)+feature("roof",b.at("display_roof").get<bool>(),76)+"</span>","stadium-block "+std::string(building?"building":""),"id=\"stadium-block-"+std::to_string(i)+"\" data-id=\""+std::to_string(i)+"\" style=\""+rect(1822,134+i*201.25,790,189.25)+"\" "+(building?"disabled=\"disabled\"":""));
}
}
} else {
if(engine_mode_)out+=engine_stadium_data();
+5 -5
View File
@@ -552,14 +552,14 @@ int main(int argc, char **argv) try {
require(scene.centres.contains("block:7") && scene.centres.contains("facility:0") && !scene.centres.contains("periphery:0"),
"The stadium's view should offer stands and facilities only");
const auto inside = stadium3d::fixed_camera(false);
const auto whole = stadium3d::draw(scene, inside, 1790, 1600);
const auto again = stadium3d::draw(stadium3d::build(overview, "#aa2233", true), inside, 1790, 1600);
const auto whole = stadium3d::draw(scene, inside, 2612, 1600);
const auto again = stadium3d::draw(stadium3d::build(overview, "#aa2233", true), inside, 2612, 1600);
require(whole.svg == again.svg && whole.svg.size() > 4000, "Stadium model is not drawn the same way twice");
require(std::count_if(whole.anchors.begin(), whole.anchors.end(), [](const auto &a) { return a.id == "facility:0"; }) == 4,
"Each floodlight mast should choose the floodlights");
for (const auto &part : whole.parts)
if (part.id.starts_with("block:"))
require(part.cx > 100 && part.cx < 1690 && part.cy > 100 && part.cy < 1500, "A stand lies outside the fixed camera's picture");
require(part.cx > 100 && part.cx < 2512 && part.cy > 100 && part.cy < 1500, "A stand lies outside the fixed camera's picture");
// the surroundings: every object is a part of its own, and every level draws more
const auto around = stadium3d::build(overview, "#aa2233", true, 1);
require(around.centres.size() == 14 && around.centres.contains("periphery:13") && !around.centres.contains("block:0"),
@@ -569,9 +569,9 @@ int main(int argc, char **argv) try {
grown["periphery"][4]["level"] = 3;
require(stadium3d::build(grown, "#aa2233", true, 1).faces.size() > around.faces.size() + 20,
"Higher levels of road and parking should show more");
const auto outside = stadium3d::draw(around, stadium3d::fixed_camera(true), 1790, 1600);
const auto outside = stadium3d::draw(around, stadium3d::fixed_camera(true), 2612, 1600);
for (const auto &anchor : outside.anchors)
require(anchor.x > 40 && anchor.x < 1750 && anchor.y > 40 && anchor.y < 1560, "An object of the surroundings lies outside the picture");
require(anchor.x > 40 && anchor.x < 2572 && anchor.y > 40 && anchor.y < 1560, "An object of the surroundings lies outside the picture");
}
auto corrupt = layout;
corrupt["objects"]["calendar"]["x"] = 999999;