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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. import DeveloperError from "../Core/DeveloperError.js";
  2. /**
  3. * Controls per-shape behavior for culling and rendering voxel grids.
  4. * This type describes an interface and is not intended to be instantiated directly.
  5. *
  6. * @alias VoxelShape
  7. * @constructor
  8. *
  9. * @see VoxelBoxShape
  10. * @see VoxelEllipsoidShape
  11. * @see VoxelCylinderShape
  12. * @see VoxelShapeType
  13. *
  14. * @private
  15. */
  16. function VoxelShape() {
  17. DeveloperError.throwInstantiationError();
  18. }
  19. Object.defineProperties(VoxelShape.prototype, {
  20. /**
  21. * An oriented bounding box containing the bounded shape.
  22. *
  23. * @memberof VoxelShape.prototype
  24. * @type {OrientedBoundingBox}
  25. * @readonly
  26. * @private
  27. */
  28. orientedBoundingBox: {
  29. get: DeveloperError.throwInstantiationError,
  30. },
  31. /**
  32. * A bounding sphere containing the bounded shape.
  33. *
  34. * @memberof VoxelShape.prototype
  35. * @type {BoundingSphere}
  36. * @readonly
  37. * @private
  38. */
  39. boundingSphere: {
  40. get: DeveloperError.throwInstantiationError,
  41. },
  42. /**
  43. * A transformation matrix containing the bounded shape.
  44. *
  45. * @memberof VoxelShape.prototype
  46. * @type {Matrix4}
  47. * @readonly
  48. * @private
  49. */
  50. boundTransform: {
  51. get: DeveloperError.throwInstantiationError,
  52. },
  53. /**
  54. * A transformation matrix containing the shape, ignoring the bounds.
  55. *
  56. * @memberof VoxelShape.prototype
  57. * @type {Matrix4}
  58. * @readonly
  59. * @private
  60. */
  61. shapeTransform: {
  62. get: DeveloperError.throwInstantiationError,
  63. },
  64. /**
  65. * @memberof VoxelShape.prototype
  66. * @type {Object<string, any>}
  67. * @readonly
  68. * @private
  69. */
  70. shaderUniforms: {
  71. get: DeveloperError.throwInstantiationError,
  72. },
  73. /**
  74. * @memberof VoxelShape.prototype
  75. * @type {Object<string, any>}
  76. * @readonly
  77. * @private
  78. */
  79. shaderDefines: {
  80. get: DeveloperError.throwInstantiationError,
  81. },
  82. /**
  83. * The maximum number of intersections against the shape for any ray direction.
  84. * @memberof VoxelShape.prototype
  85. * @type {number}
  86. * @readonly
  87. * @private
  88. */
  89. shaderMaximumIntersectionsLength: {
  90. get: DeveloperError.throwInstantiationError,
  91. },
  92. });
  93. /**
  94. * Update the shape's state.
  95. * @private
  96. * @param {Matrix4} modelMatrix The model matrix.
  97. * @param {Cartesian3} minBounds The minimum bounds.
  98. * @param {Cartesian3} maxBounds The maximum bounds.
  99. * @param {Cartesian3} [clipMinBounds] The minimum clip bounds.
  100. * @param {Cartesian3} [clipMaxBounds] The maximum clip bounds.
  101. * @returns {boolean} Whether the shape is visible.
  102. */
  103. VoxelShape.prototype.update = DeveloperError.throwInstantiationError;
  104. /**
  105. * Update any view-dependent transforms.
  106. * @private
  107. * @param {FrameState} frameState The frame state.
  108. */
  109. VoxelShape.prototype.updateViewTransforms =
  110. DeveloperError.throwInstantiationError;
  111. /**
  112. * Converts a local coordinate to the shape's UV space.
  113. * @private
  114. * @param {Cartesian3} positionLocal The local coordinate to convert.
  115. * @param {Cartesian3} result The Cartesian3 to store the result in.
  116. * @returns {Cartesian3} The converted UV coordinate.
  117. */
  118. VoxelShape.prototype.convertLocalToShapeUvSpace =
  119. DeveloperError.throwInstantiationError;
  120. /**
  121. * Computes an oriented bounding box for a specified tile.
  122. * @private
  123. * @param {number} tileLevel The tile's level.
  124. * @param {number} tileX The tile's x coordinate.
  125. * @param {number} tileY The tile's y coordinate.
  126. * @param {number} tileZ The tile's z coordinate.
  127. * @param {OrientedBoundingBox} result The oriented bounding box that will be set to enclose the specified tile.
  128. * @returns {OrientedBoundingBox} The oriented bounding box.
  129. */
  130. VoxelShape.prototype.computeOrientedBoundingBoxForTile =
  131. DeveloperError.throwInstantiationError;
  132. /**
  133. * Computes an oriented bounding box for a specified sample within a specified tile.
  134. * @private
  135. * @param {SpatialNode} spatialNode The spatial node containing the sample
  136. * @param {Cartesian3} tileDimensions The size of the tile in number of samples, before padding
  137. * @param {Cartesian3} tileUv The sample coordinate within the tile
  138. * @param {OrientedBoundingBox} result The oriented bounding box that will be set to enclose the specified sample
  139. * @returns {OrientedBoundingBox} The oriented bounding box.
  140. */
  141. VoxelShape.prototype.computeOrientedBoundingBoxForSample =
  142. DeveloperError.throwInstantiationError;
  143. /**
  144. * Defines the minimum bounds of the shape. The meaning can vary per-shape.
  145. *
  146. * @type {Cartesian3}
  147. * @constant
  148. * @readonly
  149. *
  150. * @private
  151. */
  152. VoxelShape.DefaultMinBounds = DeveloperError.throwInstantiationError;
  153. /**
  154. * Defines the maximum bounds of the shape. The meaning can vary per-shape.
  155. *
  156. * @type {Cartesian3}
  157. * @constant
  158. * @readonly
  159. *
  160. * @private
  161. */
  162. VoxelShape.DefaultMaxBounds = DeveloperError.throwInstantiationError;
  163. export default VoxelShape;