StackNode.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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"><a href="StackNode.html">StackNode</a></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">
  31. <strong>parent</strong>
  32. </td>
  33. <td class="description last">
  34. <p>The parent stack node.</p>
  35. <p>Default is <code>null</code>.</p>
  36. </td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. <h2 class="subsection-title">Properties</h2>
  43. <div class="member">
  44. <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>
  45. <div class="description">
  46. <p>This flag can be used for type testing.</p>
  47. <p>Default is <code>true</code>.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <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>
  52. <div class="description">
  53. <p>List of nodes.</p>
  54. </div>
  55. </div>
  56. <div class="member">
  57. <h3 class="name" id="outputNode" translate="no">.<a href="#outputNode">outputNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  58. <div class="description">
  59. <p>The output node.</p>
  60. <p>Default is <code>null</code>.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="parent" translate="no">.<a href="#parent">parent</a><span class="type-signature"> : <a href="StackNode.html">StackNode</a></span> </h3>
  65. <div class="description">
  66. <p>The parent stack node.</p>
  67. <p>Default is <code>null</code>.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <h3 class="name name-method" id="Case" translate="no">.<a href="#Case">Case</a><span class="signature">( &hellip;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>
  72. <div class="method">
  73. <div class="description">
  74. <p>Represents a <code>case</code> statement in TSL. The TSL version accepts an arbitrary numbers of values.
  75. The last parameter must be the callback method that should be executed in the <code>true</code> case.</p>
  76. </div>
  77. <table class="params">
  78. <tbody>
  79. <tr>
  80. <td class="name">
  81. <strong>params</strong>
  82. </td>
  83. <td class="description last">
  84. <p>The values of the <code>Case()</code> statement as well as the callback method.</p>
  85. </td>
  86. </tr>
  87. </tbody>
  88. </table>
  89. <dl class="details">
  90. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  91. </dl>
  92. </div>
  93. <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>
  94. <div class="method">
  95. <div class="description">
  96. <p>Represents the default code block of a Switch/Case statement.</p>
  97. </div>
  98. <table class="params">
  99. <tbody>
  100. <tr>
  101. <td class="name">
  102. <strong>method</strong>
  103. </td>
  104. <td class="description last">
  105. <p>TSL code which is executed in the <code>else</code> case.</p>
  106. </td>
  107. </tr>
  108. </tbody>
  109. </table>
  110. <dl class="details">
  111. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  112. </dl>
  113. </div>
  114. <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>
  115. <div class="method">
  116. <div class="description">
  117. <p>Represent an <code>else</code> statement in TSL.</p>
  118. </div>
  119. <table class="params">
  120. <tbody>
  121. <tr>
  122. <td class="name">
  123. <strong>method</strong>
  124. </td>
  125. <td class="description last">
  126. <p>TSL code which is executed in the <code>else</code> case.</p>
  127. </td>
  128. </tr>
  129. </tbody>
  130. </table>
  131. <dl class="details">
  132. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  133. </dl>
  134. </div>
  135. <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>
  136. <div class="method">
  137. <div class="description">
  138. <p>Represent an <code>elseif</code> statement in TSL.</p>
  139. </div>
  140. <table class="params">
  141. <tbody>
  142. <tr>
  143. <td class="name">
  144. <strong>boolNode</strong>
  145. </td>
  146. <td class="description last">
  147. <p>Represents the condition.</p>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td class="name">
  152. <strong>method</strong>
  153. </td>
  154. <td class="description last">
  155. <p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
  156. </td>
  157. </tr>
  158. </tbody>
  159. </table>
  160. <dl class="details">
  161. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  162. </dl>
  163. </div>
  164. <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>
  165. <div class="method">
  166. <div class="description">
  167. <p>Represent an <code>if</code> statement in TSL.</p>
  168. </div>
  169. <table class="params">
  170. <tbody>
  171. <tr>
  172. <td class="name">
  173. <strong>boolNode</strong>
  174. </td>
  175. <td class="description last">
  176. <p>Represents the condition.</p>
  177. </td>
  178. </tr>
  179. <tr>
  180. <td class="name">
  181. <strong>method</strong>
  182. </td>
  183. <td class="description last">
  184. <p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
  185. </td>
  186. </tr>
  187. </tbody>
  188. </table>
  189. <dl class="details">
  190. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  191. </dl>
  192. </div>
  193. <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>
  194. <div class="method">
  195. <div class="description">
  196. <p>Represents a <code>switch</code> statement in TSL.</p>
  197. </div>
  198. <table class="params">
  199. <tbody>
  200. <tr>
  201. <td class="name">
  202. <strong>expression</strong>
  203. </td>
  204. <td class="description last">
  205. <p>Represents the expression.</p>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td class="name">
  210. <strong>method</strong>
  211. </td>
  212. <td class="description last">
  213. <p>TSL code which is executed if the condition evaluates to <code>true</code>.</p>
  214. </td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. <dl class="details">
  219. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  220. </dl>
  221. </div>
  222. <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>
  223. <div class="method">
  224. <div class="description">
  225. <p>Adds a node to this stack.</p>
  226. </div>
  227. <table class="params">
  228. <tbody>
  229. <tr>
  230. <td class="name">
  231. <strong>node</strong>
  232. </td>
  233. <td class="description last">
  234. <p>The node to add.</p>
  235. </td>
  236. </tr>
  237. </tbody>
  238. </table>
  239. <dl class="details">
  240. <dt class="tag-returns"><strong>Returns:</strong> A reference to this stack node.</dt>
  241. </dl>
  242. </div>
  243. <h2 class="subsection-title">Source</h2>
  244. <p>
  245. <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>
  246. </p>
  247. </article>
  248. </section>
  249. <script src="../scripts/linenumber.js"></script>
  250. <script src="../scripts/page.js"></script>
  251. </body>
  252. </html>
粤ICP备19079148号