mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-23 17:07:12 +03:00
deploy: 7d4a377173
This commit is contained in:
parent
4bad2e3bb1
commit
d4e9f8ec5b
@ -289,8 +289,8 @@ the event and immediately apply the transition. <a href="#method.panel_changed">
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-35" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/browse.rs.html#107-117" title="goto source code">[src]</a></div><a href="#method.draw-35" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-34" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-34" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-34" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_destroy-34" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.57.0/std/primitive.reference.html">&mut </a>A)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-35" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/connectivity.rs.html#90-146" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-35" class="anchor"></a><h3 class="code-header in-band">impl State<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../ltn/connectivity/struct.Viewer.html" title="struct game::ltn::connectivity::Viewer">Viewer</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-35" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/connectivity.rs.html#91-132" title="goto source code">[src]</a></div><a href="#method.event-35" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-36" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/connectivity.rs.html#134-145" title="goto source code">[src]</a></div><a href="#method.draw-36" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-35" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/connectivity.rs.html#95-152" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-35" class="anchor"></a><h3 class="code-header in-band">impl State<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../ltn/connectivity/struct.Viewer.html" title="struct game::ltn::connectivity::Viewer">Viewer</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-35" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/connectivity.rs.html#96-138" title="goto source code">[src]</a></div><a href="#method.event-35" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw-36" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/connectivity.rs.html#140-151" title="goto source code">[src]</a></div><a href="#method.draw-36" class="anchor"></a><h4 class="code-header">fn <a class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div></summary><div class='docblock'><p>Draw</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.draw_baselayer-35" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-35" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></summary><div class='docblock'><p>Specifies what to draw before draw()</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_destroy-35" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_destroy-35" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.57.0/std/primitive.reference.html">&mut </a>A)</h4></div></summary><div class='docblock'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-State%3CApp%3E-36" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/pathfinding.rs.html#200-265" title="goto source code">[src]</a></div><a href="#impl-State%3CApp%3E-36" class="anchor"></a><h3 class="code-header in-band">impl State<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../ltn/pathfinding/struct.RoutePlanner.html" title="struct game::ltn::pathfinding::RoutePlanner">RoutePlanner</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.event-36" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/ltn/pathfinding.rs.html#201-245" title="goto source code">[src]</a></div><a href="#method.event-36" class="anchor"></a><h4 class="code-header">fn <a class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `make_world` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, make_world"><title>make_world in game::ltn::connectivity - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">ltn</a>::<wbr><a href="index.html">connectivity</a></h2><div id="sidebar-vars" data-name="make_world" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">ltn</a>::<wbr><a href="index.html">connectivity</a>::<wbr><a class="fn" href="#">make_world</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/ltn/connectivity.rs.html#148-196" title="goto source code">[src]</a></span></h1><pre class="rust fn"><code>fn make_world(<br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../app/struct.App.html" title="struct game::app::App">App</a>, <br> neighborhood: &<a class="struct" href="../struct.Neighborhood.html" title="struct game::ltn::Neighborhood">Neighborhood</a>, <br> draw_cells_as_areas: <a class="primitive" href="https://doc.rust-lang.org/1.57.0/std/primitive.bool.html">bool</a><br>) -> World<<a class="enum" href="../per_neighborhood/enum.FilterableObj.html" title="enum game::ltn::per_neighborhood::FilterableObj">FilterableObj</a>></code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `make_world` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, make_world"><title>make_world in game::ltn::connectivity - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../index.html">game</a>::<wbr><a href="../index.html">ltn</a>::<wbr><a href="index.html">connectivity</a></h2><div id="sidebar-vars" data-name="make_world" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">ltn</a>::<wbr><a href="index.html">connectivity</a>::<wbr><a class="fn" href="#">make_world</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/ltn/connectivity.rs.html#154-243" title="goto source code">[src]</a></span></h1><pre class="rust fn"><code>fn make_world(<br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../app/struct.App.html" title="struct game::app::App">App</a>, <br> neighborhood: &<a class="struct" href="../struct.Neighborhood.html" title="struct game::ltn::Neighborhood">Neighborhood</a>, <br> draw_cells_as_areas: <a class="primitive" href="https://doc.rust-lang.org/1.57.0/std/primitive.bool.html">bool</a>, <br> draw_borders_as_arrows: <a class="primitive" href="https://doc.rust-lang.org/1.57.0/std/primitive.bool.html">bool</a><br>) -> World<<a class="enum" href="../per_neighborhood/enum.FilterableObj.html" title="enum game::ltn::per_neighborhood::FilterableObj">FilterableObj</a>></code></pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
<script src="../../../main.js"></script>
|
||||
</body></html>
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `connectivity` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, connectivity"><title>game::ltn::connectivity - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module connectivity</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="connectivity" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">ltn</a>::<wbr><a class="mod" href="#">connectivity</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/ltn/connectivity.rs.html#1-196" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `connectivity` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, connectivity"><title>game::ltn::connectivity - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module connectivity</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="connectivity" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">ltn</a>::<wbr><a class="mod" href="#">connectivity</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/ltn/connectivity.rs.html#1-243" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Viewer.html" title="game::ltn::connectivity::Viewer struct">Viewer</a></div><div class="item-right docblock-short"></div></div></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.make_world.html" title="game::ltn::connectivity::make_world fn">make_world</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
<script src="../../../main.js"></script>
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `angle` mod in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, angle"><title>geom::angle - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module angle</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="angle" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">geom</a>::<wbr><a class="mod" href="#">angle</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/geom/angle.rs.html#1-124" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `angle` mod in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, angle"><title>geom::angle - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module angle</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="angle" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">geom</a>::<wbr><a class="mod" href="#">angle</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/geom/angle.rs.html#1-137" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Angle.html" title="geom::angle::Angle struct">Angle</a></div><div class="item-right docblock-short"><p>An angle, stored in radians.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="geom" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div>
|
||||
<script src="../../main.js"></script>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in map_gui::tools::title_screen::built_info - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../../map_gui/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-5b11ba30aa99b1f3/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.57.0/std/primitive.str.html">str</a> = r"Wed, 12 Jan 2022 12:41:25 +0000";</code></pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in map_gui::tools::title_screen::built_info - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../../map_gui/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-5b11ba30aa99b1f3/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.57.0/std/primitive.str.html">str</a> = r"Wed, 12 Jan 2022 13:15:05 +0000";</code></pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
</div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="map_gui" data-search-index-js="../../../../search-index.js" data-search-js="../../../../search.js"></div>
|
||||
<script src="../../../../main.js"></script>
|
||||
</body></html>
|
File diff suppressed because one or more lines are too long
@ -194,7 +194,54 @@
|
||||
<span id="194">194</span>
|
||||
<span id="195">195</span>
|
||||
<span id="196">196</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">geom::Distance</span>;
|
||||
<span id="197">197</span>
|
||||
<span id="198">198</span>
|
||||
<span id="199">199</span>
|
||||
<span id="200">200</span>
|
||||
<span id="201">201</span>
|
||||
<span id="202">202</span>
|
||||
<span id="203">203</span>
|
||||
<span id="204">204</span>
|
||||
<span id="205">205</span>
|
||||
<span id="206">206</span>
|
||||
<span id="207">207</span>
|
||||
<span id="208">208</span>
|
||||
<span id="209">209</span>
|
||||
<span id="210">210</span>
|
||||
<span id="211">211</span>
|
||||
<span id="212">212</span>
|
||||
<span id="213">213</span>
|
||||
<span id="214">214</span>
|
||||
<span id="215">215</span>
|
||||
<span id="216">216</span>
|
||||
<span id="217">217</span>
|
||||
<span id="218">218</span>
|
||||
<span id="219">219</span>
|
||||
<span id="220">220</span>
|
||||
<span id="221">221</span>
|
||||
<span id="222">222</span>
|
||||
<span id="223">223</span>
|
||||
<span id="224">224</span>
|
||||
<span id="225">225</span>
|
||||
<span id="226">226</span>
|
||||
<span id="227">227</span>
|
||||
<span id="228">228</span>
|
||||
<span id="229">229</span>
|
||||
<span id="230">230</span>
|
||||
<span id="231">231</span>
|
||||
<span id="232">232</span>
|
||||
<span id="233">233</span>
|
||||
<span id="234">234</span>
|
||||
<span id="235">235</span>
|
||||
<span id="236">236</span>
|
||||
<span id="237">237</span>
|
||||
<span id="238">238</span>
|
||||
<span id="239">239</span>
|
||||
<span id="240">240</span>
|
||||
<span id="241">241</span>
|
||||
<span id="242">242</span>
|
||||
<span id="243">243</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Angle</span>, <span class="ident">ArrowCap</span>, <span class="ident">Distance</span>, <span class="ident">PolyLine</span>};
|
||||
<span class="kw">use</span> <span class="ident">widgetry::mapspace::World</span>;
|
||||
<span class="kw">use</span> <span class="ident">widgetry</span>::{
|
||||
<span class="ident">EventCtx</span>, <span class="ident">GeomBatch</span>, <span class="ident">GfxCtx</span>, <span class="ident">Key</span>, <span class="ident">Outcome</span>, <span class="ident">Panel</span>, <span class="ident">State</span>, <span class="ident">Text</span>, <span class="ident">TextExt</span>, <span class="ident">Toggle</span>, <span class="ident">Widget</span>,
|
||||
@ -232,6 +279,10 @@
|
||||
<span class="string">"Draw traffic cells as"</span>.<span class="ident">text_widget</span>(<span class="ident">ctx</span>).<span class="ident">centered_vert</span>(),
|
||||
<span class="ident">Toggle::choice</span>(<span class="ident">ctx</span>, <span class="string">"draw cells"</span>, <span class="string">"areas"</span>, <span class="string">"streets"</span>, <span class="ident">Key::D</span>, <span class="bool-val">true</span>),
|
||||
]),
|
||||
<span class="ident">Widget::row</span>(<span class="macro">vec!</span>[
|
||||
<span class="string">"Draw entrances/exits as"</span>.<span class="ident">text_widget</span>(<span class="ident">ctx</span>).<span class="ident">centered_vert</span>(),
|
||||
<span class="ident">Toggle::choice</span>(<span class="ident">ctx</span>, <span class="string">"draw borders"</span>, <span class="string">"arrows"</span>, <span class="string">"outlines"</span>, <span class="ident">Key::E</span>, <span class="bool-val">true</span>),
|
||||
]),
|
||||
<span class="ident">Text::new</span>().<span class="ident">into_widget</span>(<span class="ident">ctx</span>).<span class="ident">named</span>(<span class="string">"warnings"</span>),
|
||||
<span class="ident">Widget::row</span>(<span class="macro">vec!</span>[
|
||||
<span class="ident">Widget::dropdown</span>(
|
||||
@ -266,6 +317,7 @@
|
||||
<span class="ident">app</span>,
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">neighborhood</span>,
|
||||
<span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">is_checked</span>(<span class="string">"draw cells"</span>),
|
||||
<span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">is_checked</span>(<span class="string">"draw borders"</span>),
|
||||
);
|
||||
<span class="kw">let</span> <span class="ident">disconnected_cells</span> <span class="op">=</span> <span class="self">self</span>
|
||||
.<span class="ident">neighborhood</span>
|
||||
@ -303,12 +355,13 @@
|
||||
.<span class="ident">unwrap</span>();
|
||||
}
|
||||
<span class="ident">Outcome::Changed</span>(<span class="ident">x</span>) => {
|
||||
<span class="kw">if</span> <span class="ident">x</span> <span class="op">==</span> <span class="string">"streets"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">x</span> <span class="op">==</span> <span class="string">"areas"</span> {
|
||||
<span class="kw">if</span> <span class="ident">x</span> <span class="op">!</span><span class="op">=</span> <span class="string">"heuristic"</span> {
|
||||
<span class="self">self</span>.<span class="ident">world</span> <span class="op">=</span> <span class="ident">make_world</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">neighborhood</span>,
|
||||
<span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">is_checked</span>(<span class="string">"draw cells"</span>),
|
||||
<span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">is_checked</span>(<span class="string">"draw borders"</span>),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -346,6 +399,7 @@
|
||||
<span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>,
|
||||
<span class="ident">neighborhood</span>: <span class="kw-2">&</span><span class="ident">Neighborhood</span>,
|
||||
<span class="ident">draw_cells_as_areas</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">draw_borders_as_arrows</span>: <span class="ident">bool</span>,
|
||||
) -> <span class="ident">World</span><span class="op"><</span><span class="ident">FilterableObj</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">world</span> <span class="op">=</span> <span class="ident">World::bounded</span>(<span class="ident">map</span>.<span class="ident">get_bounds</span>());
|
||||
@ -357,7 +411,6 @@
|
||||
<span class="ident">world</span>.<span class="ident">draw_master_batch</span>(<span class="ident">ctx</span>, <span class="ident">draw_areas</span>);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">draw</span> <span class="op">=</span> <span class="ident">GeomBatch::new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">debug_cell_borders</span> <span class="op">=</span> <span class="ident">GeomBatch::new</span>();
|
||||
<span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">cell</span>) <span class="kw">in</span> <span class="ident">neighborhood</span>.<span class="ident">cells</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
|
||||
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">cell_colors</span>[<span class="ident">idx</span>].<span class="ident">alpha</span>(<span class="number">0.9</span>);
|
||||
<span class="kw">for</span> (<span class="ident">r</span>, <span class="ident">interval</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">cell</span>.<span class="ident">roads</span> {
|
||||
@ -374,18 +427,59 @@
|
||||
{
|
||||
<span class="ident">draw</span>.<span class="ident">push</span>(<span class="ident">color</span>, <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>());
|
||||
}
|
||||
<span class="comment">// Draw the cell borders as outlines, for debugging. (Later, we probably want some kind</span>
|
||||
<span class="comment">// of arrow styling)</span>
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">cell</span>.<span class="ident">borders</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">p</span>) <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">to_outline</span>(<span class="ident">Distance::meters</span>(<span class="number">2.0</span>)) {
|
||||
<span class="ident">debug_cell_borders</span>.<span class="ident">push</span>(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">1.0</span>), <span class="ident">p</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="ident">draw</span>.<span class="ident">append</span>(<span class="ident">debug_cell_borders</span>);
|
||||
<span class="ident">world</span>.<span class="ident">draw_master_batch</span>(<span class="ident">ctx</span>, <span class="ident">draw</span>);
|
||||
}
|
||||
|
||||
<span class="comment">// Draw the borders of each cell</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">draw</span> <span class="op">=</span> <span class="ident">GeomBatch::new</span>();
|
||||
<span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">cell</span>) <span class="kw">in</span> <span class="ident">neighborhood</span>.<span class="ident">cells</span>.<span class="ident">iter</span>().<span class="ident">enumerate</span>() {
|
||||
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">cell_colors</span>[<span class="ident">idx</span>];
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">cell</span>.<span class="ident">borders</span> {
|
||||
<span class="kw">if</span> <span class="ident">draw_borders_as_arrows</span> {
|
||||
<span class="kw">let</span> <span class="ident">angles</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Angle</span><span class="op">></span> <span class="op">=</span> <span class="ident">cell</span>
|
||||
.<span class="ident">roads</span>
|
||||
.<span class="ident">keys</span>()
|
||||
.<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">r</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">road</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_r</span>(<span class="kw-2">*</span><span class="ident">r</span>);
|
||||
<span class="comment">// Design choice: when we have a filter right at the entrance of a</span>
|
||||
<span class="comment">// neighborhood, it creates its own little cell allowing access to just the</span>
|
||||
<span class="comment">// very beginning of the road. Let's not draw arrows for that.</span>
|
||||
<span class="kw">if</span> <span class="ident">app</span>.<span class="ident">session</span>.<span class="ident">modal_filters</span>.<span class="ident">roads</span>.<span class="ident">contains_key</span>(<span class="ident">r</span>) {
|
||||
<span class="prelude-val">None</span>
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">road</span>.<span class="ident">src_i</span> <span class="op">==</span> <span class="kw-2">*</span><span class="ident">i</span> {
|
||||
<span class="prelude-val">Some</span>(<span class="ident">road</span>.<span class="ident">center_pts</span>.<span class="ident">first_line</span>().<span class="ident">angle</span>())
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">road</span>.<span class="ident">dst_i</span> <span class="op">==</span> <span class="kw-2">*</span><span class="ident">i</span> {
|
||||
<span class="prelude-val">Some</span>(<span class="ident">road</span>.<span class="ident">center_pts</span>.<span class="ident">last_line</span>().<span class="ident">angle</span>().<span class="ident">opposite</span>())
|
||||
} <span class="kw">else</span> {
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
})
|
||||
.<span class="ident">collect</span>();
|
||||
<span class="comment">// Tiny cell with a filter right at the border</span>
|
||||
<span class="kw">if</span> <span class="ident">angles</span>.<span class="ident">is_empty</span>() {
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">center</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">center</span>();
|
||||
<span class="kw">let</span> <span class="ident">angle</span> <span class="op">=</span> <span class="ident">Angle::average</span>(<span class="ident">angles</span>);
|
||||
|
||||
<span class="comment">// TODO Consider showing borders with one-way roads. For now, always point the</span>
|
||||
<span class="comment">// arrow into the neighborhood</span>
|
||||
<span class="ident">draw</span>.<span class="ident">push</span>(
|
||||
<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.8</span>),
|
||||
<span class="ident">PolyLine::must_new</span>(<span class="macro">vec!</span>[
|
||||
<span class="ident">center</span>.<span class="ident">project_away</span>(<span class="ident">Distance::meters</span>(<span class="number">30.0</span>), <span class="ident">angle</span>.<span class="ident">opposite</span>()),
|
||||
<span class="ident">center</span>.<span class="ident">project_away</span>(<span class="ident">Distance::meters</span>(<span class="number">10.0</span>), <span class="ident">angle</span>.<span class="ident">opposite</span>()),
|
||||
])
|
||||
.<span class="ident">make_arrow</span>(<span class="ident">Distance::meters</span>(<span class="number">6.0</span>), <span class="ident">ArrowCap::Triangle</span>),
|
||||
);
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">p</span>) <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">to_outline</span>(<span class="ident">Distance::meters</span>(<span class="number">2.0</span>)) {
|
||||
<span class="ident">draw</span>.<span class="ident">push</span>(<span class="ident">color</span>, <span class="ident">p</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="ident">world</span>.<span class="ident">draw_master_batch</span>(<span class="ident">ctx</span>, <span class="ident">draw</span>);
|
||||
|
||||
<span class="ident">world</span>.<span class="ident">initialize_hover</span>(<span class="ident">ctx</span>);
|
||||
|
||||
<span class="ident">world</span>
|
||||
|
@ -122,6 +122,19 @@
|
||||
<span id="122">122</span>
|
||||
<span id="123">123</span>
|
||||
<span id="124">124</span>
|
||||
<span id="125">125</span>
|
||||
<span id="126">126</span>
|
||||
<span id="127">127</span>
|
||||
<span id="128">128</span>
|
||||
<span id="129">129</span>
|
||||
<span id="130">130</span>
|
||||
<span id="131">131</span>
|
||||
<span id="132">132</span>
|
||||
<span id="133">133</span>
|
||||
<span id="134">134</span>
|
||||
<span id="135">135</span>
|
||||
<span id="136">136</span>
|
||||
<span id="137">137</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::fmt</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
|
||||
@ -246,6 +259,19 @@
|
||||
<span class="ident">Angle::new_rads</span>(<span class="op">-</span><span class="self">self</span>.<span class="number">0</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||
<span class="kw">mod</span> <span class="ident">tests</span> {
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
||||
<span class="kw">fn</span> <span class="ident">test_average</span>() {
|
||||
<span class="macro">assert_eq!</span>(
|
||||
<span class="ident">Angle::degrees</span>(<span class="number">30.0</span>),
|
||||
<span class="ident">Angle::average</span>(<span class="macro">vec!</span>[<span class="ident">Angle::degrees</span>(<span class="number">30.0</span>)])
|
||||
);
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="geom" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div>
|
||||
<script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script>
|
||||
|
@ -174,7 +174,7 @@
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"rustdoc 1.57.0 (f1edd0429 2021-11-29)"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The build time in RFC2822, UTC."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"Wed, 12 Jan 2022 12:41:25 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"Wed, 12 Jan 2022 13:15:05 +0000"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The target architecture, given by `CARGO_CFG_TARGET_ARCH`."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"x86_64"</span>;
|
||||
|
Loading…
Reference in New Issue
Block a user