| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>StackNode - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → </p>
- <h1 translate="no">StackNode</h1>
- <section>
- <header>
- <div class="class-description"><p>Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
- They are usually needed in cases like <code>If</code>, <code>Else</code>.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="StackNode" translate="no">new <a href="#StackNode">StackNode</a><span class="signature">( parent : <span class="param-type"><a href="StackNode.html">StackNode</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new stack node.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>parent</strong>
- </td>
- <td class="description last">
- <p>The parent stack node.</p>
- <p>Default is <code>null</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="isStackNode" translate="no">.<a href="#isStackNode">isStackNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>This flag can be used for type testing.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="nodes" translate="no">.<a href="#nodes">nodes</a><span class="type-signature"> : Array.<<a href="Node.html">Node</a>></span> </h3>
- <div class="description">
- <p>List of nodes.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="outputNode" translate="no">.<a href="#outputNode">outputNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
- <div class="description">
- <p>The output node.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="parent" translate="no">.<a href="#parent">parent</a><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="description">
- <p>The parent stack node.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="Case" translate="no">.<a href="#Case">Case</a><span class="signature">( …params : <span class="param-type"><a href="global.html#any">any</a></span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Represents a <code>case</code> statement in TSL. The TSL version accepts an arbitrary numbers of values.
- The last parameter must be the callback method that should be executed in the <code>true</code> case.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>params</strong>
- </td>
- <td class="description last">
- <p>The values of the <code>Case()</code> statement as well as the callback method.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="Default" translate="no">.<a href="#Default">Default</a><span class="signature">( method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Represents the default code block of a Switch/Case statement.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>method</strong>
- </td>
- <td class="description last">
- <p>TSL code which is executed in the <code>else</code> case.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="Else" translate="no">.<a href="#Else">Else</a><span class="signature">( method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Represent an <code>else</code> statement in TSL.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>method</strong>
- </td>
- <td class="description last">
- <p>TSL code which is executed in the <code>else</code> case.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="ElseIf" translate="no">.<a href="#ElseIf">ElseIf</a><span class="signature">( boolNode : <span class="param-type"><a href="Node.html">Node</a></span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Represent an <code>elseif</code> statement in TSL.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>boolNode</strong>
- </td>
- <td class="description last">
- <p>Represents the condition.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>method</strong>
- </td>
- <td class="description last">
- <p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="If" translate="no">.<a href="#If">If</a><span class="signature">( boolNode : <span class="param-type"><a href="Node.html">Node</a></span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Represent an <code>if</code> statement in TSL.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>boolNode</strong>
- </td>
- <td class="description last">
- <p>Represents the condition.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>method</strong>
- </td>
- <td class="description last">
- <p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="Switch" translate="no">.<a href="#Switch">Switch</a><span class="signature">( expression : <span class="param-type"><a href="global.html#any">any</a></span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Represents a <code>switch</code> statement in TSL.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>expression</strong>
- </td>
- <td class="description last">
- <p>Represents the expression.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>method</strong>
- </td>
- <td class="description last">
- <p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="addToStack" translate="no">.<a href="#addToStack">addToStack</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a node to this stack.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>node</strong>
- </td>
- <td class="description last">
- <p>The node to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/StackNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/StackNode.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|