Tileset3DTileContent.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import defer from "../Core/defer.js";
  2. import destroyObject from "../Core/destroyObject.js";
  3. /**
  4. * Represents content for a tile in a
  5. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset whose
  6. * content points to another 3D Tiles tileset.
  7. * <p>
  8. * Implements the {@link Cesium3DTileContent} interface.
  9. * </p>
  10. *
  11. * @alias Tileset3DTileContent
  12. * @constructor
  13. *
  14. * @private
  15. */
  16. function Tileset3DTileContent(tileset, tile, resource, json) {
  17. this._tileset = tileset;
  18. this._tile = tile;
  19. this._resource = resource;
  20. this._readyPromise = defer();
  21. this.featurePropertiesDirty = false;
  22. this._metadata = undefined;
  23. this._group = undefined;
  24. initialize(this, json);
  25. }
  26. Object.defineProperties(Tileset3DTileContent.prototype, {
  27. featuresLength: {
  28. get: function () {
  29. return 0;
  30. },
  31. },
  32. pointsLength: {
  33. get: function () {
  34. return 0;
  35. },
  36. },
  37. trianglesLength: {
  38. get: function () {
  39. return 0;
  40. },
  41. },
  42. geometryByteLength: {
  43. get: function () {
  44. return 0;
  45. },
  46. },
  47. texturesByteLength: {
  48. get: function () {
  49. return 0;
  50. },
  51. },
  52. batchTableByteLength: {
  53. get: function () {
  54. return 0;
  55. },
  56. },
  57. innerContents: {
  58. get: function () {
  59. return undefined;
  60. },
  61. },
  62. readyPromise: {
  63. get: function () {
  64. return this._readyPromise.promise;
  65. },
  66. },
  67. tileset: {
  68. get: function () {
  69. return this._tileset;
  70. },
  71. },
  72. tile: {
  73. get: function () {
  74. return this._tile;
  75. },
  76. },
  77. url: {
  78. get: function () {
  79. return this._resource.getUrlComponent(true);
  80. },
  81. },
  82. batchTable: {
  83. get: function () {
  84. return undefined;
  85. },
  86. },
  87. metadata: {
  88. get: function () {
  89. return this._metadata;
  90. },
  91. set: function (value) {
  92. this._metadata = value;
  93. },
  94. },
  95. group: {
  96. get: function () {
  97. return this._group;
  98. },
  99. set: function (value) {
  100. this._group = value;
  101. },
  102. },
  103. });
  104. function initialize(content, json) {
  105. content._tileset.loadTileset(content._resource, json, content._tile);
  106. content._readyPromise.resolve(content);
  107. }
  108. /**
  109. * Part of the {@link Cesium3DTileContent} interface. <code>Tileset3DTileContent</code>
  110. * always returns <code>false</code> since a tile of this type does not have any features.
  111. */
  112. Tileset3DTileContent.prototype.hasProperty = function (batchId, name) {
  113. return false;
  114. };
  115. /**
  116. * Part of the {@link Cesium3DTileContent} interface. <code>Tileset3DTileContent</code>
  117. * always returns <code>undefined</code> since a tile of this type does not have any features.
  118. */
  119. Tileset3DTileContent.prototype.getFeature = function (batchId) {
  120. return undefined;
  121. };
  122. Tileset3DTileContent.prototype.applyDebugSettings = function (
  123. enabled,
  124. color
  125. ) {};
  126. Tileset3DTileContent.prototype.applyStyle = function (style) {};
  127. Tileset3DTileContent.prototype.update = function (tileset, frameState) {};
  128. Tileset3DTileContent.prototype.isDestroyed = function () {
  129. return false;
  130. };
  131. Tileset3DTileContent.prototype.destroy = function () {
  132. return destroyObject(this);
  133. };
  134. export default Tileset3DTileContent;