智慧水务管理系统 - 精河县供水工程综合管理平台

Empty3DTileContent.js 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. * @implements Cesium3DTileContent
  12. * @private
  13. */
  14. class Empty3DTileContent {
  15. constructor(tileset, tile) {
  16. this._tileset = tileset;
  17. this._tile = tile;
  18. this.featurePropertiesDirty = false;
  19. }
  20. get featuresLength() {
  21. return 0;
  22. }
  23. get pointsLength() {
  24. return 0;
  25. }
  26. get trianglesLength() {
  27. return 0;
  28. }
  29. get geometryByteLength() {
  30. return 0;
  31. }
  32. get texturesByteLength() {
  33. return 0;
  34. }
  35. get batchTableByteLength() {
  36. return 0;
  37. }
  38. get innerContents() {
  39. return undefined;
  40. }
  41. /**
  42. * Returns true when the tile's content is ready to render; otherwise false
  43. *
  44. *
  45. * @type {boolean}
  46. * @readonly
  47. * @private
  48. */
  49. get ready() {
  50. return true;
  51. }
  52. get tileset() {
  53. return this._tileset;
  54. }
  55. get tile() {
  56. return this._tile;
  57. }
  58. get url() {
  59. return undefined;
  60. }
  61. get metadata() {
  62. return undefined;
  63. }
  64. set metadata(value) {
  65. //>>includeStart('debug', pragmas.debug);
  66. throw new DeveloperError("Empty3DTileContent cannot have content metadata");
  67. //>>includeEnd('debug');
  68. }
  69. get batchTable() {
  70. return undefined;
  71. }
  72. get group() {
  73. return undefined;
  74. }
  75. set group(value) {
  76. //>>includeStart('debug', pragmas.debug);
  77. throw new DeveloperError("Empty3DTileContent cannot have group metadata");
  78. //>>includeEnd('debug');
  79. }
  80. /**
  81. * Part of the {@link Cesium3DTileContent} interface. <code>Empty3DTileContent</code>
  82. * always returns <code>false</code> since a tile of this type does not have any features.
  83. */
  84. hasProperty(batchId, name) {
  85. return false;
  86. }
  87. /**
  88. * Part of the {@link Cesium3DTileContent} interface. <code>Empty3DTileContent</code>
  89. * always returns <code>undefined</code> since a tile of this type does not have any features.
  90. */
  91. getFeature(batchId) {
  92. return undefined;
  93. }
  94. applyDebugSettings(enabled, color) {}
  95. applyStyle(style) {}
  96. update(tileset, frameState) {}
  97. pick(ray, frameState, result) {
  98. return undefined;
  99. }
  100. isDestroyed() {
  101. return false;
  102. }
  103. destroy() {
  104. return destroyObject(this);
  105. }
  106. }
  107. export default Empty3DTileContent;