Empty3DTileContent.js 3.0 KB

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