@itwin/core-common 4.1.0-dev.8 → 4.1.0-dev.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +83 -1
  2. package/lib/cjs/BriefcaseTypes.d.ts +13 -1
  3. package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
  4. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  5. package/lib/cjs/ChangedElements.d.ts +2 -0
  6. package/lib/cjs/ChangedElements.d.ts.map +1 -1
  7. package/lib/cjs/ChangedElements.js +2 -0
  8. package/lib/cjs/ChangedElements.js.map +1 -1
  9. package/lib/cjs/ConcurrentQuery.d.ts +26 -2
  10. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  11. package/lib/cjs/ConcurrentQuery.js +29 -3
  12. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  13. package/lib/cjs/DisplayStyleSettings.d.ts +1 -15
  14. package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
  15. package/lib/cjs/DisplayStyleSettings.js +1 -15
  16. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  17. package/lib/cjs/ECSqlReader.d.ts +164 -7
  18. package/lib/cjs/ECSqlReader.d.ts.map +1 -1
  19. package/lib/cjs/ECSqlReader.js +124 -12
  20. package/lib/cjs/ECSqlReader.js.map +1 -1
  21. package/lib/cjs/ElementProps.d.ts +2 -2
  22. package/lib/cjs/ElementProps.js.map +1 -1
  23. package/lib/cjs/EntityProps.js +2 -2
  24. package/lib/cjs/EntityProps.js.map +1 -1
  25. package/lib/cjs/FeatureIndex.d.ts +50 -4
  26. package/lib/cjs/FeatureIndex.d.ts.map +1 -1
  27. package/lib/cjs/FeatureIndex.js +44 -4
  28. package/lib/cjs/FeatureIndex.js.map +1 -1
  29. package/lib/cjs/FeatureTable.d.ts +44 -20
  30. package/lib/cjs/FeatureTable.d.ts.map +1 -1
  31. package/lib/cjs/FeatureTable.js +17 -2
  32. package/lib/cjs/FeatureTable.js.map +1 -1
  33. package/lib/cjs/IModel.d.ts +1 -1
  34. package/lib/cjs/IModel.d.ts.map +1 -1
  35. package/lib/cjs/IModel.js +1 -1
  36. package/lib/cjs/IModel.js.map +1 -1
  37. package/lib/cjs/QPoint.d.ts +3 -3
  38. package/lib/cjs/QPoint.js +3 -3
  39. package/lib/cjs/QPoint.js.map +1 -1
  40. package/lib/cjs/Render.d.ts +27 -35
  41. package/lib/cjs/Render.d.ts.map +1 -1
  42. package/lib/cjs/Render.js +4 -67
  43. package/lib/cjs/Render.js.map +1 -1
  44. package/lib/cjs/RpcInterface.d.ts +1 -1
  45. package/lib/cjs/RpcInterface.d.ts.map +1 -1
  46. package/lib/cjs/RpcInterface.js +26 -25
  47. package/lib/cjs/RpcInterface.js.map +1 -1
  48. package/lib/cjs/SkyBox.d.ts +3 -3
  49. package/lib/cjs/SkyBox.d.ts.map +1 -1
  50. package/lib/cjs/SkyBox.js +3 -3
  51. package/lib/cjs/SkyBox.js.map +1 -1
  52. package/lib/cjs/ViewFlags.d.ts +4 -4
  53. package/lib/cjs/ViewFlags.d.ts.map +1 -1
  54. package/lib/cjs/ViewFlags.js +4 -4
  55. package/lib/cjs/ViewFlags.js.map +1 -1
  56. package/lib/cjs/ViewProps.d.ts +429 -5
  57. package/lib/cjs/ViewProps.d.ts.map +1 -1
  58. package/lib/cjs/ViewProps.js +16 -0
  59. package/lib/cjs/ViewProps.js.map +1 -1
  60. package/lib/cjs/geometry/AreaPattern.js +2 -2
  61. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  62. package/lib/cjs/geometry/ElementGeometry.d.ts +6 -6
  63. package/lib/cjs/geometry/ElementGeometry.js +1 -1
  64. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  65. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +4 -2
  66. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  67. package/lib/cjs/rpc/IModelReadRpcInterface.js +6 -4
  68. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  69. package/lib/cjs/rpc/core/RpcInvocation.d.ts +2 -0
  70. package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
  71. package/lib/cjs/rpc/core/RpcInvocation.js +1 -0
  72. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  73. package/lib/cjs/rpc/core/RpcMarshaling.js +2 -2
  74. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  75. package/lib/cjs/rpc/web/WebAppRpcProtocol.js +1 -1
  76. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  77. package/lib/cjs/tile/GltfTileIO.d.ts.map +1 -1
  78. package/lib/cjs/tile/GltfTileIO.js +2 -0
  79. package/lib/cjs/tile/GltfTileIO.js.map +1 -1
  80. package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
  81. package/lib/cjs/tile/IModelTileIO.js +2 -2
  82. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  83. package/lib/cjs/tile/TileMetadata.d.ts +14 -13
  84. package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
  85. package/lib/cjs/tile/TileMetadata.js +56 -44
  86. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  87. package/lib/esm/BriefcaseTypes.d.ts +13 -1
  88. package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
  89. package/lib/esm/BriefcaseTypes.js.map +1 -1
  90. package/lib/esm/ChangedElements.d.ts +2 -0
  91. package/lib/esm/ChangedElements.d.ts.map +1 -1
  92. package/lib/esm/ChangedElements.js +2 -0
  93. package/lib/esm/ChangedElements.js.map +1 -1
  94. package/lib/esm/ConcurrentQuery.d.ts +26 -2
  95. package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
  96. package/lib/esm/ConcurrentQuery.js +29 -3
  97. package/lib/esm/ConcurrentQuery.js.map +1 -1
  98. package/lib/esm/DisplayStyleSettings.d.ts +1 -15
  99. package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
  100. package/lib/esm/DisplayStyleSettings.js +1 -15
  101. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  102. package/lib/esm/ECSqlReader.d.ts +164 -7
  103. package/lib/esm/ECSqlReader.d.ts.map +1 -1
  104. package/lib/esm/ECSqlReader.js +124 -12
  105. package/lib/esm/ECSqlReader.js.map +1 -1
  106. package/lib/esm/ElementProps.d.ts +2 -2
  107. package/lib/esm/ElementProps.js.map +1 -1
  108. package/lib/esm/EntityProps.js +2 -2
  109. package/lib/esm/EntityProps.js.map +1 -1
  110. package/lib/esm/FeatureIndex.d.ts +50 -4
  111. package/lib/esm/FeatureIndex.d.ts.map +1 -1
  112. package/lib/esm/FeatureIndex.js +44 -4
  113. package/lib/esm/FeatureIndex.js.map +1 -1
  114. package/lib/esm/FeatureTable.d.ts +44 -20
  115. package/lib/esm/FeatureTable.d.ts.map +1 -1
  116. package/lib/esm/FeatureTable.js +17 -2
  117. package/lib/esm/FeatureTable.js.map +1 -1
  118. package/lib/esm/IModel.d.ts +1 -1
  119. package/lib/esm/IModel.d.ts.map +1 -1
  120. package/lib/esm/IModel.js +1 -1
  121. package/lib/esm/IModel.js.map +1 -1
  122. package/lib/esm/QPoint.d.ts +3 -3
  123. package/lib/esm/QPoint.js +3 -3
  124. package/lib/esm/QPoint.js.map +1 -1
  125. package/lib/esm/Render.d.ts +27 -35
  126. package/lib/esm/Render.d.ts.map +1 -1
  127. package/lib/esm/Render.js +3 -64
  128. package/lib/esm/Render.js.map +1 -1
  129. package/lib/esm/RpcInterface.d.ts +1 -1
  130. package/lib/esm/RpcInterface.d.ts.map +1 -1
  131. package/lib/esm/RpcInterface.js +26 -25
  132. package/lib/esm/RpcInterface.js.map +1 -1
  133. package/lib/esm/SkyBox.d.ts +3 -3
  134. package/lib/esm/SkyBox.d.ts.map +1 -1
  135. package/lib/esm/SkyBox.js +3 -3
  136. package/lib/esm/SkyBox.js.map +1 -1
  137. package/lib/esm/ViewFlags.d.ts +4 -4
  138. package/lib/esm/ViewFlags.d.ts.map +1 -1
  139. package/lib/esm/ViewFlags.js +4 -4
  140. package/lib/esm/ViewFlags.js.map +1 -1
  141. package/lib/esm/ViewProps.d.ts +429 -5
  142. package/lib/esm/ViewProps.d.ts.map +1 -1
  143. package/lib/esm/ViewProps.js +15 -1
  144. package/lib/esm/ViewProps.js.map +1 -1
  145. package/lib/esm/geometry/AreaPattern.js +2 -2
  146. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  147. package/lib/esm/geometry/ElementGeometry.d.ts +6 -6
  148. package/lib/esm/geometry/ElementGeometry.js +1 -1
  149. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  150. package/lib/esm/rpc/IModelReadRpcInterface.d.ts +4 -2
  151. package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  152. package/lib/esm/rpc/IModelReadRpcInterface.js +6 -4
  153. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  154. package/lib/esm/rpc/core/RpcInvocation.d.ts +2 -0
  155. package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
  156. package/lib/esm/rpc/core/RpcInvocation.js +1 -0
  157. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  158. package/lib/esm/rpc/core/RpcMarshaling.js +2 -2
  159. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  160. package/lib/esm/rpc/web/WebAppRpcProtocol.js +1 -1
  161. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  162. package/lib/esm/tile/GltfTileIO.d.ts.map +1 -1
  163. package/lib/esm/tile/GltfTileIO.js +2 -0
  164. package/lib/esm/tile/GltfTileIO.js.map +1 -1
  165. package/lib/esm/tile/IModelTileIO.d.ts +2 -2
  166. package/lib/esm/tile/IModelTileIO.js +2 -2
  167. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  168. package/lib/esm/tile/TileMetadata.d.ts +14 -13
  169. package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
  170. package/lib/esm/tile/TileMetadata.js +57 -45
  171. package/lib/esm/tile/TileMetadata.js.map +1 -1
  172. package/package.json +11 -29
@@ -1 +1 @@
1
- {"version":3,"file":"QPoint.js","sourceRoot":"","sources":["../../src/QPoint.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAiE;AACjE,wDAE8B;AAE9B;;;;;;;;;;GAUG;AACH,IAAiB,YAAY,CAqC5B;AArCD,WAAiB,YAAY;IACd,yBAAY,GAAG,MAAM,CAAC;IACtB,wBAAW,GAAG,IAAI,CAAC;IAEhC,8FAA8F;IAC9F,SAAgB,YAAY,CAAC,MAAc,EAAE,UAAU,GAAG,aAAA,YAAY;QACpE,OAAO,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,GAAG,MAAM,CAAC;IACvD,CAAC;IAFe,yBAAY,eAE3B,CAAA;IAED,gBAAgB;IAChB,SAAgB,SAAS,CAAC,IAAY,EAAE,UAAU,GAAG,aAAA,YAAY;QAC/D,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,UAAU,GAAG,GAAG,CAAC;IAChD,CAAC;IAFe,sBAAS,YAExB,CAAA;IAED;;OAEG;IACH,SAAgB,QAAQ,CAAC,GAAW,EAAE,MAAc,EAAE,KAAa,EAAE,UAAU,GAAG,aAAA,YAAY;QAC5F,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvF,CAAC;IAFe,qBAAQ,WAEvB,CAAA;IAED,gBAAgB;IAChB,SAAgB,aAAa,CAAC,GAAW,EAAE,MAAc,EAAE,KAAa,EAAE,UAAU,GAAG,aAAA,YAAY;QACjG,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,EAA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AG,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC;IAED,wGAAwG;IACjG,MAAM;QACX,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;SACnC,CAAC;IACJ,CAAC;CACF;AAhED,sDAgEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { assert, Uint16ArrayBuilder } from \"@itwin/core-bentley\";\r\nimport {\r\n Point2d, Point3d, Range2d, Range3d, Vector2d, Vector3d, XAndY, XYAndZ,\r\n} from \"@itwin/core-geometry\";\r\n\r\n/**\r\n * Provides facilities for quantizing floating point values within a specified range into 16-bit unsigned integers.\r\n * This is a lossy compression technique.\r\n * Given a floating point range [min, max], a floating point value `x` within that range is quantized by subtracting\r\n * `min`, scaling the result according to `max`, and truncating the result to an integer.\r\n * Therefore min quantizes to 0, max to 0xffff, (min+max)/2 to 0x7fff, and so on.\r\n * These routines are chiefly used by classes like [[QPoint2d]] and [[QPoint3d]] to reduce the space required to store\r\n * coordinate values for [RenderGraphic]($frontend)s.\r\n * @public\r\n * @extensions\r\n */\r\nexport namespace Quantization {\r\n export const rangeScale16 = 0xffff;\r\n export const rangeScale8 = 0xff;\r\n\r\n /** Compute the scale factor required to quantize `extent` to `rangeScale` discrete values. */\r\n export function computeScale(extent: number, rangeScale = rangeScale16): number {\r\n return 0.0 === extent ? extent : rangeScale / extent;\r\n }\r\n\r\n /** @internal */\r\n export function isInRange(qpos: number, rangeScale = rangeScale16): boolean {\r\n return qpos >= 0.0 && qpos < rangeScale + 1.0;\r\n }\r\n\r\n /** Return `pos` quantized to the range [`origin`, `origin + rangeScale`].\r\n * @see [[Quantization.unquantize]] for the inverse operation.\r\n */\r\n export function quantize(pos: number, origin: number, scale: number, rangeScale = rangeScale16): number {\r\n return Math.floor(Math.max(0.0, Math.min(rangeScale, 0.5 + (pos - origin) * scale)));\r\n }\r\n\r\n /** @internal */\r\n export function isQuantizable(pos: number, origin: number, scale: number, rangeScale = rangeScale16) {\r\n return isInRange(quantize(pos, origin, scale, rangeScale));\r\n }\r\n\r\n /** Give `qpos` quantized to the range [`origin`, `origin + rangeScale`], return the unquantized value.\r\n * @see [[Quantization.quantize]] for the inverse operation.\r\n */\r\n export function unquantize(qpos: number, origin: number, scale: number): number {\r\n return 0.0 === scale ? origin : origin + qpos / scale;\r\n }\r\n\r\n /** @internal */\r\n export function isQuantized(qpos: number) {\r\n return isInRange(qpos) && qpos === Math.floor(qpos);\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport interface QParams2dProps {\r\n origin: XAndY;\r\n scale: XAndY;\r\n}\r\n\r\n/** Parameters used for [[Quantization]] of 2d points such that the `x` and `y` components are each quantized to 16-bit unsigned integers.\r\n * @see [[QPoint2d]] for the quantized representation of a [Point2d]($core-geometry).\r\n * @see [[QPoint2dList]] for a list of [[QPoint2d]]s quantized using a [[QParams2d]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class QParams2d {\r\n /** The origin of the quantization range. */\r\n public readonly origin = new Point2d();\r\n /** The scale applied to coordinates to quantize them. */\r\n public readonly scale = new Point2d();\r\n\r\n private constructor(ox = 0, oy = 0, sx = 0, sy = 0) { this.setFrom(ox, oy, sx, sy); }\r\n\r\n private setFrom(ox: number, oy: number, sx: number, sy: number) {\r\n this.origin.x = ox;\r\n this.origin.y = oy;\r\n this.scale.x = sx;\r\n this.scale.y = sy;\r\n }\r\n\r\n /** Set [[origin]] and [[scale]] from `src`. */\r\n public copyFrom(src: QParams2d): void {\r\n this.setFrom(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\r\n }\r\n\r\n /** Create a copy of these params.\r\n * @param out If supplied, these QParams2d will be modified and returned; otherwise a new QParams2d object will be created and returned.\r\n */\r\n public clone(out?: QParams2d): QParams2d {\r\n const result = undefined !== out ? out : new QParams2d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /** Initialize these parameters to support quantization of values within the specified range. */\r\n public setFromRange(range: Range2d, rangeScale = Quantization.rangeScale16) {\r\n if (!range.isNull) {\r\n this.setFrom(range.low.x, range.low.y, Quantization.computeScale(range.high.x - range.low.x, rangeScale), Quantization.computeScale(range.high.y - range.low.y, rangeScale));\r\n } else {\r\n this.origin.x = this.origin.y = this.scale.x = this.scale.y = 0;\r\n }\r\n }\r\n\r\n /** Create parameters to support quantization of values within the specified range. */\r\n public static fromRange(range: Range2d, out?: QParams2d, rangeScale = Quantization.rangeScale16) {\r\n const params = undefined !== out ? out : new QParams2d();\r\n params.setFromRange(range, rangeScale);\r\n return params;\r\n }\r\n\r\n /** Return the unquantized point for the input `x` and `y` components. If `out` is supplied, it will be modified to hold the result and returned. */\r\n public unquantize(x: number, y: number, out?: Point2d): Point2d {\r\n out = out ?? new Point2d();\r\n out.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\r\n out.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\r\n return out;\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0], appropriate for normalized 2d vectors. */\r\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\r\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(-1, -1), Point2d.create(1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** Create parameters supporting quantization of values within the range [0.0, 1.0]. */\r\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\r\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(0, 0), Point2d.create(1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** Create parameters from origin and scale components */\r\n public static fromOriginAndScale(originX: number, originY: number, scaleX: number, scaleY: number) {\r\n return new QParams2d(originX, originY, scaleX, scaleY);\r\n }\r\n\r\n /** @internal */\r\n public get rangeDiagonal(): Vector2d {\r\n return Vector2d.createFrom({ x: 0 === this.scale.x ? 0 : Quantization.rangeScale16 / this.scale.x, y: 0 === this.scale.y ? 0 : Quantization.rangeScale16 / this.scale.y });\r\n }\r\n\r\n /** Return true if the point point is quantizable using these parameters. */\r\n public isQuantizable(point: Point2d) {\r\n return Quantization.isQuantizable(point.x, this.origin.x, this.scale.x) && Quantization.isQuantizable(point.y, this.origin.y, this.scale.y);\r\n }\r\n\r\n /** @alpha */\r\n public toJSON(): QParams2dProps {\r\n return {\r\n origin: { x: this.origin.x, y: this.origin.y },\r\n scale: { x: this.scale.x, y: this.scale.y },\r\n };\r\n }\r\n\r\n /** @alpha */\r\n public static fromJSON(src: QParams2dProps): QParams2d {\r\n return this.fromOriginAndScale(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\r\n }\r\n}\r\n\r\n/** Represents a [Point2d]($core-geometry) compressed such that each component `x` and `y` is quantized to the 16-bit integer range [0, 0xffff].\r\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\r\n * @see [[QParams2d]] to define quantization parameters for a range of points.\r\n * @see [[QPoint2dList]] for a list of points all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint2d {\r\n private _x: number = 0;\r\n private _y: number = 0;\r\n\r\n /** The quantized x component. */\r\n public get x() { return this._x; }\r\n public set x(x: number) {\r\n assert(Quantization.isQuantized(x));\r\n this._x = x;\r\n }\r\n\r\n /** The quantized y component. */\r\n public get y() { return this._y; }\r\n public set y(y: number) {\r\n assert(Quantization.isQuantized(y));\r\n this._y = y;\r\n }\r\n\r\n /** Construct with `x` and `y` initialized to zero. */\r\n public constructor() { }\r\n\r\n /** Initialize this point by quantizing the supplied { x, y } using the specified params */\r\n public init(pos: XAndY, params: QParams2d) {\r\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\r\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\r\n }\r\n\r\n /** Create a quantized point from the supplied Point2d using the specified params */\r\n public static create(pos: Point2d, params: QParams2d) {\r\n const qpt = new QPoint2d();\r\n qpt.init(pos, params);\r\n return qpt;\r\n }\r\n\r\n /** Initialize `x` and `y` from `src`. */\r\n public copyFrom(src: QPoint2d) {\r\n this.x = src.x;\r\n this.y = src.y;\r\n }\r\n\r\n /** Create a copy of this point.\r\n * @param out If supplied, it will be modified in-place and returned; otherwise a new QPoint2d will be allocated and returned.\r\n */\r\n public clone(out?: QPoint2d) {\r\n const result = undefined !== out ? out : new QPoint2d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the x and y components directly.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n */\r\n public setFromScalars(x: number, y: number) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n\r\n /**\r\n * Create a QPoint2d directly from x and y components.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n */\r\n public static fromScalars(x: number, y: number) {\r\n const pt = new QPoint2d();\r\n pt.setFromScalars(x, y);\r\n return pt;\r\n }\r\n\r\n /** Return a Point2d unquantized according to the supplied `params`. If `out` is supplied, it will be modified in-place and returned. */\r\n public unquantize(params: QParams2d, out?: Point2d): Point2d {\r\n const pt: Point2d = undefined !== out ? out : new Point2d();\r\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\r\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\r\n return pt;\r\n }\r\n}\r\n\r\n/** A compact representation of a list of [[QPoint2d]]s stored in a `Uint16Array`\r\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.uvs]($frontend).\r\n * @see [[QPoint3dBuffer]] for 3d points.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface QPoint2dBuffer {\r\n /** The parameters used to quantize the [[points]]. */\r\n params: QParams2d;\r\n /** The [[QPoint2d]]s as pairs of unsigned 16-bit integers. The length must be a multiple of 2; the number of points in the array is half the array's length.\r\n * To obtain the `n`th point, use `QPoint2d.fromScalars(buffer.points[n * 2], buffer.points[n * 2 + 1])`.\r\n */\r\n points: Uint16Array;\r\n}\r\n\r\n/** @public\r\n * @extensions\r\n */\r\nexport namespace QPoint2dBuffer {\r\n const scratchQPoint2d = new QPoint2d();\r\n\r\n /** Extracts the point at the specified index from a buffer.\r\n * @param points The buffer in which each consecutive pair of integers is a 2d quantized point.\r\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [[QPoint2d]] to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint2d): QPoint2d {\r\n const index = pointIndex * 2;\r\n const x = points[index + 0];\r\n const y = points[index + 1];\r\n if (undefined === x || undefined === y)\r\n throw new Error(\"Index out of range\");\r\n\r\n result = result ?? new QPoint2d();\r\n result.setFromScalars(x, y);\r\n return result;\r\n }\r\n\r\n /** Extracts and unquantizes the point at the specified index from a buffer.\r\n * @param buffer The array of points and the quantization parameters.\r\n * @param The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [Point2d]($core-geometry) to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function unquantizePoint(buffer: QPoint2dBuffer, pointIndex: number, result?: Point2d): Point2d {\r\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint2d);\r\n return qpt.unquantize(buffer.params, result);\r\n }\r\n}\r\n\r\n/** A list of [[QPoint2d]]s all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint2dList {\r\n /** Parameters used to quantize the points. */\r\n public readonly params: QParams2d;\r\n private readonly _list = new Array<QPoint2d>();\r\n\r\n /** The list of quantized points. */\r\n public get list(): ReadonlyArray<QPoint2d> {\r\n return this._list;\r\n }\r\n\r\n /** Construct an empty list set up to use the supplied quantization parameters. */\r\n public constructor(params: QParams2d) {\r\n this.params = params.clone();\r\n }\r\n\r\n /** Removes all points from the list. */\r\n public clear() {\r\n this._list.length = 0;\r\n }\r\n\r\n /** Removes all points from the list and change the quantization parameters. */\r\n public reset(params: QParams2d) {\r\n this.clear();\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Quantizes the supplied Point2d to this list's range and appends it to the list. */\r\n public add(pt: Point2d) {\r\n this._list.push(QPoint2d.create(pt, this.params));\r\n }\r\n\r\n /** Adds a previously-quantized point to this list. */\r\n public push(qpt: QPoint2d) {\r\n this._list.push(qpt.clone());\r\n }\r\n\r\n /** The number of points in the list. */\r\n public get length() {\r\n return this._list.length;\r\n }\r\n\r\n /** Returns the unquantized value of the point at the specified index in the list. */\r\n public unquantize(index: number, out?: Point2d): Point2d {\r\n assert(index < this.length);\r\n if (index < this.length) {\r\n return this._list[index].unquantize(this.params, out);\r\n } else {\r\n return undefined !== out ? out : new Point2d();\r\n }\r\n }\r\n\r\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\r\n * @note The loss of precision is compounded each time the points are requantized to a new range.\r\n */\r\n public requantize(params: QParams2d) {\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = this.unquantize(i);\r\n this._list[i].init(pt, params);\r\n }\r\n\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Extracts the current contents of the list as a Uint16Array such that the first element of the array corresponds to the first point's `x` component,\r\n * the second to the first point's `y` component, and so on.\r\n */\r\n public toTypedArray(): Uint16Array {\r\n const array = new Uint16Array(this.length * 2);\r\n const pts = this._list;\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = pts[i];\r\n array[i * 2] = pt.x;\r\n array[i * 2 + 1] = pt.y;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n /** Create from a Uint16Array laid out such that `array[0]` corresponds to the first point's `x` component, `array[1]` to the first point's `y` component, and so on. */\r\n public fromTypedArray(range: Range2d, array: Uint16Array) {\r\n this.params.setFromRange(range);\r\n this._list.length = array.length / 2;\r\n for (let i = 0, j = 0; i < this.list.length; i++)\r\n this._list[i] = QPoint2d.fromScalars(array[j++], array[j++]);\r\n }\r\n\r\n /** Construct a QPoint2dList containing all points in the supplied list, quantized to the range of those points. */\r\n public static fromPoints(points: Point2d[], out?: QPoint2dList) {\r\n let qPoints;\r\n const qParams = QParams2d.fromRange(Range2d.createArray(points));\r\n if (out) {\r\n qPoints = out;\r\n qPoints.reset(qParams);\r\n } else {\r\n qPoints = new QPoint2dList(qParams);\r\n }\r\n\r\n for (const point of points)\r\n qPoints.add(point);\r\n\r\n return qPoints;\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport interface QParams3dProps {\r\n origin: XYAndZ;\r\n scale: XYAndZ;\r\n}\r\n\r\n/** Parameters used for [[Quantization]] of 3d points such that the `x`, `y`, and `z` components are each quantized to 16-bit unsigned integers.\r\n * @see [[QPoint3d]] for the quantized representation of a [Point3d]($core-geometry).\r\n * @see [[QPoint3dList]] for a list of [[QPoint3d]]s quantized using a [[QParams3d]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class QParams3d {\r\n /** The origin of the quantization range. */\r\n public readonly origin = new Point3d();\r\n /** The scale applied to coordinates to quantize them. */\r\n public readonly scale = new Point3d();\r\n\r\n private constructor(ox = 0, oy = 0, oz = 0, sx = 0, sy = 0, sz = 0) {\r\n this.setFrom(ox, oy, oz, sx, sy, sz);\r\n }\r\n\r\n private setFrom(ox: number, oy: number, oz: number, sx: number, sy: number, sz: number) {\r\n this.origin.x = ox;\r\n this.origin.y = oy;\r\n this.origin.z = oz;\r\n this.scale.x = sx;\r\n this.scale.y = sy;\r\n this.scale.z = sz;\r\n }\r\n\r\n /** Set `x`, `y`, and `z` from `src. */\r\n public copyFrom(src: QParams3d): void {\r\n this.setFrom(src.origin.x, src.origin.y, src.origin.z, src.scale.x, src.scale.y, src.scale.z);\r\n }\r\n\r\n /** Create a copy of these parameters.\r\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\r\n */\r\n public clone(out?: QParams3d): QParams3d {\r\n const result = undefined !== out ? out : new QParams3d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /** Initialize from origin and scale */\r\n public setFromOriginAndScale(origin: Point3d, scale: Point3d) {\r\n this.setFrom(origin.x, origin.y, origin.z, scale.x, scale.y, scale.z);\r\n }\r\n\r\n /** Initialize these parameters to support quantization of values within the specified range. */\r\n public setFromRange(range: Range3d, rangeScale = Quantization.rangeScale16) {\r\n if (!range.isNull) {\r\n this.setFrom(range.low.x, range.low.y, range.low.z,\r\n Quantization.computeScale(range.high.x - range.low.x, rangeScale), Quantization.computeScale(range.high.y - range.low.y, rangeScale), Quantization.computeScale(range.high.z - range.low.z, rangeScale));\r\n } else {\r\n this.origin.x = this.origin.y = this.origin.z = 0;\r\n this.scale.x = this.scale.y = this.scale.z = 0;\r\n }\r\n }\r\n\r\n /** Return the unquantized point for the input components.\r\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new Point3d.\r\n */\r\n public unquantize(x: number, y: number, z: number, out?: Point3d): Point3d {\r\n const pt: Point3d = undefined !== out ? out : new Point3d();\r\n pt.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\r\n pt.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\r\n pt.z = Quantization.unquantize(z, this.origin.z, this.scale.z);\r\n return pt;\r\n }\r\n\r\n /** Creates parameters to support quantization of values within the specified range.\r\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\r\n */\r\n public static fromRange(range: Range3d, out?: QParams3d, rangeScale = Quantization.rangeScale16): QParams3d {\r\n const params = undefined !== out ? out : new QParams3d();\r\n params.setFromRange(range, rangeScale);\r\n return params;\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0].\r\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\r\n */\r\n public static fromOriginAndScale(origin: Point3d, scale: Point3d, out?: QParams3d): QParams3d {\r\n const params = undefined !== out ? out : new QParams3d();\r\n params.setFromOriginAndScale(origin, scale);\r\n return params;\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0]. */\r\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\r\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(-1, -1, -1), Point3d.create(1, 1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [0.0, 1.0]. */\r\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\r\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(0, 0, 0), Point3d.create(1, 1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** @internal */\r\n public get rangeDiagonal(): Vector3d {\r\n return Vector3d.createFrom({\r\n x: this.scale.x === 0 ? 0 : Quantization.rangeScale16 / this.scale.x,\r\n y: this.scale.y === 0 ? 0 : Quantization.rangeScale16 / this.scale.y,\r\n z: this.scale.z === 0 ? 0 : Quantization.rangeScale16 / this.scale.z,\r\n });\r\n }\r\n\r\n /** Return true if the point point is quantizable using these parameters. */\r\n public isQuantizable(point: Point3d) {\r\n return Quantization.isQuantizable(point.x, this.origin.x, this.scale.x) && Quantization.isQuantizable(point.y, this.origin.y, this.scale.y) && Quantization.isQuantizable(point.z, this.origin.z, this.scale.z);\r\n }\r\n\r\n /** Compute the range to which these parameters quantize. */\r\n public computeRange(out?: Range3d): Range3d {\r\n const range = Range3d.createNull(out);\r\n range.extendPoint(this.origin);\r\n range.extendPoint(this.origin.plus(this.rangeDiagonal));\r\n return range;\r\n }\r\n\r\n /** @alpha */\r\n public toJSON(): QParams3dProps {\r\n return {\r\n origin: { x: this.origin.x, y: this.origin.y, z: this.origin.z },\r\n scale: { x: this.scale.x, y: this.scale.y, z: this.scale.z },\r\n };\r\n }\r\n\r\n /** @alpha */\r\n public static fromJSON(src: QParams3dProps, out?: QParams3d): QParams3d {\r\n return this.fromOriginAndScale(Point3d.fromJSON(src.origin), Point3d.fromJSON(src.scale), out);\r\n }\r\n}\r\n\r\n/** Represents a [Point3d]($core-geometry) compressed such that each component `x`, `y`, and `z` is quantized to the 16-bit integer range [0, 0xffff].\r\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\r\n * @see [[QParams3d]] to define quantization parameters for a range of points.\r\n * @see [[QPoint3dList]] for a list of points all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint3d {\r\n private _x: number = 0;\r\n private _y: number = 0;\r\n private _z: number = 0;\r\n\r\n /** The quantized x component. */\r\n public get x() { return this._x; }\r\n public set x(x: number) {\r\n assert(Quantization.isQuantized(x));\r\n this._x = x;\r\n }\r\n\r\n /** The quantized y component. */\r\n public get y() { return this._y; }\r\n public set y(y: number) {\r\n assert(Quantization.isQuantized(y));\r\n this._y = y;\r\n }\r\n\r\n /** The quantized z component. */\r\n public get z() { return this._z; }\r\n public set z(z: number) {\r\n assert(Quantization.isQuantized(z));\r\n this._z = z;\r\n }\r\n\r\n /** Construct with all components initialized to zero. */\r\n public constructor() { }\r\n\r\n /** Initialize this point by quantizing the supplied { x, y, z } using the specified params */\r\n public init(pos: XYAndZ, params: QParams3d): void {\r\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\r\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\r\n this.z = Quantization.quantize(pos.z, params.origin.z, params.scale.z);\r\n }\r\n\r\n /** Creates a quantized point from the supplied Point3d using the specified params */\r\n public static create(pos: Point3d, params: QParams3d): QPoint3d {\r\n const qpt = new QPoint3d();\r\n qpt.init(pos, params);\r\n return qpt;\r\n }\r\n\r\n /** Set this points components from `src`. */\r\n public copyFrom(src: QPoint3d): void {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z;\r\n }\r\n\r\n /** Create a copy of this point.\r\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\r\n */\r\n public clone(out?: QPoint3d): QPoint3d {\r\n const result = undefined !== out ? out : new QPoint3d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the x, y, and z components directly.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n * @param z Must be an integer in the range [0, 0xffff]\r\n */\r\n public setFromScalars(x: number, y: number, z: number) {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n }\r\n\r\n /**\r\n * Creates a QPoint3d directly from x, y, and z components.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n * @param z Must be an integer in the range [0, 0xffff]\r\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\r\n */\r\n public static fromScalars(x: number, y: number, z: number, out?: QPoint3d): QPoint3d {\r\n const pt = undefined === out ? new QPoint3d() : out;\r\n pt.setFromScalars(x, y, z);\r\n return pt;\r\n }\r\n\r\n /** Returns a Point3d unquantized according to the supplied params.\r\n * If `out` is supplied, it will be modified in-place instead of allocating a new Point3d.\r\n */\r\n public unquantize(params: QParams3d, out?: Point3d): Point3d {\r\n const pt: Point3d = undefined !== out ? out : new Point3d();\r\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\r\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\r\n pt.z = Quantization.unquantize(this.z, params.origin.z, params.scale.z);\r\n return pt;\r\n }\r\n\r\n /** Return true if this point's components are identical to the other point's components. */\r\n public equals(other: QPoint3d): boolean {\r\n return this.x === other.x && this.y === other.y && this.z === other.z;\r\n }\r\n\r\n /** Perform ordinal comparison to another point. The function returns:\r\n * - Zero if this point is identical to `rhs`; or\r\n * - A number less than zero if this point is ordered before `rhs`; or\r\n * - A number greater than zero if this point is ordered after `rhs`.\r\n * @see [OrderedComparator]($core-bentley).\r\n */\r\n public compare(rhs: QPoint3d): number {\r\n let diff = this.x - rhs.x;\r\n if (0 === diff) {\r\n diff = this.y - rhs.y;\r\n if (0 === diff) {\r\n diff = this.z - rhs.z;\r\n }\r\n }\r\n\r\n return diff;\r\n }\r\n}\r\n\r\n/** A compact representation of a list of [[QPoint3d]]s stored in a `Uint16Array`.\r\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.positions]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface QPoint3dBuffer {\r\n /** The parameters used to quantize the [[points]]. */\r\n params: QParams3d;\r\n /** The [[QPoint3d]]s as pairs of unsigned 16-bit integers. The length must be a multiple of 3; the number of points in the array is half the array's length.\r\n * To obtain the `n`th point, use `QPoint3d.fromScalars(buffer.points[n * 3], buffer.points[n * 3 + 1], buffer.points[n * 3 + 2])`.\r\n */\r\n points: Uint16Array;\r\n}\r\n\r\n/** @public\r\n * @extensions\r\n */\r\nexport namespace QPoint3dBuffer {\r\n const scratchQPoint3d = new QPoint3d();\r\n\r\n /** Extracts the point at the specified index from a buffer.\r\n * @param points The buffer in which each consecutive pair of integers is a 3d quantized point.\r\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [[QPoint3d]] to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint3d): QPoint3d {\r\n const index = pointIndex * 3;\r\n const x = points[index + 0];\r\n const y = points[index + 1];\r\n const z = points[index + 2];\r\n if (undefined === x || undefined === y || undefined === z)\r\n throw new Error(\"Index out of range\");\r\n\r\n result = result ?? new QPoint3d();\r\n result.setFromScalars(x, y, z);\r\n return result;\r\n }\r\n\r\n /** Extracts and unquantizes the point at the specified index from a buffer.\r\n * @param buffer The array of points and the quantization parameters.\r\n * @param The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [Point3d]($core-geometry) to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function unquantizePoint(buffer: QPoint3dBuffer, pointIndex: number, result?: Point3d): Point3d {\r\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint3d);\r\n return qpt.unquantize(buffer.params, result);\r\n }\r\n}\r\n\r\n/** A list of [[QPoint3d]]s all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint3dList {\r\n /** Parameters used to quantize the points. */\r\n public readonly params: QParams3d;\r\n private readonly _list: QPoint3d[] = [];\r\n\r\n /** The list of quantized points. */\r\n public get list(): ReadonlyArray<QPoint3d> {\r\n return this._list;\r\n }\r\n\r\n /** Construct an empty list set up to quantize to the supplied range.\r\n * @param The quantization parameters. If omitted, a null range will be used.\r\n */\r\n public constructor(params?: QParams3d) {\r\n this.params = params ? params.clone() : QParams3d.fromRange(Range3d.createNull());\r\n }\r\n\r\n /** Construct a QPoint3dList containing all points in the supplied list, quantized to the range of those points.\r\n * @param The points to quantize and add to the list.\r\n * @param out If supplied, it will be cleared, its parameters recomputed, and the points will be added to it; otherwise, a new QPoint3dList will be created and returned.\r\n */\r\n public static fromPoints(points: Point3d[], out?: QPoint3dList): QPoint3dList {\r\n let qPoints;\r\n const qParams = QParams3d.fromRange(Range3d.createArray(points));\r\n if (out) {\r\n qPoints = out;\r\n qPoints.reset(qParams);\r\n } else {\r\n qPoints = new QPoint3dList(qParams);\r\n }\r\n\r\n for (const point of points)\r\n qPoints.add(point);\r\n\r\n return qPoints;\r\n }\r\n\r\n /** Removes all points from the list. */\r\n public clear() {\r\n this._list.length = 0;\r\n }\r\n\r\n /** Clears out the contents of the list and changes the quantization parameters. */\r\n public reset(params: QParams3d) {\r\n this.clear();\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Quantizes the supplied Point3d to this list's range and appends it to the list. */\r\n public add(pt: Point3d) {\r\n this._list.push(QPoint3d.create(pt, this.params));\r\n }\r\n\r\n /** Adds a previously-quantized point to this list. */\r\n public push(qpt: QPoint3d) {\r\n this._list.push(qpt.clone());\r\n }\r\n\r\n /** The number of points in the list. */\r\n public get length() {\r\n return this._list.length;\r\n }\r\n\r\n /** Returns the unquantized value of the point at the specified index in the list. */\r\n public unquantize(index: number, out?: Point3d): Point3d {\r\n assert(index < this.length);\r\n if (index < this.length) {\r\n return this._list[index].unquantize(this.params, out);\r\n } else {\r\n return undefined !== out ? out : new Point3d();\r\n }\r\n }\r\n\r\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\r\n * @note The loss of precision is compounded each time the points are requantized to a new range.\r\n */\r\n public requantize(params: QParams3d): void {\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = this.unquantize(i);\r\n this._list[i].init(pt, params);\r\n }\r\n\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Extracts the current contents of the list as a Uint16Array such that the first 3 elements contain the first point's x, y, and z components,\r\n * the second three elements contain the second point's components, and so on.\r\n */\r\n public toTypedArray(): Uint16Array {\r\n const array = new Uint16Array(this.length * 3);\r\n const pts = this._list;\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = pts[i];\r\n array[i * 3 + 0] = pt.x;\r\n array[i * 3 + 1] = pt.y;\r\n array[i * 3 + 2] = pt.z;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n /** Reinitialize from a Uint16Array in which the first three elements specify the x, y, and z components of the first point, the second three elements specify the components\r\n * of the second point, and so on.\r\n */\r\n public fromTypedArray(range: Range3d, array: Uint16Array): void {\r\n this.params.setFromRange(range);\r\n this._list.length = array.length / 3;\r\n for (let i = 0, j = 0; i < this.list.length; i++)\r\n this._list[i] = QPoint3d.fromScalars(array[j++], array[j++], array[j++]);\r\n }\r\n\r\n /** Construct a list containing all points in the supplied list, quantized using the supplied parameters. */\r\n public static createFrom(points: Point3d[], params: QParams3d): QPoint3dList {\r\n const list = new QPoint3dList(params);\r\n for (const point of points)\r\n list.add(point);\r\n\r\n return list;\r\n }\r\n\r\n /** An iterator over the points in the list. */\r\n public [Symbol.iterator]() {\r\n return this.list[Symbol.iterator]();\r\n }\r\n}\r\n\r\n/** Options used to construct a [[QPoint2dBufferBuilder]].\r\n * @beta\r\n * @extensions\r\n */\r\ninterface QPoint2dBufferBuilderOptions {\r\n /** The range to which the points will be quantized. This must be large enough to contain all of the points that will be added to the buffer. */\r\n range: Range2d;\r\n /** The number of points for which to allocate space.\r\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\r\n */\r\n initialCapacity?: number;\r\n /** Multiplier used to compute new capacity when resizing the buffer.\r\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\r\n */\r\n growthFactor?: number;\r\n}\r\n\r\n/** Constructs a [[QPoint2dBuffer]] using a [Uint16ArrayBuilder]($bentley).\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint2dBufferBuilder {\r\n private readonly _scratchQPoint2d = new QPoint2d();\r\n\r\n /** The parameters used to quantize the points in the [[buffer]]. */\r\n public readonly params: QParams2d;\r\n /** The buffer that holds the points. */\r\n public readonly buffer: Uint16ArrayBuilder;\r\n\r\n /** Construct a new buffer with a [[length]] of zero. */\r\n public constructor(options: QPoint2dBufferBuilderOptions) {\r\n this.params = QParams2d.fromRange(options.range);\r\n const initialCapacity = options.initialCapacity ?? 0;\r\n this.buffer = new Uint16ArrayBuilder({\r\n growthFactor: options.growthFactor,\r\n initialCapacity: 2 * initialCapacity,\r\n });\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public pushXY(x: number, y: number): void {\r\n this.buffer.push(x);\r\n this.buffer.push(y);\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public push(pt: XAndY): void {\r\n this.pushXY(pt.x, pt.y);\r\n }\r\n\r\n /** The number of points currently in the [[buffer]]. */\r\n public get length(): number {\r\n const len = this.buffer.length;\r\n assert(len % 2 === 0);\r\n return len / 2;\r\n }\r\n\r\n /** Returns the quantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [[QPoint2d]] to initialize with the result and return.\r\n * @returns The quantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public get(pointIndex: number, result?: QPoint2d): QPoint2d {\r\n return QPoint2dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\r\n }\r\n\r\n /** Returns the unquantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [Point2d]($core-geometry) to initialize with the result and return.\r\n * @returns The unquantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public unquantize(pointIndex: number, result?: Point2d): Point2d {\r\n return this.get(pointIndex, this._scratchQPoint2d).unquantize(this.params, result);\r\n }\r\n\r\n /** Obtain a [[QPoint2dBuffer]] containing all of the points that have been appended by this builder. */\r\n public finish(): QPoint2dBuffer {\r\n return {\r\n params: this.params,\r\n points: this.buffer.toTypedArray(),\r\n };\r\n }\r\n}\r\n\r\n/** Options used to construct a [[QPoint3dBufferBuilder]].\r\n * @beta\r\n * @extensions\r\n */\r\ninterface QPoint3dBufferBuilderOptions {\r\n /** The range to which the points will be quantized. This must be large enough to contain all of the points that will be added to the buffer. */\r\n range: Range3d;\r\n /** The number of points for which to allocate space.\r\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\r\n */\r\n initialCapacity?: number;\r\n /** Multiplier used to compute new capacity when resizing the buffer.\r\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\r\n */\r\n growthFactor?: number;\r\n}\r\n\r\n/** Constructs a [[QPoint3dBuffer]] using a [Uint16ArrayBuilder]($bentley).\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint3dBufferBuilder {\r\n private readonly _scratchQPoint3d = new QPoint3d();\r\n\r\n /** The parameters used to quantize the points in the [[buffer]]. */\r\n public readonly params: QParams3d;\r\n /** The buffer that holds the points. */\r\n public readonly buffer: Uint16ArrayBuilder;\r\n\r\n /** Construct a new buffer with a [[length]] of zero. */\r\n public constructor(options: QPoint3dBufferBuilderOptions) {\r\n this.params = QParams3d.fromRange(options.range);\r\n const initialCapacity = options.initialCapacity ?? 0;\r\n this.buffer = new Uint16ArrayBuilder({\r\n growthFactor: options.growthFactor,\r\n initialCapacity: 3 * initialCapacity,\r\n });\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public pushXYZ(x: number, y: number, z: number): void {\r\n this.buffer.push(x);\r\n this.buffer.push(y);\r\n this.buffer.push(z);\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public push(pt: XYAndZ): void {\r\n this.pushXYZ(pt.x, pt.y, pt.z);\r\n }\r\n\r\n /** The number of points currently in the [[buffer]]. */\r\n public get length(): number {\r\n const len = this.buffer.length;\r\n assert(len % 3 === 0);\r\n return len / 3;\r\n }\r\n\r\n /** Returns the quantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [[QPoint3d]] to initialize with the result and return.\r\n * @returns The quantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public get(pointIndex: number, result?: QPoint3d): QPoint3d {\r\n return QPoint3dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\r\n }\r\n\r\n /** Returns the unquantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [Point3d]($core-geometry) to initialize with the result and return.\r\n * @returns The unquantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public unquantize(pointIndex: number, result?: Point3d): Point3d {\r\n return this.get(pointIndex, this._scratchQPoint3d).unquantize(this.params, result);\r\n }\r\n\r\n /** Obtain a [[QPoint3dBuffer]] containing all of the points that have been appended by this builder. */\r\n public finish(): QPoint3dBuffer {\r\n return {\r\n params: this.params,\r\n points: this.buffer.toTypedArray(),\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"QPoint.js","sourceRoot":"","sources":["../../src/QPoint.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAiE;AACjE,wDAE8B;AAE9B;;;;;;;;;;GAUG;AACH,IAAiB,YAAY,CAqC5B;AArCD,WAAiB,YAAY;IACd,yBAAY,GAAG,MAAM,CAAC;IACtB,wBAAW,GAAG,IAAI,CAAC;IAEhC,8FAA8F;IAC9F,SAAgB,YAAY,CAAC,MAAc,EAAE,UAAU,GAAG,aAAA,YAAY;QACpE,OAAO,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,GAAG,MAAM,CAAC;IACvD,CAAC;IAFe,yBAAY,eAE3B,CAAA;IAED,gBAAgB;IAChB,SAAgB,SAAS,CAAC,IAAY,EAAE,UAAU,GAAG,aAAA,YAAY;QAC/D,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,UAAU,GAAG,GAAG,CAAC;IAChD,CAAC;IAFe,sBAAS,YAExB,CAAA;IAED;;OAEG;IACH,SAAgB,QAAQ,CAAC,GAAW,EAAE,MAAc,EAAE,KAAa,EAAE,UAAU,GAAG,aAAA,YAAY;QAC5F,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvF,CAAC;IAFe,qBAAQ,WAEvB,CAAA;IAED,gBAAgB;IAChB,SAAgB,aAAa,CAAC,GAAW,EAAE,MAAc,EAAE,KAAa,EAAE,UAAU,GAAG,aAAA,YAAY;QACjG,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,C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B,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC;IAED,wGAAwG;IACjG,MAAM;QACX,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;SACnC,CAAC;IACJ,CAAC;CACF;AAhED,sDAgEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { assert, Uint16ArrayBuilder } from \"@itwin/core-bentley\";\r\nimport {\r\n Point2d, Point3d, Range2d, Range3d, Vector2d, Vector3d, XAndY, XYAndZ,\r\n} from \"@itwin/core-geometry\";\r\n\r\n/**\r\n * Provides facilities for quantizing floating point values within a specified range into 16-bit unsigned integers.\r\n * This is a lossy compression technique.\r\n * Given a floating point range [min, max], a floating point value `x` within that range is quantized by subtracting\r\n * `min`, scaling the result according to `max`, and truncating the result to an integer.\r\n * Therefore min quantizes to 0, max to 0xffff, (min+max)/2 to 0x7fff, and so on.\r\n * These routines are chiefly used by classes like [[QPoint2d]] and [[QPoint3d]] to reduce the space required to store\r\n * coordinate values for [RenderGraphic]($frontend)s.\r\n * @public\r\n * @extensions\r\n */\r\nexport namespace Quantization {\r\n export const rangeScale16 = 0xffff;\r\n export const rangeScale8 = 0xff;\r\n\r\n /** Compute the scale factor required to quantize `extent` to `rangeScale` discrete values. */\r\n export function computeScale(extent: number, rangeScale = rangeScale16): number {\r\n return 0.0 === extent ? extent : rangeScale / extent;\r\n }\r\n\r\n /** @internal */\r\n export function isInRange(qpos: number, rangeScale = rangeScale16): boolean {\r\n return qpos >= 0.0 && qpos < rangeScale + 1.0;\r\n }\r\n\r\n /** Return `pos` quantized to the range [`origin`, `origin + rangeScale`].\r\n * @see [[Quantization.unquantize]] for the inverse operation.\r\n */\r\n export function quantize(pos: number, origin: number, scale: number, rangeScale = rangeScale16): number {\r\n return Math.floor(Math.max(0.0, Math.min(rangeScale, 0.5 + (pos - origin) * scale)));\r\n }\r\n\r\n /** @internal */\r\n export function isQuantizable(pos: number, origin: number, scale: number, rangeScale = rangeScale16) {\r\n return isInRange(quantize(pos, origin, scale, rangeScale));\r\n }\r\n\r\n /** Give `qpos` quantized to the range [`origin`, `origin + rangeScale`], return the unquantized value.\r\n * @see [[Quantization.quantize]] for the inverse operation.\r\n */\r\n export function unquantize(qpos: number, origin: number, scale: number): number {\r\n return 0.0 === scale ? origin : origin + qpos / scale;\r\n }\r\n\r\n /** @internal */\r\n export function isQuantized(qpos: number) {\r\n return isInRange(qpos) && qpos === Math.floor(qpos);\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport interface QParams2dProps {\r\n origin: XAndY;\r\n scale: XAndY;\r\n}\r\n\r\n/** Parameters used for [[Quantization]] of 2d points such that the `x` and `y` components are each quantized to 16-bit unsigned integers.\r\n * @see [[QPoint2d]] for the quantized representation of a [Point2d]($core-geometry).\r\n * @see [[QPoint2dList]] for a list of [[QPoint2d]]s quantized using a [[QParams2d]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class QParams2d {\r\n /** The origin of the quantization range. */\r\n public readonly origin = new Point2d();\r\n /** The scale applied to coordinates to quantize them. */\r\n public readonly scale = new Point2d();\r\n\r\n private constructor(ox = 0, oy = 0, sx = 0, sy = 0) { this.setFrom(ox, oy, sx, sy); }\r\n\r\n private setFrom(ox: number, oy: number, sx: number, sy: number) {\r\n this.origin.x = ox;\r\n this.origin.y = oy;\r\n this.scale.x = sx;\r\n this.scale.y = sy;\r\n }\r\n\r\n /** Set [[origin]] and [[scale]] from `src`. */\r\n public copyFrom(src: QParams2d): void {\r\n this.setFrom(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\r\n }\r\n\r\n /** Create a copy of these params.\r\n * @param out If supplied, these QParams2d will be modified and returned; otherwise a new QParams2d object will be created and returned.\r\n */\r\n public clone(out?: QParams2d): QParams2d {\r\n const result = undefined !== out ? out : new QParams2d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /** Initialize these parameters to support quantization of values within the specified range. */\r\n public setFromRange(range: Range2d, rangeScale = Quantization.rangeScale16) {\r\n if (!range.isNull) {\r\n this.setFrom(range.low.x, range.low.y, Quantization.computeScale(range.high.x - range.low.x, rangeScale), Quantization.computeScale(range.high.y - range.low.y, rangeScale));\r\n } else {\r\n this.origin.x = this.origin.y = this.scale.x = this.scale.y = 0;\r\n }\r\n }\r\n\r\n /** Create parameters to support quantization of values within the specified range. */\r\n public static fromRange(range: Range2d, out?: QParams2d, rangeScale = Quantization.rangeScale16) {\r\n const params = undefined !== out ? out : new QParams2d();\r\n params.setFromRange(range, rangeScale);\r\n return params;\r\n }\r\n\r\n /** Return the unquantized point for the input `x` and `y` components. If `out` is supplied, it will be modified to hold the result and returned. */\r\n public unquantize(x: number, y: number, out?: Point2d): Point2d {\r\n out = out ?? new Point2d();\r\n out.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\r\n out.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\r\n return out;\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0], appropriate for normalized 2d vectors. */\r\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\r\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(-1, -1), Point2d.create(1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** Create parameters supporting quantization of values within the range [0.0, 1.0]. */\r\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\r\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(0, 0), Point2d.create(1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** Create parameters from origin and scale components */\r\n public static fromOriginAndScale(originX: number, originY: number, scaleX: number, scaleY: number) {\r\n return new QParams2d(originX, originY, scaleX, scaleY);\r\n }\r\n\r\n /** @internal */\r\n public get rangeDiagonal(): Vector2d {\r\n return Vector2d.createFrom({ x: 0 === this.scale.x ? 0 : Quantization.rangeScale16 / this.scale.x, y: 0 === this.scale.y ? 0 : Quantization.rangeScale16 / this.scale.y });\r\n }\r\n\r\n /** Return true if the point point is quantizable using these parameters. */\r\n public isQuantizable(point: Point2d) {\r\n return Quantization.isQuantizable(point.x, this.origin.x, this.scale.x) && Quantization.isQuantizable(point.y, this.origin.y, this.scale.y);\r\n }\r\n\r\n /** @alpha */\r\n public toJSON(): QParams2dProps {\r\n return {\r\n origin: { x: this.origin.x, y: this.origin.y },\r\n scale: { x: this.scale.x, y: this.scale.y },\r\n };\r\n }\r\n\r\n /** @alpha */\r\n public static fromJSON(src: QParams2dProps): QParams2d {\r\n return this.fromOriginAndScale(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\r\n }\r\n}\r\n\r\n/** Represents a [Point2d]($core-geometry) compressed such that each component `x` and `y` is quantized to the 16-bit integer range [0, 0xffff].\r\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\r\n * @see [[QParams2d]] to define quantization parameters for a range of points.\r\n * @see [[QPoint2dList]] for a list of points all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint2d {\r\n private _x: number = 0;\r\n private _y: number = 0;\r\n\r\n /** The quantized x component. */\r\n public get x() { return this._x; }\r\n public set x(x: number) {\r\n assert(Quantization.isQuantized(x));\r\n this._x = x;\r\n }\r\n\r\n /** The quantized y component. */\r\n public get y() { return this._y; }\r\n public set y(y: number) {\r\n assert(Quantization.isQuantized(y));\r\n this._y = y;\r\n }\r\n\r\n /** Construct with `x` and `y` initialized to zero. */\r\n public constructor() { }\r\n\r\n /** Initialize this point by quantizing the supplied { x, y } using the specified params */\r\n public init(pos: XAndY, params: QParams2d) {\r\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\r\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\r\n }\r\n\r\n /** Create a quantized point from the supplied Point2d using the specified params */\r\n public static create(pos: Point2d, params: QParams2d) {\r\n const qpt = new QPoint2d();\r\n qpt.init(pos, params);\r\n return qpt;\r\n }\r\n\r\n /** Initialize `x` and `y` from `src`. */\r\n public copyFrom(src: QPoint2d) {\r\n this.x = src.x;\r\n this.y = src.y;\r\n }\r\n\r\n /** Create a copy of this point.\r\n * @param out If supplied, it will be modified in-place and returned; otherwise a new QPoint2d will be allocated and returned.\r\n */\r\n public clone(out?: QPoint2d) {\r\n const result = undefined !== out ? out : new QPoint2d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the x and y components directly.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n */\r\n public setFromScalars(x: number, y: number) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n\r\n /**\r\n * Create a QPoint2d directly from x and y components.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n */\r\n public static fromScalars(x: number, y: number) {\r\n const pt = new QPoint2d();\r\n pt.setFromScalars(x, y);\r\n return pt;\r\n }\r\n\r\n /** Return a Point2d unquantized according to the supplied `params`. If `out` is supplied, it will be modified in-place and returned. */\r\n public unquantize(params: QParams2d, out?: Point2d): Point2d {\r\n const pt: Point2d = undefined !== out ? out : new Point2d();\r\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\r\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\r\n return pt;\r\n }\r\n}\r\n\r\n/** A compact representation of a list of [[QPoint2d]]s stored in a `Uint16Array`\r\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.uvs]($frontend).\r\n * @see [[QPoint3dBuffer]] for 3d points.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface QPoint2dBuffer {\r\n /** The parameters used to quantize the [[points]]. */\r\n params: QParams2d;\r\n /** The [[QPoint2d]]s as pairs of unsigned 16-bit integers. The length must be a multiple of 2; the number of points in the array is half the array's length.\r\n * To obtain the `n`th point, use `QPoint2d.fromScalars(buffer.points[n * 2], buffer.points[n * 2 + 1])`.\r\n */\r\n points: Uint16Array;\r\n}\r\n\r\n/** @public\r\n * @extensions\r\n */\r\nexport namespace QPoint2dBuffer {\r\n const scratchQPoint2d = new QPoint2d();\r\n\r\n /** Extracts the point at the specified index from a buffer.\r\n * @param points The buffer in which each consecutive pair of integers is a 2d quantized point.\r\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [[QPoint2d]] to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint2d): QPoint2d {\r\n const index = pointIndex * 2;\r\n const x = points[index + 0];\r\n const y = points[index + 1];\r\n if (undefined === x || undefined === y)\r\n throw new Error(\"Index out of range\");\r\n\r\n result = result ?? new QPoint2d();\r\n result.setFromScalars(x, y);\r\n return result;\r\n }\r\n\r\n /** Extracts and unquantizes the point at the specified index from a buffer.\r\n * @param buffer The array of points and the quantization parameters.\r\n * @param The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [Point2d]($core-geometry) to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function unquantizePoint(buffer: QPoint2dBuffer, pointIndex: number, result?: Point2d): Point2d {\r\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint2d);\r\n return qpt.unquantize(buffer.params, result);\r\n }\r\n}\r\n\r\n/** A list of [[QPoint2d]]s all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint2dList {\r\n /** Parameters used to quantize the points. */\r\n public readonly params: QParams2d;\r\n private readonly _list = new Array<QPoint2d>();\r\n\r\n /** The list of quantized points. */\r\n public get list(): ReadonlyArray<QPoint2d> {\r\n return this._list;\r\n }\r\n\r\n /** Construct an empty list set up to use the supplied quantization parameters. */\r\n public constructor(params: QParams2d) {\r\n this.params = params.clone();\r\n }\r\n\r\n /** Removes all points from the list. */\r\n public clear() {\r\n this._list.length = 0;\r\n }\r\n\r\n /** Removes all points from the list and change the quantization parameters. */\r\n public reset(params: QParams2d) {\r\n this.clear();\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Quantizes the supplied Point2d to this list's range and appends it to the list. */\r\n public add(pt: Point2d) {\r\n this._list.push(QPoint2d.create(pt, this.params));\r\n }\r\n\r\n /** Adds a previously-quantized point to this list. */\r\n public push(qpt: QPoint2d) {\r\n this._list.push(qpt.clone());\r\n }\r\n\r\n /** The number of points in the list. */\r\n public get length() {\r\n return this._list.length;\r\n }\r\n\r\n /** Returns the unquantized value of the point at the specified index in the list. */\r\n public unquantize(index: number, out?: Point2d): Point2d {\r\n assert(index < this.length);\r\n if (index < this.length) {\r\n return this._list[index].unquantize(this.params, out);\r\n } else {\r\n return undefined !== out ? out : new Point2d();\r\n }\r\n }\r\n\r\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\r\n * @note The loss of precision is compounded each time the points are requantized to a new range.\r\n */\r\n public requantize(params: QParams2d) {\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = this.unquantize(i);\r\n this._list[i].init(pt, params);\r\n }\r\n\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Extracts the current contents of the list as a Uint16Array such that the first element of the array corresponds to the first point's `x` component,\r\n * the second to the first point's `y` component, and so on.\r\n */\r\n public toTypedArray(): Uint16Array {\r\n const array = new Uint16Array(this.length * 2);\r\n const pts = this._list;\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = pts[i];\r\n array[i * 2] = pt.x;\r\n array[i * 2 + 1] = pt.y;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n /** Create from a Uint16Array laid out such that `array[0]` corresponds to the first point's `x` component, `array[1]` to the first point's `y` component, and so on. */\r\n public fromTypedArray(range: Range2d, array: Uint16Array) {\r\n this.params.setFromRange(range);\r\n this._list.length = array.length / 2;\r\n for (let i = 0, j = 0; i < this.list.length; i++)\r\n this._list[i] = QPoint2d.fromScalars(array[j++], array[j++]);\r\n }\r\n\r\n /** Construct a QPoint2dList containing all points in the supplied list, quantized to the range of those points. */\r\n public static fromPoints(points: Point2d[], out?: QPoint2dList) {\r\n let qPoints;\r\n const qParams = QParams2d.fromRange(Range2d.createArray(points));\r\n if (out) {\r\n qPoints = out;\r\n qPoints.reset(qParams);\r\n } else {\r\n qPoints = new QPoint2dList(qParams);\r\n }\r\n\r\n for (const point of points)\r\n qPoints.add(point);\r\n\r\n return qPoints;\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport interface QParams3dProps {\r\n origin: XYAndZ;\r\n scale: XYAndZ;\r\n}\r\n\r\n/** Parameters used for [[Quantization]] of 3d points such that the `x`, `y`, and `z` components are each quantized to 16-bit unsigned integers.\r\n * @see [[QPoint3d]] for the quantized representation of a [Point3d]($core-geometry).\r\n * @see [[QPoint3dList]] for a list of [[QPoint3d]]s quantized using a [[QParams3d]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class QParams3d {\r\n /** The origin of the quantization range. */\r\n public readonly origin = new Point3d();\r\n /** The scale applied to coordinates to quantize them. */\r\n public readonly scale = new Point3d();\r\n\r\n private constructor(ox = 0, oy = 0, oz = 0, sx = 0, sy = 0, sz = 0) {\r\n this.setFrom(ox, oy, oz, sx, sy, sz);\r\n }\r\n\r\n private setFrom(ox: number, oy: number, oz: number, sx: number, sy: number, sz: number) {\r\n this.origin.x = ox;\r\n this.origin.y = oy;\r\n this.origin.z = oz;\r\n this.scale.x = sx;\r\n this.scale.y = sy;\r\n this.scale.z = sz;\r\n }\r\n\r\n /** Set `x`, `y`, and `z` from `src. */\r\n public copyFrom(src: QParams3d): void {\r\n this.setFrom(src.origin.x, src.origin.y, src.origin.z, src.scale.x, src.scale.y, src.scale.z);\r\n }\r\n\r\n /** Create a copy of these parameters.\r\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\r\n */\r\n public clone(out?: QParams3d): QParams3d {\r\n const result = undefined !== out ? out : new QParams3d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /** Initialize from origin and scale */\r\n public setFromOriginAndScale(origin: Point3d, scale: Point3d) {\r\n this.setFrom(origin.x, origin.y, origin.z, scale.x, scale.y, scale.z);\r\n }\r\n\r\n /** Initialize these parameters to support quantization of values within the specified range. */\r\n public setFromRange(range: Range3d, rangeScale = Quantization.rangeScale16) {\r\n if (!range.isNull) {\r\n this.setFrom(range.low.x, range.low.y, range.low.z,\r\n Quantization.computeScale(range.high.x - range.low.x, rangeScale), Quantization.computeScale(range.high.y - range.low.y, rangeScale), Quantization.computeScale(range.high.z - range.low.z, rangeScale));\r\n } else {\r\n this.origin.x = this.origin.y = this.origin.z = 0;\r\n this.scale.x = this.scale.y = this.scale.z = 0;\r\n }\r\n }\r\n\r\n /** Return the unquantized point for the input components.\r\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new Point3d.\r\n */\r\n public unquantize(x: number, y: number, z: number, out?: Point3d): Point3d {\r\n const pt: Point3d = undefined !== out ? out : new Point3d();\r\n pt.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\r\n pt.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\r\n pt.z = Quantization.unquantize(z, this.origin.z, this.scale.z);\r\n return pt;\r\n }\r\n\r\n /** Creates parameters to support quantization of values within the specified range.\r\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\r\n */\r\n public static fromRange(range: Range3d, out?: QParams3d, rangeScale = Quantization.rangeScale16): QParams3d {\r\n const params = undefined !== out ? out : new QParams3d();\r\n params.setFromRange(range, rangeScale);\r\n return params;\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0].\r\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\r\n */\r\n public static fromOriginAndScale(origin: Point3d, scale: Point3d, out?: QParams3d): QParams3d {\r\n const params = undefined !== out ? out : new QParams3d();\r\n params.setFromOriginAndScale(origin, scale);\r\n return params;\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0]. */\r\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\r\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(-1, -1, -1), Point3d.create(1, 1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** Creates parameters supporting quantization of values within the range [0.0, 1.0]. */\r\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\r\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(0, 0, 0), Point3d.create(1, 1, 1)]), undefined, rangeScale);\r\n }\r\n\r\n /** @internal */\r\n public get rangeDiagonal(): Vector3d {\r\n return Vector3d.createFrom({\r\n x: this.scale.x === 0 ? 0 : Quantization.rangeScale16 / this.scale.x,\r\n y: this.scale.y === 0 ? 0 : Quantization.rangeScale16 / this.scale.y,\r\n z: this.scale.z === 0 ? 0 : Quantization.rangeScale16 / this.scale.z,\r\n });\r\n }\r\n\r\n /** Return true if the point point is quantizable using these parameters. */\r\n public isQuantizable(point: Point3d) {\r\n return Quantization.isQuantizable(point.x, this.origin.x, this.scale.x) && Quantization.isQuantizable(point.y, this.origin.y, this.scale.y) && Quantization.isQuantizable(point.z, this.origin.z, this.scale.z);\r\n }\r\n\r\n /** Compute the range to which these parameters quantize. */\r\n public computeRange(out?: Range3d): Range3d {\r\n const range = Range3d.createNull(out);\r\n range.extendPoint(this.origin);\r\n range.extendPoint(this.origin.plus(this.rangeDiagonal));\r\n return range;\r\n }\r\n\r\n /** @alpha */\r\n public toJSON(): QParams3dProps {\r\n return {\r\n origin: { x: this.origin.x, y: this.origin.y, z: this.origin.z },\r\n scale: { x: this.scale.x, y: this.scale.y, z: this.scale.z },\r\n };\r\n }\r\n\r\n /** @alpha */\r\n public static fromJSON(src: QParams3dProps, out?: QParams3d): QParams3d {\r\n return this.fromOriginAndScale(Point3d.fromJSON(src.origin), Point3d.fromJSON(src.scale), out);\r\n }\r\n}\r\n\r\n/** Represents a [Point3d]($core-geometry) compressed such that each component `x`, `y`, and `z` is quantized to the 16-bit integer range [0, 0xffff].\r\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\r\n * @see [[QParams3d]] to define quantization parameters for a range of points.\r\n * @see [[QPoint3dList]] for a list of points all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint3d {\r\n private _x: number = 0;\r\n private _y: number = 0;\r\n private _z: number = 0;\r\n\r\n /** The quantized x component. */\r\n public get x() { return this._x; }\r\n public set x(x: number) {\r\n assert(Quantization.isQuantized(x));\r\n this._x = x;\r\n }\r\n\r\n /** The quantized y component. */\r\n public get y() { return this._y; }\r\n public set y(y: number) {\r\n assert(Quantization.isQuantized(y));\r\n this._y = y;\r\n }\r\n\r\n /** The quantized z component. */\r\n public get z() { return this._z; }\r\n public set z(z: number) {\r\n assert(Quantization.isQuantized(z));\r\n this._z = z;\r\n }\r\n\r\n /** Construct with all components initialized to zero. */\r\n public constructor() { }\r\n\r\n /** Initialize this point by quantizing the supplied { x, y, z } using the specified params */\r\n public init(pos: XYAndZ, params: QParams3d): void {\r\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\r\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\r\n this.z = Quantization.quantize(pos.z, params.origin.z, params.scale.z);\r\n }\r\n\r\n /** Creates a quantized point from the supplied Point3d using the specified params */\r\n public static create(pos: Point3d, params: QParams3d): QPoint3d {\r\n const qpt = new QPoint3d();\r\n qpt.init(pos, params);\r\n return qpt;\r\n }\r\n\r\n /** Set this points components from `src`. */\r\n public copyFrom(src: QPoint3d): void {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z;\r\n }\r\n\r\n /** Create a copy of this point.\r\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\r\n */\r\n public clone(out?: QPoint3d): QPoint3d {\r\n const result = undefined !== out ? out : new QPoint3d();\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the x, y, and z components directly.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n * @param z Must be an integer in the range [0, 0xffff]\r\n */\r\n public setFromScalars(x: number, y: number, z: number) {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n }\r\n\r\n /**\r\n * Creates a QPoint3d directly from x, y, and z components.\r\n * @param x Must be an integer in the range [0, 0xffff]\r\n * @param y Must be an integer in the range [0, 0xffff]\r\n * @param z Must be an integer in the range [0, 0xffff]\r\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\r\n */\r\n public static fromScalars(x: number, y: number, z: number, out?: QPoint3d): QPoint3d {\r\n const pt = undefined === out ? new QPoint3d() : out;\r\n pt.setFromScalars(x, y, z);\r\n return pt;\r\n }\r\n\r\n /** Returns a Point3d unquantized according to the supplied params.\r\n * If `out` is supplied, it will be modified in-place instead of allocating a new Point3d.\r\n */\r\n public unquantize(params: QParams3d, out?: Point3d): Point3d {\r\n const pt: Point3d = undefined !== out ? out : new Point3d();\r\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\r\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\r\n pt.z = Quantization.unquantize(this.z, params.origin.z, params.scale.z);\r\n return pt;\r\n }\r\n\r\n /** Return true if this point's components are identical to the other point's components. */\r\n public equals(other: QPoint3d): boolean {\r\n return this.x === other.x && this.y === other.y && this.z === other.z;\r\n }\r\n\r\n /** Perform ordinal comparison to another point. The function returns:\r\n * - Zero if this point is identical to `rhs`; or\r\n * - A number less than zero if this point is ordered before `rhs`; or\r\n * - A number greater than zero if this point is ordered after `rhs`.\r\n * @see [OrderedComparator]($core-bentley).\r\n */\r\n public compare(rhs: QPoint3d): number {\r\n let diff = this.x - rhs.x;\r\n if (0 === diff) {\r\n diff = this.y - rhs.y;\r\n if (0 === diff) {\r\n diff = this.z - rhs.z;\r\n }\r\n }\r\n\r\n return diff;\r\n }\r\n}\r\n\r\n/** A compact representation of a list of [[QPoint3d]]s stored in a `Uint16Array`.\r\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.positions]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface QPoint3dBuffer {\r\n /** The parameters used to quantize the [[points]]. */\r\n params: QParams3d;\r\n /** The [[QPoint3d]]s as pairs of unsigned 16-bit integers. The length must be a multiple of 3; the number of points in the array is half the array's length.\r\n * To obtain the `n`th point, use `QPoint3d.fromScalars(buffer.points[n * 3], buffer.points[n * 3 + 1], buffer.points[n * 3 + 2])`.\r\n */\r\n points: Uint16Array;\r\n}\r\n\r\n/** @public\r\n * @extensions\r\n */\r\nexport namespace QPoint3dBuffer {\r\n const scratchQPoint3d = new QPoint3d();\r\n\r\n /** Extracts the point at the specified index from a buffer.\r\n * @param points The buffer in which each consecutive pair of integers is a 3d quantized point.\r\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [[QPoint3d]] to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint3d): QPoint3d {\r\n const index = pointIndex * 3;\r\n const x = points[index + 0];\r\n const y = points[index + 1];\r\n const z = points[index + 2];\r\n if (undefined === x || undefined === y || undefined === z)\r\n throw new Error(\"Index out of range\");\r\n\r\n result = result ?? new QPoint3d();\r\n result.setFromScalars(x, y, z);\r\n return result;\r\n }\r\n\r\n /** Extracts and unquantizes the point at the specified index from a buffer.\r\n * @param buffer The array of points and the quantization parameters.\r\n * @param buffer The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\r\n * @param result If supplied, a preallocated [Point3d]($core-geometry) to initialize with the result and return.\r\n * @returns The point at `pointIndex`.\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n export function unquantizePoint(buffer: QPoint3dBuffer, pointIndex: number, result?: Point3d): Point3d {\r\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint3d);\r\n return qpt.unquantize(buffer.params, result);\r\n }\r\n}\r\n\r\n/** A list of [[QPoint3d]]s all quantized to the same range.\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint3dList {\r\n /** Parameters used to quantize the points. */\r\n public readonly params: QParams3d;\r\n private readonly _list: QPoint3d[] = [];\r\n\r\n /** The list of quantized points. */\r\n public get list(): ReadonlyArray<QPoint3d> {\r\n return this._list;\r\n }\r\n\r\n /** Construct an empty list set up to quantize to the supplied range.\r\n * @param params The quantization parameters. If omitted, a null range will be used.\r\n */\r\n public constructor(params?: QParams3d) {\r\n this.params = params ? params.clone() : QParams3d.fromRange(Range3d.createNull());\r\n }\r\n\r\n /** Construct a QPoint3dList containing all points in the supplied list, quantized to the range of those points.\r\n * @param points The points to quantize and add to the list.\r\n * @param out If supplied, it will be cleared, its parameters recomputed, and the points will be added to it; otherwise, a new QPoint3dList will be created and returned.\r\n */\r\n public static fromPoints(points: Point3d[], out?: QPoint3dList): QPoint3dList {\r\n let qPoints;\r\n const qParams = QParams3d.fromRange(Range3d.createArray(points));\r\n if (out) {\r\n qPoints = out;\r\n qPoints.reset(qParams);\r\n } else {\r\n qPoints = new QPoint3dList(qParams);\r\n }\r\n\r\n for (const point of points)\r\n qPoints.add(point);\r\n\r\n return qPoints;\r\n }\r\n\r\n /** Removes all points from the list. */\r\n public clear() {\r\n this._list.length = 0;\r\n }\r\n\r\n /** Clears out the contents of the list and changes the quantization parameters. */\r\n public reset(params: QParams3d) {\r\n this.clear();\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Quantizes the supplied Point3d to this list's range and appends it to the list. */\r\n public add(pt: Point3d) {\r\n this._list.push(QPoint3d.create(pt, this.params));\r\n }\r\n\r\n /** Adds a previously-quantized point to this list. */\r\n public push(qpt: QPoint3d) {\r\n this._list.push(qpt.clone());\r\n }\r\n\r\n /** The number of points in the list. */\r\n public get length() {\r\n return this._list.length;\r\n }\r\n\r\n /** Returns the unquantized value of the point at the specified index in the list. */\r\n public unquantize(index: number, out?: Point3d): Point3d {\r\n assert(index < this.length);\r\n if (index < this.length) {\r\n return this._list[index].unquantize(this.params, out);\r\n } else {\r\n return undefined !== out ? out : new Point3d();\r\n }\r\n }\r\n\r\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\r\n * @note The loss of precision is compounded each time the points are requantized to a new range.\r\n */\r\n public requantize(params: QParams3d): void {\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = this.unquantize(i);\r\n this._list[i].init(pt, params);\r\n }\r\n\r\n this.params.copyFrom(params);\r\n }\r\n\r\n /** Extracts the current contents of the list as a Uint16Array such that the first 3 elements contain the first point's x, y, and z components,\r\n * the second three elements contain the second point's components, and so on.\r\n */\r\n public toTypedArray(): Uint16Array {\r\n const array = new Uint16Array(this.length * 3);\r\n const pts = this._list;\r\n for (let i = 0; i < this.length; i++) {\r\n const pt = pts[i];\r\n array[i * 3 + 0] = pt.x;\r\n array[i * 3 + 1] = pt.y;\r\n array[i * 3 + 2] = pt.z;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n /** Reinitialize from a Uint16Array in which the first three elements specify the x, y, and z components of the first point, the second three elements specify the components\r\n * of the second point, and so on.\r\n */\r\n public fromTypedArray(range: Range3d, array: Uint16Array): void {\r\n this.params.setFromRange(range);\r\n this._list.length = array.length / 3;\r\n for (let i = 0, j = 0; i < this.list.length; i++)\r\n this._list[i] = QPoint3d.fromScalars(array[j++], array[j++], array[j++]);\r\n }\r\n\r\n /** Construct a list containing all points in the supplied list, quantized using the supplied parameters. */\r\n public static createFrom(points: Point3d[], params: QParams3d): QPoint3dList {\r\n const list = new QPoint3dList(params);\r\n for (const point of points)\r\n list.add(point);\r\n\r\n return list;\r\n }\r\n\r\n /** An iterator over the points in the list. */\r\n public [Symbol.iterator]() {\r\n return this.list[Symbol.iterator]();\r\n }\r\n}\r\n\r\n/** Options used to construct a [[QPoint2dBufferBuilder]].\r\n * @beta\r\n * @extensions\r\n */\r\ninterface QPoint2dBufferBuilderOptions {\r\n /** The range to which the points will be quantized. This must be large enough to contain all of the points that will be added to the buffer. */\r\n range: Range2d;\r\n /** The number of points for which to allocate space.\r\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\r\n */\r\n initialCapacity?: number;\r\n /** Multiplier used to compute new capacity when resizing the buffer.\r\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\r\n */\r\n growthFactor?: number;\r\n}\r\n\r\n/** Constructs a [[QPoint2dBuffer]] using a [Uint16ArrayBuilder]($bentley).\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint2dBufferBuilder {\r\n private readonly _scratchQPoint2d = new QPoint2d();\r\n\r\n /** The parameters used to quantize the points in the [[buffer]]. */\r\n public readonly params: QParams2d;\r\n /** The buffer that holds the points. */\r\n public readonly buffer: Uint16ArrayBuilder;\r\n\r\n /** Construct a new buffer with a [[length]] of zero. */\r\n public constructor(options: QPoint2dBufferBuilderOptions) {\r\n this.params = QParams2d.fromRange(options.range);\r\n const initialCapacity = options.initialCapacity ?? 0;\r\n this.buffer = new Uint16ArrayBuilder({\r\n growthFactor: options.growthFactor,\r\n initialCapacity: 2 * initialCapacity,\r\n });\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public pushXY(x: number, y: number): void {\r\n this.buffer.push(x);\r\n this.buffer.push(y);\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public push(pt: XAndY): void {\r\n this.pushXY(pt.x, pt.y);\r\n }\r\n\r\n /** The number of points currently in the [[buffer]]. */\r\n public get length(): number {\r\n const len = this.buffer.length;\r\n assert(len % 2 === 0);\r\n return len / 2;\r\n }\r\n\r\n /** Returns the quantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [[QPoint2d]] to initialize with the result and return.\r\n * @returns The quantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public get(pointIndex: number, result?: QPoint2d): QPoint2d {\r\n return QPoint2dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\r\n }\r\n\r\n /** Returns the unquantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [Point2d]($core-geometry) to initialize with the result and return.\r\n * @returns The unquantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public unquantize(pointIndex: number, result?: Point2d): Point2d {\r\n return this.get(pointIndex, this._scratchQPoint2d).unquantize(this.params, result);\r\n }\r\n\r\n /** Obtain a [[QPoint2dBuffer]] containing all of the points that have been appended by this builder. */\r\n public finish(): QPoint2dBuffer {\r\n return {\r\n params: this.params,\r\n points: this.buffer.toTypedArray(),\r\n };\r\n }\r\n}\r\n\r\n/** Options used to construct a [[QPoint3dBufferBuilder]].\r\n * @beta\r\n * @extensions\r\n */\r\ninterface QPoint3dBufferBuilderOptions {\r\n /** The range to which the points will be quantized. This must be large enough to contain all of the points that will be added to the buffer. */\r\n range: Range3d;\r\n /** The number of points for which to allocate space.\r\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\r\n */\r\n initialCapacity?: number;\r\n /** Multiplier used to compute new capacity when resizing the buffer.\r\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\r\n */\r\n growthFactor?: number;\r\n}\r\n\r\n/** Constructs a [[QPoint3dBuffer]] using a [Uint16ArrayBuilder]($bentley).\r\n * @public\r\n * @extensions\r\n */\r\nexport class QPoint3dBufferBuilder {\r\n private readonly _scratchQPoint3d = new QPoint3d();\r\n\r\n /** The parameters used to quantize the points in the [[buffer]]. */\r\n public readonly params: QParams3d;\r\n /** The buffer that holds the points. */\r\n public readonly buffer: Uint16ArrayBuilder;\r\n\r\n /** Construct a new buffer with a [[length]] of zero. */\r\n public constructor(options: QPoint3dBufferBuilderOptions) {\r\n this.params = QParams3d.fromRange(options.range);\r\n const initialCapacity = options.initialCapacity ?? 0;\r\n this.buffer = new Uint16ArrayBuilder({\r\n growthFactor: options.growthFactor,\r\n initialCapacity: 3 * initialCapacity,\r\n });\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public pushXYZ(x: number, y: number, z: number): void {\r\n this.buffer.push(x);\r\n this.buffer.push(y);\r\n this.buffer.push(z);\r\n }\r\n\r\n /** Append a point with the specified quantized coordinates. */\r\n public push(pt: XYAndZ): void {\r\n this.pushXYZ(pt.x, pt.y, pt.z);\r\n }\r\n\r\n /** The number of points currently in the [[buffer]]. */\r\n public get length(): number {\r\n const len = this.buffer.length;\r\n assert(len % 3 === 0);\r\n return len / 3;\r\n }\r\n\r\n /** Returns the quantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [[QPoint3d]] to initialize with the result and return.\r\n * @returns The quantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public get(pointIndex: number, result?: QPoint3d): QPoint3d {\r\n return QPoint3dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\r\n }\r\n\r\n /** Returns the unquantized point at the specified index in [[buffer]].\r\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\r\n * @param result If supplied, a [Point3d]($core-geometry) to initialize with the result and return.\r\n * @returns The unquantized point at the specified index in [[buffer]].\r\n * @throws Error if `pointIndex` is out of bounds.\r\n */\r\n public unquantize(pointIndex: number, result?: Point3d): Point3d {\r\n return this.get(pointIndex, this._scratchQPoint3d).unquantize(this.params, result);\r\n }\r\n\r\n /** Obtain a [[QPoint3dBuffer]] containing all of the points that have been appended by this builder. */\r\n public finish(): QPoint3dBuffer {\r\n return {\r\n params: this.params,\r\n points: this.buffer.toTypedArray(),\r\n };\r\n }\r\n}\r\n"]}
@@ -2,47 +2,39 @@
2
2
  * @module Rendering
3
3
  */
4
4
  import { OctEncodedNormalPair } from "./OctEncodedNormal";
5
- /** @internal */
5
+ /** Describes the semantics of a [PolylineArgs]($frontend).
6
+ * @alpha
7
+ */
6
8
  export declare enum PolylineTypeFlags {
7
9
  Normal = 0,
8
10
  Edge = 1,
9
11
  Outline = 2
10
12
  }
11
- /** Flags describing a polyline. A polyline may represent a continuous line string, or a set of discrete points.
12
- * @internal
13
+ /** Flags describing a [PolylineArgs]($frontend).
14
+ * @public
13
15
  */
14
- export declare class PolylineFlags {
15
- isDisjoint: boolean;
16
- isPlanar: boolean;
17
- is2d: boolean;
18
- type: PolylineTypeFlags;
19
- constructor(is2d?: boolean, isPlanar?: boolean, isDisjoint?: boolean, type?: PolylineTypeFlags);
20
- clone(): PolylineFlags;
21
- /** Create a PolylineFlags from a serialized numeric representation. */
22
- static unpack(value: number): PolylineFlags;
23
- initDefaults(): void;
24
- get isOutlineEdge(): boolean;
25
- get isNormalEdge(): boolean;
26
- get isAnyEdge(): boolean;
27
- setIsNormalEdge(): void;
28
- setIsOutlineEdge(): void;
29
- /** Convert these flags to a numeric representation for serialization. */
30
- pack(): number;
31
- equals(other: PolylineFlags): boolean;
32
- }
33
- /** @internal */
34
- export declare class PolylineData {
35
- vertIndices: number[];
36
- numIndices: number;
37
- constructor(vertIndices?: number[], numIndices?: number);
38
- get isValid(): boolean;
39
- reset(): void;
40
- init(polyline: MeshPolyline): boolean;
16
+ export interface PolylineFlags {
17
+ /** If `true`, the polylines are to be drawn as individual disconnected point strings instead of as connected line strings. */
18
+ isDisjoint?: boolean;
19
+ /** If `true`, the polylines' positions are all coplanar. */
20
+ isPlanar?: boolean;
21
+ /** If `true`, the polylines' positions all have the same z coordinate. */
22
+ is2d?: boolean;
23
+ /** Default: Normal.
24
+ * @alpha
25
+ */
26
+ type?: PolylineTypeFlags;
41
27
  }
28
+ /** Describes the vertex indices of a single line within a [PolylineArgs]($frontend).
29
+ * The indices represent either a line string as a connected series of points, or a point string as a set of disconnected points, depending
30
+ * on the [[PolylineFlags.isDisjoint]] value of [PolylineArgs.flags]($frontend).
31
+ * @public
32
+ */
33
+ export type PolylineIndices = number[];
42
34
  /** @internal */
43
35
  export declare class MeshPolyline {
44
- readonly indices: number[];
45
- constructor(indices?: number[]);
36
+ readonly indices: PolylineIndices;
37
+ constructor(indices?: PolylineIndices);
46
38
  addIndex(index: number): void;
47
39
  clear(): void;
48
40
  }
@@ -80,9 +72,9 @@ export declare class SilhouetteEdgeArgs extends EdgeArgs {
80
72
  }
81
73
  /** @internal */
82
74
  export declare class PolylineEdgeArgs {
83
- lines?: PolylineData[];
84
- constructor(lines?: PolylineData[]);
85
- init(lines?: PolylineData[]): boolean;
75
+ lines?: PolylineIndices[];
76
+ constructor(lines?: PolylineIndices[]);
77
+ init(lines?: PolylineIndices[]): boolean;
86
78
  get numLines(): number;
87
79
  get isValid(): boolean;
88
80
  clear(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"Render.d.ts","sourceRoot":"","sources":["../../src/Render.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAI1D,gBAAgB;AAChB,oBAAY,iBAAiB;IAC3B,MAAM,IAAI;IACV,IAAI,IAAS;IACb,OAAO,IAAS;CACjB;AAED;;GAEG;AACH,qBAAa,aAAa;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;gBAEZ,IAAI,UAAQ,EAAE,QAAQ,UAAQ,EAAE,UAAU,UAAQ,EAAE,IAAI,oBAA2B;IAO/F,KAAK,IAAI,aAAa;IAE7B,uEAAuE;WACzD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa;IAU3C,YAAY;IAKnB,IAAW,aAAa,IAAI,OAAO,CAA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SAAQ,KAAK,CAAC,YAAY,CAAC;gBAC3C,GAAG,IAAI,EAAE,YAAY,EAAE;CAGpC;AAED,gBAAgB;AAChB,qBAAa,QAAQ;IACZ,OAAO,WAAU;gBAEL,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAY5C,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;CAO1C;AAED,gBAAgB;AAChB,qBAAa,SAAS;IACb,OAAO,EAAE,QAAQ,EAAE,CAAM;IACzB,UAAU,EAAE,QAAQ,EAAE,CAAM;IAC5B,SAAS,EAAE,gBAAgB,CAA0B;IACrD,iBAAiB,EAAE,oBAAoB,EAAE,CAAM;;CAEvD;AAED,gBAAgB;AAChB,qBAAa,QAAQ;IACZ,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEnB,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO;IAQpC,KAAK,IAAI,IAAI;IACpB,IAAW,OAAO,IAAI,OAAO,CAA8B;IAC3D,IAAW,QAAQ,WAA+D;CACnF;AAED,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,QAAQ;IACvC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAExB,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS;IAU1B,KAAK;CAItB;AAED,gBAAgB;AAChB,qBAAa,gBAAgB;IACpB,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;gBAEd,KAAK,CAAC,EAAE,eAAe,EAAE;IAErC,IAAI,CAAC,KAAK,CAAC,EAAE,eAAe,EAAE,GAAG,OAAO;IAK/C,IAAW,QAAQ,WAA+D;IAClF,IAAW,OAAO,YAAgC;IAC3C,KAAK;CACb"}
package/lib/cjs/Render.js CHANGED
@@ -7,80 +7,17 @@
7
7
  * @module Rendering
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.PolylineEdgeArgs = exports.SilhouetteEdgeArgs = exports.EdgeArgs = exports.MeshEdges = exports.MeshEdge = exports.MeshPolylineList = exports.MeshPolyline = exports.PolylineData = exports.PolylineFlags = exports.PolylineTypeFlags = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
10
+ exports.PolylineEdgeArgs = exports.SilhouetteEdgeArgs = exports.EdgeArgs = exports.MeshEdges = exports.MeshEdge = exports.MeshPolylineList = exports.MeshPolyline = exports.PolylineTypeFlags = void 0;
12
11
  // cSpell:ignore vals
13
- /** @internal */
12
+ /** Describes the semantics of a [PolylineArgs]($frontend).
13
+ * @alpha
14
+ */
14
15
  var PolylineTypeFlags;
15
16
  (function (PolylineTypeFlags) {
16
17
  PolylineTypeFlags[PolylineTypeFlags["Normal"] = 0] = "Normal";
17
18
  PolylineTypeFlags[PolylineTypeFlags["Edge"] = 1] = "Edge";
18
19
  PolylineTypeFlags[PolylineTypeFlags["Outline"] = 2] = "Outline";
19
20
  })(PolylineTypeFlags = exports.PolylineTypeFlags || (exports.PolylineTypeFlags = {}));
20
- /** Flags describing a polyline. A polyline may represent a continuous line string, or a set of discrete points.
21
- * @internal
22
- */
23
- class PolylineFlags {
24
- constructor(is2d = false, isPlanar = false, isDisjoint = false, type = PolylineTypeFlags.Normal) {
25
- this.isDisjoint = isDisjoint;
26
- this.isPlanar = isPlanar;
27
- this.is2d = is2d;
28
- this.type = type;
29
- }
30
- clone() { return new PolylineFlags(this.is2d, this.isPlanar, this.isDisjoint, this.type); }
31
- /** Create a PolylineFlags from a serialized numeric representation. */
32
- static unpack(value) {
33
- const isDisjoint = 0 !== (value & 1);
34
- const isPlanar = 0 !== (value & 2);
35
- const is2d = 0 !== (value & 4);
36
- const type = (value >> 3);
37
- (0, core_bentley_1.assert)(type === PolylineTypeFlags.Normal || type === PolylineTypeFlags.Edge || type === PolylineTypeFlags.Outline);
38
- return new PolylineFlags(is2d, isPlanar, isDisjoint, type);
39
- }
40
- initDefaults() {
41
- this.isDisjoint = this.isPlanar = this.is2d = false;
42
- this.type = PolylineTypeFlags.Normal;
43
- }
44
- get isOutlineEdge() { return PolylineTypeFlags.Outline === this.type; }
45
- get isNormalEdge() { return PolylineTypeFlags.Edge === this.type; }
46
- get isAnyEdge() { return PolylineTypeFlags.Normal !== this.type; }
47
- setIsNormalEdge() { this.type = PolylineTypeFlags.Edge; }
48
- setIsOutlineEdge() { this.type = PolylineTypeFlags.Outline; }
49
- /** Convert these flags to a numeric representation for serialization. */
50
- pack() {
51
- let val = 0;
52
- if (this.isDisjoint)
53
- val += 1;
54
- if (this.isPlanar)
55
- val += 1 << 1;
56
- if (this.is2d)
57
- val += 1 << 2;
58
- val += this.type << 3;
59
- return val;
60
- }
61
- equals(other) {
62
- return this.type === other.type && this.is2d === other.is2d && this.isPlanar === other.isPlanar && this.isDisjoint === other.isDisjoint;
63
- }
64
- }
65
- exports.PolylineFlags = PolylineFlags;
66
- /** @internal */
67
- class PolylineData {
68
- constructor(vertIndices = [], numIndices = 0) {
69
- this.vertIndices = vertIndices;
70
- this.numIndices = numIndices;
71
- }
72
- get isValid() { return 0 < this.numIndices; }
73
- reset() {
74
- this.numIndices = 0;
75
- this.vertIndices = [];
76
- }
77
- init(polyline) {
78
- this.numIndices = polyline.indices.length;
79
- this.vertIndices = 0 < this.numIndices ? polyline.indices : [];
80
- return this.isValid;
81
- }
82
- }
83
- exports.PolylineData = PolylineData;
84
21
  /** @internal */
85
22
  class MeshPolyline {
86
23
  constructor(indices = []) {
@@ -1 +1 @@
1
- {"version":3,"file":"Render.js","sourceRoot":"","sources":["../../src/Render.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAG7C,qBAAqB;AAErB,gBAAgB;AAChB,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAU,CAAA;IACV,yDAAa,CAAA;IACb,+DAAgB,CAAA;AAClB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B;AAED;;GAEG;AACH,MAAa,aAAa;IAMxB,YAAmB,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AC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3C,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;CAC3C;AAbD,4CAaC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { OctEncodedNormalPair } from \"./OctEncodedNormal\";\r\n\r\n// cSpell:ignore vals\r\n\r\n/** @internal */\r\nexport enum PolylineTypeFlags {\r\n Normal = 0, // Just an ordinary polyline\r\n Edge = 1 << 0, // A polyline used to define the edges of a planar region.\r\n Outline = 1 << 1, // Like Edge, but the edges are only displayed in wireframe mode when surface fill is undisplayed.\r\n}\r\n\r\n/** Flags describing a polyline. A polyline may represent a continuous line string, or a set of discrete points.\r\n * @internal\r\n */\r\nexport class PolylineFlags {\r\n public isDisjoint: boolean;\r\n public isPlanar: boolean;\r\n public is2d: boolean;\r\n public type: PolylineTypeFlags;\r\n\r\n public constructor(is2d = false, isPlanar = false, isDisjoint = false, type = PolylineTypeFlags.Normal) {\r\n this.isDisjoint = isDisjoint;\r\n this.isPlanar = isPlanar;\r\n this.is2d = is2d;\r\n this.type = type;\r\n }\r\n\r\n public clone(): PolylineFlags { return new PolylineFlags(this.is2d, this.isPlanar, this.isDisjoint, this.type); }\r\n\r\n /** Create a PolylineFlags from a serialized numeric representation. */\r\n public static unpack(value: number): PolylineFlags {\r\n const isDisjoint = 0 !== (value & 1);\r\n const isPlanar = 0 !== (value & 2);\r\n const is2d = 0 !== (value & 4);\r\n const type: PolylineTypeFlags = (value >> 3);\r\n assert(type === PolylineTypeFlags.Normal || type === PolylineTypeFlags.Edge || type === PolylineTypeFlags.Outline);\r\n\r\n return new PolylineFlags(is2d, isPlanar, isDisjoint, type);\r\n }\r\n\r\n public initDefaults() {\r\n this.isDisjoint = this.isPlanar = this.is2d = false;\r\n this.type = PolylineTypeFlags.Normal;\r\n }\r\n\r\n public get isOutlineEdge(): boolean { return PolylineTypeFlags.Outline === this.type; }\r\n public get isNormalEdge(): boolean { return PolylineTypeFlags.Edge === this.type; }\r\n public get isAnyEdge(): boolean { return PolylineTypeFlags.Normal !== this.type; }\r\n public setIsNormalEdge(): void { this.type = PolylineTypeFlags.Edge; }\r\n public setIsOutlineEdge(): void { this.type = PolylineTypeFlags.Outline; }\r\n\r\n /** Convert these flags to a numeric representation for serialization. */\r\n public pack(): number {\r\n let val: number = 0;\r\n if (this.isDisjoint)\r\n val += 1;\r\n if (this.isPlanar)\r\n val += 1 << 1;\r\n if (this.is2d)\r\n val += 1 << 2;\r\n val += (this.type as number) << 3;\r\n return val;\r\n }\r\n\r\n public equals(other: PolylineFlags) {\r\n return this.type === other.type && this.is2d === other.is2d && this.isPlanar === other.isPlanar && this.isDisjoint === other.isDisjoint;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PolylineData {\r\n public vertIndices: number[];\r\n public numIndices: number;\r\n public constructor(vertIndices: number[] = [], numIndices = 0) {\r\n this.vertIndices = vertIndices;\r\n this.numIndices = numIndices;\r\n }\r\n public get isValid(): boolean { return 0 < this.numIndices; }\r\n public reset(): void {\r\n this.numIndices = 0;\r\n this.vertIndices = [];\r\n }\r\n\r\n public init(polyline: MeshPolyline) {\r\n this.numIndices = polyline.indices.length;\r\n this.vertIndices = 0 < this.numIndices ? polyline.indices : [];\r\n return this.isValid;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshPolyline {\r\n public readonly indices: number[];\r\n public constructor(indices: number[] = []) {\r\n this.indices = indices.slice();\r\n }\r\n public addIndex(index: number) {\r\n const { indices } = this;\r\n if (indices.length === 0 || indices[indices.length - 1] !== index)\r\n indices.push(index);\r\n }\r\n public clear() { this.indices.length = 0; }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshPolylineList extends Array<MeshPolyline> {\r\n constructor(...args: MeshPolyline[]) {\r\n super(...args);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshEdge {\r\n public indices = [0, 0];\r\n\r\n public constructor(index0?: number, index1?: number) {\r\n if (undefined === index0 || undefined === index1)\r\n return;\r\n if (index0 < index1) {\r\n this.indices[0] = index0;\r\n this.indices[1] = index1;\r\n } else {\r\n this.indices[0] = index1;\r\n this.indices[1] = index0;\r\n }\r\n }\r\n\r\n public compareTo(other: MeshEdge): number {\r\n let diff = this.indices[0] - other.indices[0];\r\n if (0 === diff)\r\n diff = this.indices[1] - other.indices[1];\r\n\r\n return diff;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshEdges {\r\n public visible: MeshEdge[] = [];\r\n public silhouette: MeshEdge[] = [];\r\n public polylines: MeshPolylineList = new MeshPolylineList();\r\n public silhouetteNormals: OctEncodedNormalPair[] = [];\r\n public constructor() { }\r\n}\r\n\r\n/** @internal */\r\nexport class EdgeArgs {\r\n public edges?: MeshEdge[];\r\n\r\n public init(meshEdges?: MeshEdges): boolean {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.visible.length)\r\n this.edges = meshEdges.visible;\r\n\r\n return this.isValid;\r\n }\r\n\r\n public clear(): void { this.edges = undefined; }\r\n public get isValid(): boolean { return 0 < this.numEdges; }\r\n public get numEdges() { return undefined !== this.edges ? this.edges.length : 0; }\r\n}\r\n\r\n/** @internal */\r\nexport class SilhouetteEdgeArgs extends EdgeArgs {\r\n public normals?: OctEncodedNormalPair[];\r\n\r\n public override init(meshEdges?: MeshEdges) {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.silhouette.length) {\r\n this.edges = meshEdges.silhouette;\r\n this.normals = meshEdges.silhouetteNormals;\r\n }\r\n\r\n return this.isValid;\r\n }\r\n\r\n public override clear() {\r\n this.normals = undefined;\r\n super.clear();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PolylineEdgeArgs {\r\n public lines?: PolylineData[];\r\n\r\n public constructor(lines?: PolylineData[]) { this.init(lines); }\r\n\r\n public init(lines?: PolylineData[]): boolean {\r\n this.lines = undefined !== lines && 0 < lines.length ? lines : undefined;\r\n return this.isValid;\r\n }\r\n\r\n public get numLines() { return undefined !== this.lines ? this.lines.length : 0; }\r\n public get isValid() { return this.numLines > 0; }\r\n public clear() { this.lines = undefined; }\r\n}\r\n"]}
1
+ {"version":3,"file":"Render.js","sourceRoot":"","sources":["../../src/Render.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,qBAAqB;AAErB;;GAEG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAU,CAAA;IACV,yDAAa,CAAA;IACb,+DAAgB,CAAA;AAClB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B;AAyBD,gBAAgB;AAChB,MAAa,YAAY;IAGvB,YAAmB,UAA2B,EAAE;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAEM,QAAQ,CAAC,KAAa;QAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACzB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK;YAC/D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAEM,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;CAC5C;AAdD,oCAcC;AAED,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,KAAmB;IACvD,YAAY,GAAG,IAAoB;QACjC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACjB,CAAC;CACF;AAJD,4CAIC;AAED,gBAAgB;AAChB,MAAa,QAAQ;IAGnB,YAAmB,MAAe,EA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AAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,IAAW,OAAO,KAAK,OAAO,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3C,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;CAC3C;AAbD,4CAaC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { OctEncodedNormalPair } from \"./OctEncodedNormal\";\r\n\r\n// cSpell:ignore vals\r\n\r\n/** Describes the semantics of a [PolylineArgs]($frontend).\r\n * @alpha\r\n */\r\nexport enum PolylineTypeFlags {\r\n Normal = 0, // Just an ordinary polyline\r\n Edge = 1 << 0, // A polyline used to define the edges of a planar region.\r\n Outline = 1 << 1, // Like Edge, but the edges are only displayed in wireframe mode when surface fill is undisplayed.\r\n}\r\n\r\n/** Flags describing a [PolylineArgs]($frontend).\r\n * @public\r\n */\r\nexport interface PolylineFlags {\r\n /** If `true`, the polylines are to be drawn as individual disconnected point strings instead of as connected line strings. */\r\n isDisjoint?: boolean;\r\n /** If `true`, the polylines' positions are all coplanar. */\r\n isPlanar?: boolean;\r\n /** If `true`, the polylines' positions all have the same z coordinate. */\r\n is2d?: boolean;\r\n /** Default: Normal.\r\n * @alpha\r\n */\r\n type?: PolylineTypeFlags;\r\n}\r\n\r\n/** Describes the vertex indices of a single line within a [PolylineArgs]($frontend).\r\n * The indices represent either a line string as a connected series of points, or a point string as a set of disconnected points, depending\r\n * on the [[PolylineFlags.isDisjoint]] value of [PolylineArgs.flags]($frontend).\r\n * @public\r\n */\r\nexport type PolylineIndices = number[];\r\n\r\n/** @internal */\r\nexport class MeshPolyline {\r\n public readonly indices: PolylineIndices;\r\n\r\n public constructor(indices: PolylineIndices = []) {\r\n this.indices = indices.slice();\r\n }\r\n\r\n public addIndex(index: number) {\r\n const { indices } = this;\r\n if (indices.length === 0 || indices[indices.length - 1] !== index)\r\n indices.push(index);\r\n }\r\n\r\n public clear() { this.indices.length = 0; }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshPolylineList extends Array<MeshPolyline> {\r\n constructor(...args: MeshPolyline[]) {\r\n super(...args);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshEdge {\r\n public indices = [0, 0];\r\n\r\n public constructor(index0?: number, index1?: number) {\r\n if (undefined === index0 || undefined === index1)\r\n return;\r\n if (index0 < index1) {\r\n this.indices[0] = index0;\r\n this.indices[1] = index1;\r\n } else {\r\n this.indices[0] = index1;\r\n this.indices[1] = index0;\r\n }\r\n }\r\n\r\n public compareTo(other: MeshEdge): number {\r\n let diff = this.indices[0] - other.indices[0];\r\n if (0 === diff)\r\n diff = this.indices[1] - other.indices[1];\r\n\r\n return diff;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshEdges {\r\n public visible: MeshEdge[] = [];\r\n public silhouette: MeshEdge[] = [];\r\n public polylines: MeshPolylineList = new MeshPolylineList();\r\n public silhouetteNormals: OctEncodedNormalPair[] = [];\r\n public constructor() { }\r\n}\r\n\r\n/** @internal */\r\nexport class EdgeArgs {\r\n public edges?: MeshEdge[];\r\n\r\n public init(meshEdges?: MeshEdges): boolean {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.visible.length)\r\n this.edges = meshEdges.visible;\r\n\r\n return this.isValid;\r\n }\r\n\r\n public clear(): void { this.edges = undefined; }\r\n public get isValid(): boolean { return 0 < this.numEdges; }\r\n public get numEdges() { return undefined !== this.edges ? this.edges.length : 0; }\r\n}\r\n\r\n/** @internal */\r\nexport class SilhouetteEdgeArgs extends EdgeArgs {\r\n public normals?: OctEncodedNormalPair[];\r\n\r\n public override init(meshEdges?: MeshEdges) {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.silhouette.length) {\r\n this.edges = meshEdges.silhouette;\r\n this.normals = meshEdges.silhouetteNormals;\r\n }\r\n\r\n return this.isValid;\r\n }\r\n\r\n public override clear() {\r\n this.normals = undefined;\r\n super.clear();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PolylineEdgeArgs {\r\n public lines?: PolylineIndices[];\r\n\r\n public constructor(lines?: PolylineIndices[]) { this.init(lines); }\r\n\r\n public init(lines?: PolylineIndices[]): boolean {\r\n this.lines = undefined !== lines && 0 < lines.length ? lines : undefined;\r\n return this.isValid;\r\n }\r\n\r\n public get numLines() { return undefined !== this.lines ? this.lines.length : 0; }\r\n public get isValid() { return this.numLines > 0; }\r\n public clear() { this.lines = undefined; }\r\n}\r\n"]}
@@ -33,7 +33,7 @@ export declare abstract class RpcInterface {
33
33
  readonly configuration: RpcConfiguration;
34
34
  /** @internal */
35
35
  readonly routing: RpcRoutingToken;
36
- /** @internal */
36
+ /** @beta */
37
37
  constructor(routing?: RpcRoutingToken);
38
38
  /** Obtains the implementation result for an RPC operation. */
39
39
  forward<T = any>(parameters: IArguments): Promise<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcInterface.d.ts","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGzF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAW7D;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAAI,SAAS,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE;AAEhJ;;;GAGG;AACH,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,UAAU,CAAC,CAAC;AAS5F;;;GAGG;AACH,8BAAsB,YAA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