Empty3DTileContent.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import destroyObject from "../Core/destroyObject.js";
  2. /**
  3. * Represents empty content for tiles in a
  4. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset that
  5. * do not have content, e.g., because they are used to optimize hierarchical culling.
  6. * <p>
  7. * Implements the {@link Cesium3DTileContent} interface.
  8. * </p>
  9. *
  10. * @alias Empty3DTileContent
  11. * @constructor
  12. *
  13. * @private
  14. */
  15. function Empty3DTileContent(tileset, tile) {
  16. this._tileset = tileset;
  17. this._tile = tile;
  18. this.featurePropertiesDirty = false;
  19. }
  20. Object.defineProperties(Empty3DTileContent.prototype, {
  21. featuresLength: {
  22. get: function () {
  23. return 0;
  24. },
  25. },
  26. pointsLength: {
  27. get: function () {
  28. return 0;
  29. },
  30. },
  31. trianglesLength: {
  32. get: function () {
  33. return 0;
  34. },
  35. },
  36. geometryByteLength: {
  37. get: function () {
  38. return 0;
  39. },
  40. },
  41. texturesByteLength: {
  42. get: function () {
  43. return 0;
  44. },
  45. },
  46. batchTableByteLength: {
  47. get: function () {
  48. return 0;
  49. },
  50. },
  51. innerContents: {
  52. get: function () {
  53. return undefined;
  54. },
  55. },
  56. readyPromise: {
  57. get: function () {
  58. return undefined;
  59. },
  60. },
  61. tileset: {
  62. get: function () {
  63. return this._tileset;
  64. },
  65. },
  66. tile: {
  67. get: function () {
  68. return this._tile;
  69. },
  70. },
  71. url: {
  72. get: function () {
  73. return undefined;
  74. },
  75. },
  76. batchTable: {
  77. get: function () {
  78. return undefined;
  79. },
  80. },
  81. });
  82. /**
  83. * Part of the {@link Cesium3DTileContent} interface. <code>Empty3DTileContent</code>
  84. * always returns <code>false</code> since a tile of this type does not have any features.
  85. */
  86. Empty3DTileContent.prototype.hasProperty = function (batchId, name) {
  87. return false;
  88. };
  89. /**
  90. * Part of the {@link Cesium3DTileContent} interface. <code>Empty3DTileContent</code>
  91. * always returns <code>undefined</code> since a tile of this type does not have any features.
  92. */
  93. Empty3DTileContent.prototype.getFeature = function (batchId) {
  94. return undefined;
  95. };
  96. Empty3DTileContent.prototype.applyDebugSettings = function (enabled, color) {};
  97. Empty3DTileContent.prototype.applyStyle = function (style) {};
  98. Empty3DTileContent.prototype.update = function (tileset, frameState) {};
  99. Empty3DTileContent.prototype.isDestroyed = function () {
  100. return false;
  101. };
  102. Empty3DTileContent.prototype.destroy = function () {
  103. return destroyObject(this);
  104. };
  105. export default Empty3DTileContent;