walkmap/docs/codox/walkmap.superstructure.html
Simon Brooke 99a6c6824a
Enormous progress on routing, but not there yet.
All existing unit tests still pass, but new code is not instrumented yet.
2020-06-04 16:16:02 +01:00

21 lines
14 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>walkmap.superstructure documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Walkmap</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="dali-performance.html"><div class="inner"><span>Dali performance</span></div></a></li><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to walkmap</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>walkmap</span></div></div></li><li class="depth-2 branch"><a href="walkmap.edge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>edge</span></div></a></li><li class="depth-2 branch"><a href="walkmap.id.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>id</span></div></a></li><li class="depth-2 branch"><a href="walkmap.microworld.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>microworld</span></div></a></li><li class="depth-2 branch"><a href="walkmap.ocean.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ocean</span></div></a></li><li class="depth-2 branch"><a href="walkmap.path.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>path</span></div></a></li><li class="depth-2 branch"><a href="walkmap.polygon.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>polygon</span></div></a></li><li class="depth-2 branch"><a href="walkmap.read-svg.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read-svg</span></div></a></li><li class="depth-2 branch"><a href="walkmap.routing.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routing</span></div></a></li><li class="depth-2 branch"><a href="walkmap.stl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>stl</span></div></a></li><li class="depth-2 branch current"><a href="walkmap.superstructure.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>superstructure</span></div></a></li><li class="depth-2 branch"><a href="walkmap.svg.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>svg</span></div></a></li><li class="depth-2 branch"><a href="walkmap.tag.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tag</span></div></a></li><li class="depth-2 branch"><a href="walkmap.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="walkmap.vertex.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vertex</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="walkmap.superstructure.html#var-in-retrieve"><div class="inner"><span>in-retrieve</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-in-store-find-objects"><div class="inner"><span>in-store-find-objects</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-in-store-replace-with-keys"><div class="inner"><span>in-store-replace-with-keys</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-index-vertex"><div class="inner"><span>index-vertex</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-index-vertices"><div class="inner"><span>index-vertices</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-nearest"><div class="inner"><span>nearest</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-neighbour-ids"><div class="inner"><span>neighbour-ids</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-neighbours"><div class="inner"><span>neighbours</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-retrieve"><div class="inner"><span>retrieve</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-search-vertices"><div class="inner"><span>search-vertices</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-store"><div class="inner"><span>store</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-touching"><div class="inner"><span>touching</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-vertex-index"><div class="inner"><span>vertex-index</span></div></a></li><li class="depth-1"><a href="walkmap.superstructure.html#var-vertices"><div class="inner"><span>vertices</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">walkmap.superstructure</h1><div class="doc"><div class="markdown"><p>single indexing structure for walkmap objects</p></div></div><div class="public anchor" id="var-in-retrieve"><h3>in-retrieve</h3><div class="usage"><code>(in-retrieve x s)</code></div><div class="doc"><div class="markdown"><p>Internal guts of <code>retrieve</code>, q.v. <code>x</code> can be anything; <code>s</code> must be a walkmap superstructure. TODO: recursive, quite likely to blow the fragile Clojure stack. Probably better to do this with <code>walk</code>, but I dont yet understand that.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L89">view source</a></div></div><div class="public anchor" id="var-in-store-find-objects"><h3>in-store-find-objects</h3><div class="usage"><code>(in-store-find-objects o)</code><code>(in-store-find-objects o s)</code></div><div class="doc"><div class="markdown"><p>Return an id -&gt; object map of every object within <code>o</code>. Internal to <code>in-store</code>, q.v. Use at your own peril.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L124">view source</a></div></div><div class="public anchor" id="var-in-store-replace-with-keys"><h3>in-store-replace-with-keys</h3><div class="usage"><code>(in-store-replace-with-keys o)</code></div><div class="doc"><div class="markdown"><p>Return a copy of <code>o</code> in which each reified walkmap object within <code>o</code> has been replaced with the <code>:walkmap.id/id</code> of that object. Internal to <code>in-store</code>, q.v. Use at your own peril.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L142">view source</a></div></div><div class="public anchor" id="var-index-vertex"><h3>index-vertex</h3><div class="usage"><code>(index-vertex s o v)</code></div><div class="doc"><div class="markdown"><p>Return a superstructure like <code>s</code> in which object <code>o</code> is indexed by vertex <code>v</code>. It is an error (and an exception may be thrown) if</p>
<ol>
<li><code>s</code> is not a map;</li>
<li><code>o</code> is not a map;</li>
<li><code>o</code> does not have a value for the key <code>:walkmap.id/id</code>;</li>
<li><code>v</code> is not a vertex.</li>
</ol></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L48">view source</a></div></div><div class="public anchor" id="var-index-vertices"><h3>index-vertices</h3><div class="usage"><code>(index-vertices s o)</code></div><div class="doc"><div class="markdown"><p>Return a superstructure like <code>s</code> in which object <code>o</code> is indexed by its vertices. It is an error (and an exception may be thrown) if</p>
<ol>
<li><code>s</code> is not a map;</li>
<li><code>o</code> is not a map;</li>
<li><code>o</code> does not have a value for the key <code>:walkmap.id/id</code>.</li>
</ol></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L71">view source</a></div></div><div class="public anchor" id="var-nearest"><h3>nearest</h3><div class="usage"><code>(nearest s target filter-fn radius)</code></div><div class="doc"><div class="markdown"><p>Search superstructure <code>s</code> for the nearest object matching <code>filter-fn</code> to the <code>target</code> vertex. Searches only with <code>radius</code> (slight misnomer, area actually searched is a cube). Returns one object, or <code>nil</code> if no matching object found.</p>
<p>WARNING: currently only returns objects which have a defined <code>:centre</code> (but most of the significant objects we have do).</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L200">view source</a></div></div><div class="public anchor" id="var-neighbour-ids"><h3>neighbour-ids</h3><div class="usage"><code>(neighbour-ids target s)</code><code>(neighbour-ids target filter-fn s)</code></div><div class="doc"><div class="markdown"><p>Return a sequence of the ids all those objects in superstructure <code>s</code> which share at least one vertex with <code>target</code>, and which are matched by <code>filter-fn</code> if supplied.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L265">view source</a></div></div><div class="public anchor" id="var-neighbours"><h3>neighbours</h3><div class="usage"><code>(neighbours target s)</code><code>(neighbours target filter-fn s)</code></div><div class="doc"><div class="markdown"><p>Return a sequence of all those objects in superstructure <code>s</code> which share at least one vertex with <code>target</code>, and which are matched by <code>filter-fn</code> if supplied.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L250">view source</a></div></div><div class="public anchor" id="var-retrieve"><h3>retrieve</h3><div class="usage"><code>(retrieve id s)</code></div><div class="doc"><div class="markdown"><p>Retrieve the canonical representation of the object with this <code>id</code> from the superstructure <code>s</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L118">view source</a></div></div><div class="public anchor" id="var-search-vertices"><h3>search-vertices</h3><div class="usage"><code>(search-vertices s minv maxv)</code><code>(search-vertices s minv maxv d2?)</code></div><div class="doc"><div class="markdown"><p>Search superstructure <code>s</code> for vertices within the box defined by vertices <code>minv</code> and <code>maxv</code>. Every coordinate in <code>minv</code> must have a lower value than the equivalent coordinate in <code>maxv</code>. If <code>d2?</code> is supplied and not false, search only in the x,y projection.</p>
<p><strong>NOTE THAT</strong> this depends on the fact that vertices do not currently have properties which will be denormalised by <code>store</code>, and therefore do not have to restored with <code>retrieve</code>. If properties are added to vertices whose values are objects, then this will have to be rewritten.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L181">view source</a></div></div><div class="public anchor" id="var-store"><h3>store</h3><div class="usage"><code>(store o)</code><code>(store o s)</code></div><div class="doc"><div class="markdown"><p>Return a superstructure like <code>s</code> with object <code>o</code> added. If only one argument is supplied it will be assumed to represent <code>o</code> and a new superstructure will be returned.</p>
<p>It is an error (and an exception may be thrown) if</p>
<ol>
<li><code>s</code> is not a map;</li>
<li><code>o</code> is not a recognisable walkmap object</li>
</ol></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L155">view source</a></div></div><div class="public anchor" id="var-touching"><h3>touching</h3><div class="usage"><code>(touching vertex s)</code><code>(touching vertex filter-fn s)</code></div><div class="doc"><div class="markdown"><p>Return a sequence of all objects in superstructure <code>s</code> which are indexed as touching the vertex <code>v</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L238">view source</a></div></div><div class="public anchor" id="var-vertex-index"><h3>vertex-index</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L27">view source</a></div></div><div class="public anchor" id="var-vertices"><h3>vertices</h3><div class="usage"><code>(vertices o)</code></div><div class="doc"><div class="markdown"><p>If <code>o</code> is an object with vertices, return those vertices, else nil.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/superstructure.clj#L29">view source</a></div></div></div></body></html>