StackNode.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>StackNode - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → </p>
  13. <h1 translate="no">StackNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow.
  17. They are usually needed in cases like <code>If</code>, <code>Else</code>.</p></div>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="StackNode" translate="no">new <a href="#StackNode">StackNode</a><span class="signature">( parent : <span class="param-type">StackNode</span> )</span> </h3>
  23. <div class="method">
  24. <div class="description">
  25. <p>Constructs a new stack node.</p>
  26. </div>
  27. <table class="params">
  28. <tbody>
  29. <tr>
  30. <td class="name"><code>parent</code></td>
  31. <td class="description last"><p>The parent stack node.<br/>Default is <code>null</code>.</p></td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. </div>
  37. <h2 class="subsection-title">Properties</h2>
  38. <div class="member">
  39. <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>
  40. <div class="description">
  41. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  42. </div>
  43. </div>
  44. <div class="member">
  45. <h3 class="name" id="nodes" translate="no">.<a href="#nodes">nodes</a><span class="type-signature"> : Array.&lt;<a href="Node.html">Node</a>></span> </h3>
  46. <div class="description">
  47. <p>List of nodes.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <h3 class="name" id="outputNode" translate="no">.<a href="#outputNode">outputNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  52. <div class="description">
  53. <p>The output node.<br/>Default is <code>null</code>.</p>
  54. </div>
  55. </div>
  56. <div class="member">
  57. <h3 class="name" id="parent" translate="no">.<a href="#parent">parent</a><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
  58. <div class="description">
  59. <p>The parent stack node.<br/>Default is <code>null</code>.</p>
  60. </div>
  61. </div>
  62. <h2 class="subsection-title">Methods</h2>
  63. <h3 class="name name-method" id="Case" translate="no">.<a href="#Case">Case</a><span class="signature">( &hellip;params : <span class="param-type">any</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
  64. <div class="method">
  65. <div class="description">
  66. <p>Represents a <code>case</code> statement in TSL. The TSL version accepts an arbitrary numbers of values.
  67. The last parameter must be the callback method that should be executed in the <code>true</code> case.</p>
  68. </div>
  69. <table class="params">
  70. <tbody>
  71. <tr>
  72. <td class="name"><code>params</code></td>
  73. <td class="description last"><p>The values of the <code>Case()</code> statement as well as the callback method.</p></td>
  74. </tr>
  75. </tbody>
  76. </table>
  77. <dl class="details">
  78. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  79. </dl>
  80. </div>
  81. <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>
  82. <div class="method">
  83. <div class="description">
  84. <p>Represents the default code block of a Switch/Case statement.</p>
  85. </div>
  86. <table class="params">
  87. <tbody>
  88. <tr>
  89. <td class="name"><code>method</code></td>
  90. <td class="description last"><p>TSL code which is executed in the <code>else</code> case.</p></td>
  91. </tr>
  92. </tbody>
  93. </table>
  94. <dl class="details">
  95. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  96. </dl>
  97. </div>
  98. <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>
  99. <div class="method">
  100. <div class="description">
  101. <p>Represent an <code>else</code> statement in TSL.</p>
  102. </div>
  103. <table class="params">
  104. <tbody>
  105. <tr>
  106. <td class="name"><code>method</code></td>
  107. <td class="description last"><p>TSL code which is executed in the <code>else</code> case.</p></td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. <dl class="details">
  112. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  113. </dl>
  114. </div>
  115. <h3 class="name name-method" id="ElseIf" translate="no">.<a href="#ElseIf">ElseIf</a><span class="signature">( boolNode : <span class="param-type">Node</span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
  116. <div class="method">
  117. <div class="description">
  118. <p>Represent an <code>elseif</code> statement in TSL.</p>
  119. </div>
  120. <table class="params">
  121. <tbody>
  122. <tr>
  123. <td class="name"><code>boolNode</code></td>
  124. <td class="description last"><p>Represents the condition.</p></td>
  125. </tr>
  126. <tr>
  127. <td class="name"><code>method</code></td>
  128. <td class="description last"><p>TSL code which is executed if the condition evaluates to <code>true</code>.</p></td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. <dl class="details">
  133. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  134. </dl>
  135. </div>
  136. <h3 class="name name-method" id="If" translate="no">.<a href="#If">If</a><span class="signature">( boolNode : <span class="param-type">Node</span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
  137. <div class="method">
  138. <div class="description">
  139. <p>Represent an <code>if</code> statement in TSL.</p>
  140. </div>
  141. <table class="params">
  142. <tbody>
  143. <tr>
  144. <td class="name"><code>boolNode</code></td>
  145. <td class="description last"><p>Represents the condition.</p></td>
  146. </tr>
  147. <tr>
  148. <td class="name"><code>method</code></td>
  149. <td class="description last"><p>TSL code which is executed if the condition evaluates to <code>true</code>.</p></td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. <dl class="details">
  154. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  155. </dl>
  156. </div>
  157. <h3 class="name name-method" id="Switch" translate="no">.<a href="#Switch">Switch</a><span class="signature">( expression : <span class="param-type">any</span>, method : <span class="param-type">function</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
  158. <div class="method">
  159. <div class="description">
  160. <p>Represents a <code>switch</code> statement in TSL.</p>
  161. </div>
  162. <table class="params">
  163. <tbody>
  164. <tr>
  165. <td class="name"><code>expression</code></td>
  166. <td class="description last"><p>Represents the expression.</p></td>
  167. </tr>
  168. <tr>
  169. <td class="name"><code>method</code></td>
  170. <td class="description last"><p>TSL code which is executed if the condition evaluates to <code>true</code>.</p></td>
  171. </tr>
  172. </tbody>
  173. </table>
  174. <dl class="details">
  175. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  176. </dl>
  177. </div>
  178. <h3 class="name name-method" id="addToStack" translate="no">.<a href="#addToStack">addToStack</a><span class="signature">( node : <span class="param-type">Node</span> )</span><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
  179. <div class="method">
  180. <div class="description">
  181. <p>Adds a node to this stack.</p>
  182. </div>
  183. <table class="params">
  184. <tbody>
  185. <tr>
  186. <td class="name"><code>node</code></td>
  187. <td class="description last"><p>The node to add.</p></td>
  188. </tr>
  189. </tbody>
  190. </table>
  191. <dl class="details">
  192. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  193. </dl>
  194. </div>
  195. <h2 class="subsection-title">Source</h2>
  196. <p>
  197. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/StackNode.js" target="_blank" rel="noopener" translate="no">src/nodes/core/StackNode.js</a>
  198. </p>
  199. </article>
  200. </section>
  201. <script src="../scripts/linenumber.js"></script>
  202. <script src="../scripts/page.js"></script>
  203. </body>
  204. </html>
粤ICP备19079148号