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

Tileset3DTileContent.js 2.8KB

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