NodeCache.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>NodeCache - 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. <h1 translate="no">NodeCache</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This utility class is used in <a href="NodeBuilder.html">NodeBuilder</a> as an internal
  16. cache data structure for node data.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="NodeCache" translate="no">new <a href="#NodeCache">NodeCache</a><span class="signature">( parent : <span class="param-type">NodeCache</span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new node cache.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name"><code>parent</code></td>
  30. <td class="description last"><p>A reference to a parent cache.<br/>Default is <code>null</code>.</p></td>
  31. </tr>
  32. </tbody>
  33. </table>
  34. </div>
  35. </div>
  36. <h2 class="subsection-title">Properties</h2>
  37. <div class="member">
  38. <h3 class="name" id="id" translate="no">.<a href="#id">id</a><span class="type-signature"> : number</span> <span class="type-signature">(readonly) </span></h3>
  39. <div class="description">
  40. <p>The id of the cache.</p>
  41. </div>
  42. </div>
  43. <div class="member">
  44. <h3 class="name" id="nodesData" translate="no">.<a href="#nodesData">nodesData</a><span class="type-signature"> : WeakMap.&lt;<a href="Node.html">Node</a>, Object></span> </h3>
  45. <div class="description">
  46. <p>A weak map for managing node data.</p>
  47. </div>
  48. </div>
  49. <div class="member">
  50. <h3 class="name" id="parent" translate="no">.<a href="#parent">parent</a><span class="type-signature"> : <a href="NodeCache.html">NodeCache</a></span> </h3>
  51. <div class="description">
  52. <p>Reference to a parent node cache.<br/>Default is <code>null</code>.</p>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Methods</h2>
  56. <h3 class="name name-method" id="getData" translate="no">.<a href="#getData">getData</a><span class="signature">( node : <span class="param-type">Node</span> )</span><span class="type-signature"> : Object</span> </h3>
  57. <div class="method">
  58. <div class="description">
  59. <p>Returns the data for the given node.</p>
  60. </div>
  61. <table class="params">
  62. <tbody>
  63. <tr>
  64. <td class="name"><code>node</code></td>
  65. <td class="description last"><p>The node.</p></td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. <dl class="details">
  70. <dt class="tag-returns"><strong>Returns:</strong> The data for the node.</dt>
  71. </dl>
  72. </div>
  73. <h3 class="name name-method" id="setData" translate="no">.<a href="#setData">setData</a><span class="signature">( node : <span class="param-type">Node</span>, data : <span class="param-type">Object</span> )</span> </h3>
  74. <div class="method">
  75. <div class="description">
  76. <p>Sets the data for a given node.</p>
  77. </div>
  78. <table class="params">
  79. <tbody>
  80. <tr>
  81. <td class="name"><code>node</code></td>
  82. <td class="description last"><p>The node.</p></td>
  83. </tr>
  84. <tr>
  85. <td class="name"><code>data</code></td>
  86. <td class="description last"><p>The data that should be cached.</p></td>
  87. </tr>
  88. </tbody>
  89. </table>
  90. </div>
  91. <h2 class="subsection-title">Source</h2>
  92. <p>
  93. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/NodeCache.js" target="_blank" rel="noopener" translate="no">src/nodes/core/NodeCache.js</a>
  94. </p>
  95. </article>
  96. </section>
  97. <script src="../scripts/linenumber.js"></script>
  98. <script src="../scripts/page.js"></script>
  99. </body>
  100. </html>
粤ICP备19079148号