@itwin/core-common 5.0.0-dev.40 → 5.0.0-dev.49
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.
- package/CHANGELOG.md +11 -1
- package/lib/cjs/AnalysisStyle.d.ts +0 -3
- package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
- package/lib/cjs/AnalysisStyle.js +0 -3
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts +25 -46
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +14 -29
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.d.ts +6 -108
- package/lib/cjs/FeatureTable.d.ts.map +1 -1
- package/lib/cjs/FeatureTable.js +8 -329
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Gradient.d.ts +3 -4
- package/lib/cjs/Gradient.d.ts.map +1 -1
- package/lib/cjs/Gradient.js +3 -4
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/HiddenLine.d.ts +17 -18
- package/lib/cjs/HiddenLine.d.ts.map +1 -1
- package/lib/cjs/HiddenLine.js +0 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Image.d.ts +7 -8
- package/lib/cjs/Image.d.ts.map +1 -1
- package/lib/cjs/Image.js +3 -4
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.d.ts +1 -2
- package/lib/cjs/PlanProjectionSettings.d.ts.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js +0 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.d.ts +0 -12
- package/lib/cjs/PlanarClipMask.d.ts.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.d.ts +5 -5
- package/lib/cjs/QPoint.d.ts.map +1 -1
- package/lib/cjs/QPoint.js +5 -5
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RenderPolyline.d.ts +36 -0
- package/lib/cjs/RenderPolyline.d.ts.map +1 -0
- package/lib/cjs/RenderPolyline.js +26 -0
- package/lib/cjs/RenderPolyline.js.map +1 -0
- package/lib/cjs/RenderTexture.d.ts +4 -2
- package/lib/cjs/RenderTexture.d.ts.map +1 -1
- package/lib/cjs/RenderTexture.js +8 -0
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/TextureMapping.d.ts +17 -14
- package/lib/cjs/TextureMapping.d.ts.map +1 -1
- package/lib/cjs/TextureMapping.js +22 -17
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/ViewFlags.d.ts +1 -3
- package/lib/cjs/ViewFlags.d.ts.map +1 -1
- package/lib/cjs/ViewFlags.js +1 -3
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/core-common.d.ts +1 -1
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.d.ts +111 -0
- package/lib/cjs/internal/PackedFeatureTable.d.ts.map +1 -0
- package/lib/cjs/internal/PackedFeatureTable.js +349 -0
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -0
- package/lib/cjs/internal/RenderMesh.d.ts +52 -0
- package/lib/cjs/internal/RenderMesh.d.ts.map +1 -0
- package/lib/cjs/{Render.js → internal/RenderMesh.js} +3 -25
- package/lib/cjs/internal/RenderMesh.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +2 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js +12 -0
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +4 -4
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/AnalysisStyle.d.ts +0 -3
- package/lib/esm/AnalysisStyle.d.ts.map +1 -1
- package/lib/esm/AnalysisStyle.js +0 -3
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts +25 -46
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +14 -29
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.d.ts +6 -108
- package/lib/esm/FeatureTable.d.ts.map +1 -1
- package/lib/esm/FeatureTable.js +6 -324
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Gradient.d.ts +3 -4
- package/lib/esm/Gradient.d.ts.map +1 -1
- package/lib/esm/Gradient.js +3 -4
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/HiddenLine.d.ts +17 -18
- package/lib/esm/HiddenLine.d.ts.map +1 -1
- package/lib/esm/HiddenLine.js +0 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Image.d.ts +7 -8
- package/lib/esm/Image.d.ts.map +1 -1
- package/lib/esm/Image.js +3 -4
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.d.ts +1 -2
- package/lib/esm/PlanProjectionSettings.d.ts.map +1 -1
- package/lib/esm/PlanProjectionSettings.js +0 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.d.ts +0 -12
- package/lib/esm/PlanarClipMask.d.ts.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.d.ts +5 -5
- package/lib/esm/QPoint.d.ts.map +1 -1
- package/lib/esm/QPoint.js +5 -5
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RenderPolyline.d.ts +36 -0
- package/lib/esm/RenderPolyline.d.ts.map +1 -0
- package/lib/esm/RenderPolyline.js +23 -0
- package/lib/esm/RenderPolyline.js.map +1 -0
- package/lib/esm/RenderTexture.d.ts +4 -2
- package/lib/esm/RenderTexture.d.ts.map +1 -1
- package/lib/esm/RenderTexture.js +8 -0
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/TextureMapping.d.ts +17 -14
- package/lib/esm/TextureMapping.d.ts.map +1 -1
- package/lib/esm/TextureMapping.js +22 -17
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/ViewFlags.d.ts +1 -3
- package/lib/esm/ViewFlags.d.ts.map +1 -1
- package/lib/esm/ViewFlags.js +1 -3
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/core-common.d.ts +1 -1
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.d.ts +111 -0
- package/lib/esm/internal/PackedFeatureTable.d.ts.map +1 -0
- package/lib/esm/internal/PackedFeatureTable.js +342 -0
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -0
- package/lib/esm/internal/RenderMesh.d.ts +52 -0
- package/lib/esm/internal/RenderMesh.d.ts.map +1 -0
- package/lib/esm/{Render.js → internal/RenderMesh.js} +2 -23
- package/lib/esm/internal/RenderMesh.js.map +1 -0
- package/lib/esm/internal/cross-package.d.ts +2 -0
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +2 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +4 -4
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/package.json +7 -7
- package/lib/cjs/Render.d.ts +0 -85
- package/lib/cjs/Render.d.ts.map +0 -1
- package/lib/cjs/Render.js.map +0 -1
- package/lib/esm/Render.d.ts +0 -85
- package/lib/esm/Render.d.ts.map +0 -1
- package/lib/esm/Render.js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AC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,wBAAwB,GAAG,uBAAuB,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpG,IAAI,QAAQ;YACV,IAAI,CAAC,QAAQ,GAAG,gCAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,uBAAuB;YACzB,IAAI,CAAC,uBAAuB,GAAG,gCAAiB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACvF,CAAC;IAED,oDAAoD;aACtC,aAAQ,GAAG,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;;AAnH/E,wDAoHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\n\n/** The different modes by which a [[PlanarClipMaskSettings]] collects the geometry used to mask a model.\n * @public\n * @extensions\n */\nexport enum PlanarClipMaskMode {\n /** No masking. */\n None = 0,\n /** Mask based on priority. Different types of models have different default priorities as enumerated by [[PlanarClipMaskPriority]].\n * For example, background maps have the lowest priority, so they are masked by all other types, while design models have the highest priority and are therefore never masked.\n * The priority of a reality model can be overridden by [[PlanarClipMaskSettings.priority]]. This is useful to allow one reality model to mask another overlapping one.\n * Everything visible in the view creates the mask, so turning off models, categories, or elements (via fully transparent overrides) will make things not be in the mask.\n */\n Priority = 1,\n /** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s, regardless of what model is on or off in the view.\n * However, things that are off from category settings or element feature overrides in the view will not be in the mask for these models.\n */\n Models = 2,\n /** Indicates that masks should be produced from geometry belonging to a set of subcategories.\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\n */\n IncludeSubCategories = 3,\n /** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s.\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\n */\n IncludeElements = 4,\n /** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements.\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\n */\n ExcludeElements = 5,\n}\n\n/** The default priority values for a [[PlanarClipMaskSettings]], based on model type. Models with a lower priority are masked by models with a higher priority.\n * The default can be overridden by [[PlanarClipMaskSettings.priority]].\n * @public\n * @extensions\n */\nexport enum PlanarClipMaskPriority {\n /** Background map. */\n BackgroundMap = -2048,\n /** A reality model that spans the globe - e.g., OpenStreetMaps Buildings. */\n GlobalRealityModel = -1024,\n /** A reality model with a bounded range. */\n RealityModel = 0,\n /** A design model stored in the [IModelDb]($backend). */\n DesignModel = 2048,\n}\n\n/** JSON representation of a [[PlanarClipMaskSettings]].\n * @see [[DisplayStyleSettingsProps.planarClipOvr]] and [[ContextRealityModelProps.planarClipMask]].\n * @public\n * @extensions\n */\nexport interface PlanarClipMaskProps {\n /** Controls how the mask geometry is collected */\n mode: PlanarClipMaskMode;\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: CompressedId64Set;\n /** See [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\n subCategoryOrElementIds?: CompressedId64Set;\n /** See [[PlanarClipMaskSettings.priority]]. */\n priority?: number;\n /** See [[PlanarClipMaskSettings.transparency]]. */\n transparency?: number;\n /** See PlanarClipMaskSettings.invert */\n invert?: boolean;\n}\n\n/** Basic arguments supplied to [[PlanarClipMaskSettings.create]].\n * @public\n */\nexport interface BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.transparency]]. */\n transparency?: number;\n /** See [[PlanarClipMaskSettings.invert]]. */\n invert?: boolean;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Models]].\n * @public\n */\nexport interface ModelPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: Iterable<Id64String>;\n /** @internal */\n exclude?: never;\n /** @internal */\n elementIds?: never;\n /** @internal */\n subCategoryIds?: never;\n /** @internal */\n priority?: never;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludeElements]].\n * @public\n */\nexport interface ElementPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: Iterable<Id64String>;\n /** The elements used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\n elementIds: Iterable<Id64String>;\n /** If true, creates a mask of [[PlanarClipMaskMode.ExcludeElements]]; otherwise, [[PlanarClipMaskMode.IncludeElements]]. */\n exclude?: boolean;\n /** @internal */\n subCategoryIds?: never;\n /** @internal */\n priority?: never;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeSubCategories]].\n * @public\n */\nexport interface SubCategoryPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: Iterable<Id64String>;\n /** The subcategories used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\n subCategoryIds: Iterable<Id64String>;\n /** @internal */\n exclude?: never;\n /** @internal */\n elementIds?: never;\n /** @internal */\n priority?: never;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Priority]].\n * @public\n */\nexport interface PriorityPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.priority]]. */\n priority: number;\n /** @internal */\n exclude?: never;\n /** @internal */\n elementIds?: never;\n /** @internal */\n modelIds?: never;\n}\n\n/** Describes how to mask the geometry of one [GeometricModel]($backend) for display. The mask is produced by projecting geometry from any number of other models -\n * optionally filtered by [SubCategory]($backend) or by a set of specific [GeometricElement]($backend)s - onto a plane. Regions of the masked model that intersect the\n * mask are rendered partially or completely transparent. This is useful for, e.g., making subsurface geometry visible below the background map, or clipping out portions\n * of a reality model that intersect a design model.\n * @note Currently reality models (including background maps and terrain) can be masked, but design models can only produce masks.\n * @see [[DisplayStyleSettings.planarClipMasks]] to define clip masks for a [DisplayStyle]($backend).\n * @see [[ContextRealityModel.planarClipMaskSettings]] to apply a clip mask to a context reality model.\n * @public\n */\nexport class PlanarClipMaskSettings {\n /** Specifies how the mask geometry is produced. */\n public readonly mode: PlanarClipMaskMode;\n /** For any mode other than [[PlanarClipMaskMode.Priority]], the Ids of the [GeometricModel]($backend)s containing the geometry used to produce the mask,\n * and if `undefined`, no mask geometry will be created.\n * The mask geometry can be filtered by [[subCategoryOrElementIds]].\n */\n public readonly modelIds?: OrderedId64Iterable;\n /** For [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludedElements]], the Ids of the [GeometricElement]($backend)s to include or exclude from masking;\n * for [[PlanarClipMaskMode.IncludeSubCategories]], the Ids of the subcategories whose geometry contributes to the mask.\n * If undefined, Modes IncludeSubCategories, IncludeElements, and ExcludeElements behave like Models mode.\n */\n public readonly subCategoryOrElementIds?: OrderedId64Iterable;\n /** For [[PlanarClipMaskMode.Priority]], the priority value. */\n public readonly priority?: number;\n /** A value between 0 and 1 indicating an override for mask transparency. A transparency of 0 indicates complete masking. 1 is completely transparent (no masking).\n If no transparency is defined then the transparencies of the mask elements are used.\n */\n public readonly transparency?: number;\n /** A value of true indicates that the mask should be inverted and only content within the mask should be displayed, in other words the area inside the mask is displayed rather than outside. */\n public readonly invert: boolean;\n private readonly _modelIds?: CompressedId64Set;\n private readonly _subCategoryOrElementIds?: CompressedId64Set;\n\n /** The compressed representation of [[modelIds]]. */\n public get compressedModelIds(): CompressedId64Set | undefined {\n return this._modelIds;\n }\n\n /** Create a new [[PlanarClipMaskSettings]] object from its JSON representation. */\n public static fromJSON(json?: PlanarClipMaskProps): PlanarClipMaskSettings {\n if (!json || undefined === json.mode)\n return this.defaults;\n\n return new PlanarClipMaskSettings(json.mode, json.transparency, json.modelIds, json.subCategoryOrElementIds, json.priority, json.invert);\n }\n\n /** Create a new PlanarClipMaskSettings. */\n public static create(args: ModelPlanarClipMaskArgs | ElementPlanarClipMaskArgs | SubCategoryPlanarClipMaskArgs | PriorityPlanarClipMaskArgs): PlanarClipMaskSettings {\n const modelIds = args.modelIds ? CompressedId64Set.sortAndCompress(args.modelIds) : undefined;\n if (undefined !== args.priority)\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Priority, args.transparency, undefined, undefined, args.priority, args.invert);\n else if (undefined !== args.subCategoryIds)\n return new PlanarClipMaskSettings(PlanarClipMaskMode.IncludeSubCategories, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.subCategoryIds), undefined, args.invert);\n else if (undefined !== args.elementIds)\n return new PlanarClipMaskSettings(args.exclude ? PlanarClipMaskMode.ExcludeElements : PlanarClipMaskMode.IncludeElements, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.elementIds), undefined, args.invert);\n else\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Models, args.transparency, modelIds, undefined, undefined, args.invert);\n }\n\n /** Create JSON object representing this [[PlanarClipMaskSettings]] */\n public toJSON(): PlanarClipMaskProps {\n const props: PlanarClipMaskProps = { mode: this.mode };\n if (undefined !== this._modelIds)\n props.modelIds = this._modelIds;\n\n if (undefined !== this._subCategoryOrElementIds)\n props.subCategoryOrElementIds = this._subCategoryOrElementIds;\n\n if (undefined !== this.priority)\n props.priority = this.priority;\n\n if (undefined !== this.transparency)\n props.transparency = this.transparency;\n\n if (this.invert)\n props.invert = true;\n\n return props;\n }\n\n /** Returns true if masking is enabled. */\n public get isValid(): boolean {\n return this.mode !== PlanarClipMaskMode.None;\n }\n\n public equals(other: PlanarClipMaskSettings): boolean {\n return this.mode === other.mode &&\n this.priority === other.priority &&\n this.transparency === other.transparency &&\n this.invert === other.invert &&\n this._modelIds === other._modelIds &&\n this._subCategoryOrElementIds === other._subCategoryOrElementIds;\n }\n\n /** Create a copy of this TerrainSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A PlanarClipMaskSettings with all of its properties set to match those of`this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: PlanarClipMaskProps): PlanarClipMaskSettings {\n if (undefined === changedProps)\n return this;\n\n return PlanarClipMaskSettings.fromJSON({\n ...this.toJSON(),\n ...changedProps,\n });\n }\n\n private constructor(mode: PlanarClipMaskMode, transparency?: number, modelIds?: CompressedId64Set, subCategoryOrElementIds?: CompressedId64Set, priority?: number, invert?: boolean) {\n this.mode = mode;\n this._modelIds = modelIds;\n this._subCategoryOrElementIds = subCategoryOrElementIds;\n this.priority = priority;\n this.invert = true === invert;\n this.transparency = undefined !== transparency ? Math.max(0, Math.min(1, transparency)) : undefined;\n\n if (modelIds)\n this.modelIds = CompressedId64Set.iterable(modelIds);\n\n if (subCategoryOrElementIds)\n this.subCategoryOrElementIds = CompressedId64Set.iterable(subCategoryOrElementIds);\n }\n\n /** A default PlanarClipMask which masks nothing. */\n public static defaults = new PlanarClipMaskSettings(PlanarClipMaskMode.None);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PlanarClipMask.js","sourceR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QAC1B,IAAI,CAAC,wBAAwB,GAAG,uBAAuB,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpG,IAAI,QAAQ;YACV,IAAI,CAAC,QAAQ,GAAG,gCAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,uBAAuB;YACzB,IAAI,CAAC,uBAAuB,GAAG,gCAAiB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACvF,CAAC;IAED,oDAAoD;aACtC,aAAQ,GAAG,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;;AAnH/E,wDAoHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\n\n/** The different modes by which a [[PlanarClipMaskSettings]] collects the geometry used to mask a model.\n * @public\n * @extensions\n */\nexport enum PlanarClipMaskMode {\n /** No masking. */\n None = 0,\n /** Mask based on priority. Different types of models have different default priorities as enumerated by [[PlanarClipMaskPriority]].\n * For example, background maps have the lowest priority, so they are masked by all other types, while design models have the highest priority and are therefore never masked.\n * The priority of a reality model can be overridden by [[PlanarClipMaskSettings.priority]]. This is useful to allow one reality model to mask another overlapping one.\n * Everything visible in the view creates the mask, so turning off models, categories, or elements (via fully transparent overrides) will make things not be in the mask.\n */\n Priority = 1,\n /** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s, regardless of what model is on or off in the view.\n * However, things that are off from category settings or element feature overrides in the view will not be in the mask for these models.\n */\n Models = 2,\n /** Indicates that masks should be produced from geometry belonging to a set of subcategories.\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\n */\n IncludeSubCategories = 3,\n /** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s.\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\n */\n IncludeElements = 4,\n /** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements.\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\n */\n ExcludeElements = 5,\n}\n\n/** The default priority values for a [[PlanarClipMaskSettings]], based on model type. Models with a lower priority are masked by models with a higher priority.\n * The default can be overridden by [[PlanarClipMaskSettings.priority]].\n * @public\n * @extensions\n */\nexport enum PlanarClipMaskPriority {\n /** Background map. */\n BackgroundMap = -2048,\n /** A reality model that spans the globe - e.g., OpenStreetMaps Buildings. */\n GlobalRealityModel = -1024,\n /** A reality model with a bounded range. */\n RealityModel = 0,\n /** A design model stored in the [IModelDb]($backend). */\n DesignModel = 2048,\n}\n\n/** JSON representation of a [[PlanarClipMaskSettings]].\n * @see [[DisplayStyleSettingsProps.planarClipOvr]] and [[ContextRealityModelProps.planarClipMask]].\n * @public\n * @extensions\n */\nexport interface PlanarClipMaskProps {\n /** Controls how the mask geometry is collected */\n mode: PlanarClipMaskMode;\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: CompressedId64Set;\n /** See [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\n subCategoryOrElementIds?: CompressedId64Set;\n /** See [[PlanarClipMaskSettings.priority]]. */\n priority?: number;\n /** See [[PlanarClipMaskSettings.transparency]]. */\n transparency?: number;\n /** See PlanarClipMaskSettings.invert */\n invert?: boolean;\n}\n\n/** Basic arguments supplied to [[PlanarClipMaskSettings.create]].\n * @public\n */\nexport interface BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.transparency]]. */\n transparency?: number;\n /** See [[PlanarClipMaskSettings.invert]]. */\n invert?: boolean;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Models]].\n * @public\n */\nexport interface ModelPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: Iterable<Id64String>;\n exclude?: never;\n elementIds?: never;\n subCategoryIds?: never;\n priority?: never;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludeElements]].\n * @public\n */\nexport interface ElementPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: Iterable<Id64String>;\n /** The elements used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\n elementIds: Iterable<Id64String>;\n /** If true, creates a mask of [[PlanarClipMaskMode.ExcludeElements]]; otherwise, [[PlanarClipMaskMode.IncludeElements]]. */\n exclude?: boolean;\n subCategoryIds?: never;\n priority?: never;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeSubCategories]].\n * @public\n */\nexport interface SubCategoryPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.modelIds]]. */\n modelIds?: Iterable<Id64String>;\n /** The subcategories used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\n subCategoryIds: Iterable<Id64String>;\n exclude?: never;\n elementIds?: never;\n priority?: never;\n}\n\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Priority]].\n * @public\n */\nexport interface PriorityPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\n /** See [[PlanarClipMaskSettings.priority]]. */\n priority: number;\n exclude?: never;\n elementIds?: never;\n modelIds?: never;\n}\n\n/** Describes how to mask the geometry of one [GeometricModel]($backend) for display. The mask is produced by projecting geometry from any number of other models -\n * optionally filtered by [SubCategory]($backend) or by a set of specific [GeometricElement]($backend)s - onto a plane. Regions of the masked model that intersect the\n * mask are rendered partially or completely transparent. This is useful for, e.g., making subsurface geometry visible below the background map, or clipping out portions\n * of a reality model that intersect a design model.\n * @note Currently reality models (including background maps and terrain) can be masked, but design models can only produce masks.\n * @see [[DisplayStyleSettings.planarClipMasks]] to define clip masks for a [DisplayStyle]($backend).\n * @see [[ContextRealityModel.planarClipMaskSettings]] to apply a clip mask to a context reality model.\n * @public\n */\nexport class PlanarClipMaskSettings {\n /** Specifies how the mask geometry is produced. */\n public readonly mode: PlanarClipMaskMode;\n /** For any mode other than [[PlanarClipMaskMode.Priority]], the Ids of the [GeometricModel]($backend)s containing the geometry used to produce the mask,\n * and if `undefined`, no mask geometry will be created.\n * The mask geometry can be filtered by [[subCategoryOrElementIds]].\n */\n public readonly modelIds?: OrderedId64Iterable;\n /** For [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludedElements]], the Ids of the [GeometricElement]($backend)s to include or exclude from masking;\n * for [[PlanarClipMaskMode.IncludeSubCategories]], the Ids of the subcategories whose geometry contributes to the mask.\n * If undefined, Modes IncludeSubCategories, IncludeElements, and ExcludeElements behave like Models mode.\n */\n public readonly subCategoryOrElementIds?: OrderedId64Iterable;\n /** For [[PlanarClipMaskMode.Priority]], the priority value. */\n public readonly priority?: number;\n /** A value between 0 and 1 indicating an override for mask transparency. A transparency of 0 indicates complete masking. 1 is completely transparent (no masking).\n If no transparency is defined then the transparencies of the mask elements are used.\n */\n public readonly transparency?: number;\n /** A value of true indicates that the mask should be inverted and only content within the mask should be displayed, in other words the area inside the mask is displayed rather than outside. */\n public readonly invert: boolean;\n private readonly _modelIds?: CompressedId64Set;\n private readonly _subCategoryOrElementIds?: CompressedId64Set;\n\n /** The compressed representation of [[modelIds]]. */\n public get compressedModelIds(): CompressedId64Set | undefined {\n return this._modelIds;\n }\n\n /** Create a new [[PlanarClipMaskSettings]] object from its JSON representation. */\n public static fromJSON(json?: PlanarClipMaskProps): PlanarClipMaskSettings {\n if (!json || undefined === json.mode)\n return this.defaults;\n\n return new PlanarClipMaskSettings(json.mode, json.transparency, json.modelIds, json.subCategoryOrElementIds, json.priority, json.invert);\n }\n\n /** Create a new PlanarClipMaskSettings. */\n public static create(args: ModelPlanarClipMaskArgs | ElementPlanarClipMaskArgs | SubCategoryPlanarClipMaskArgs | PriorityPlanarClipMaskArgs): PlanarClipMaskSettings {\n const modelIds = args.modelIds ? CompressedId64Set.sortAndCompress(args.modelIds) : undefined;\n if (undefined !== args.priority)\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Priority, args.transparency, undefined, undefined, args.priority, args.invert);\n else if (undefined !== args.subCategoryIds)\n return new PlanarClipMaskSettings(PlanarClipMaskMode.IncludeSubCategories, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.subCategoryIds), undefined, args.invert);\n else if (undefined !== args.elementIds)\n return new PlanarClipMaskSettings(args.exclude ? PlanarClipMaskMode.ExcludeElements : PlanarClipMaskMode.IncludeElements, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.elementIds), undefined, args.invert);\n else\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Models, args.transparency, modelIds, undefined, undefined, args.invert);\n }\n\n /** Create JSON object representing this [[PlanarClipMaskSettings]] */\n public toJSON(): PlanarClipMaskProps {\n const props: PlanarClipMaskProps = { mode: this.mode };\n if (undefined !== this._modelIds)\n props.modelIds = this._modelIds;\n\n if (undefined !== this._subCategoryOrElementIds)\n props.subCategoryOrElementIds = this._subCategoryOrElementIds;\n\n if (undefined !== this.priority)\n props.priority = this.priority;\n\n if (undefined !== this.transparency)\n props.transparency = this.transparency;\n\n if (this.invert)\n props.invert = true;\n\n return props;\n }\n\n /** Returns true if masking is enabled. */\n public get isValid(): boolean {\n return this.mode !== PlanarClipMaskMode.None;\n }\n\n public equals(other: PlanarClipMaskSettings): boolean {\n return this.mode === other.mode &&\n this.priority === other.priority &&\n this.transparency === other.transparency &&\n this.invert === other.invert &&\n this._modelIds === other._modelIds &&\n this._subCategoryOrElementIds === other._subCategoryOrElementIds;\n }\n\n /** Create a copy of this TerrainSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A PlanarClipMaskSettings with all of its properties set to match those of`this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: PlanarClipMaskProps): PlanarClipMaskSettings {\n if (undefined === changedProps)\n return this;\n\n return PlanarClipMaskSettings.fromJSON({\n ...this.toJSON(),\n ...changedProps,\n });\n }\n\n private constructor(mode: PlanarClipMaskMode, transparency?: number, modelIds?: CompressedId64Set, subCategoryOrElementIds?: CompressedId64Set, priority?: number, invert?: boolean) {\n this.mode = mode;\n this._modelIds = modelIds;\n this._subCategoryOrElementIds = subCategoryOrElementIds;\n this.priority = priority;\n this.invert = true === invert;\n this.transparency = undefined !== transparency ? Math.max(0, Math.min(1, transparency)) : undefined;\n\n if (modelIds)\n this.modelIds = CompressedId64Set.iterable(modelIds);\n\n if (subCategoryOrElementIds)\n this.subCategoryOrElementIds = CompressedId64Set.iterable(subCategoryOrElementIds);\n }\n\n /** A default PlanarClipMask which masks nothing. */\n public static defaults = new PlanarClipMaskSettings(PlanarClipMaskMode.None);\n}\n"]}
|
package/lib/cjs/QPoint.d.ts
CHANGED
|
@@ -19,19 +19,19 @@ export declare namespace Quantization {
|
|
|
19
19
|
const rangeScale8 = 255;
|
|
20
20
|
/** Compute the scale factor required to quantize `extent` to `rangeScale` discrete values. */
|
|
21
21
|
function computeScale(extent: number, rangeScale?: number): number;
|
|
22
|
-
/**
|
|
22
|
+
/** Returns true if the quantized value `qpos` fits within the specified range. */
|
|
23
23
|
function isInRange(qpos: number, rangeScale?: number): boolean;
|
|
24
24
|
/** Return `pos` quantized to the range [`origin`, `origin + rangeScale`].
|
|
25
25
|
* @see [[Quantization.unquantize]] for the inverse operation.
|
|
26
26
|
*/
|
|
27
27
|
function quantize(pos: number, origin: number, scale: number, rangeScale?: number): number;
|
|
28
|
-
/**
|
|
28
|
+
/** Returns true if the value `pos` can be quantized to the specified range. */
|
|
29
29
|
function isQuantizable(pos: number, origin: number, scale: number, rangeScale?: number): boolean;
|
|
30
30
|
/** Give `qpos` quantized to the range [`origin`, `origin + rangeScale`], return the unquantized value.
|
|
31
31
|
* @see [[Quantization.quantize]] for the inverse operation.
|
|
32
32
|
*/
|
|
33
33
|
function unquantize(qpos: number, origin: number, scale: number): number;
|
|
34
|
-
/**
|
|
34
|
+
/** Returns true if `qpos` is a valid quantized 16-bit value. */
|
|
35
35
|
function isQuantized(qpos: number): boolean;
|
|
36
36
|
}
|
|
37
37
|
/** @alpha */
|
|
@@ -70,7 +70,7 @@ export declare class QParams2d {
|
|
|
70
70
|
static fromZeroToOne(rangeScale?: number): QParams2d;
|
|
71
71
|
/** Create parameters from origin and scale components */
|
|
72
72
|
static fromOriginAndScale(originX: number, originY: number, scaleX: number, scaleY: number): QParams2d;
|
|
73
|
-
/**
|
|
73
|
+
/** The diagonal of the unquantized range represented by these parameters. */
|
|
74
74
|
get rangeDiagonal(): Vector2d;
|
|
75
75
|
/** Return true if the point point is quantizable using these parameters. */
|
|
76
76
|
isQuantizable(point: Point2d): boolean;
|
|
@@ -239,7 +239,7 @@ export declare class QParams3d {
|
|
|
239
239
|
static fromNormalizedRange(rangeScale?: number): QParams3d;
|
|
240
240
|
/** Creates parameters supporting quantization of values within the range [0.0, 1.0]. */
|
|
241
241
|
static fromZeroToOne(rangeScale?: number): QParams3d;
|
|
242
|
-
/**
|
|
242
|
+
/** The diagonal of the unquantized range represented by these parameters. */
|
|
243
243
|
get rangeDiagonal(): Vector3d;
|
|
244
244
|
/** Return true if the point point is quantizable using these parameters. */
|
|
245
245
|
isQuantizable(point: Point3d): boolean;
|
package/lib/cjs/QPoint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QPoint.d.ts","sourceRoot":"","sources":["../../src/QPoint.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EACtE,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,yBAAiB,YAAY,CAAC;IACrB,MAAM,YAAY,QAAS,CAAC;IAC5B,MAAM,WAAW,MAAO,CAAC;IAEhC,8FAA8F;IAC9F,SAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,SAAe,GAAG,MAAM,CAE9E;IAED,
|
|
1
|
+
{"version":3,"file":"QPoint.d.ts","sourceRoot":"","sources":["../../src/QPoint.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EACtE,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,yBAAiB,YAAY,CAAC;IACrB,MAAM,YAAY,QAAS,CAAC;IAC5B,MAAM,WAAW,MAAO,CAAC;IAEhC,8FAA8F;IAC9F,SAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,SAAe,GAAG,MAAM,CAE9E;IAED,kFAAkF;IAClF,SAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,SAAe,GAAG,OAAO,CAE1E;IAED;;OAEG;IAC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,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkB;IAEnD,oEAAoE;IACpE,SAAgB,MAAM,EAAE,SAAS,CAAC;IAClC,wCAAwC;IACxC,SAAgB,MAAM,EAAE,kBAAkB,CAAC;IAE3C,wDAAwD;gBACrC,OAAO,EAAE,4BAA4B;IASxD,+DAA+D;IACxD,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAMrD,+DAA+D;IACxD,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI7B,wDAAwD;IACxD,IAAW,MAAM,IAAI,MAAM,CAI1B;IAED;;;;;OAKG;IACI,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ;IAI3D;;;;;OAKG;IACI,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAIhE,wGAAwG;IACjG,MAAM,IAAI,cAAc;CAMhC"}
|
package/lib/cjs/QPoint.js
CHANGED
|
@@ -30,7 +30,7 @@ var Quantization;
|
|
|
30
30
|
return 0.0 === extent ? extent : rangeScale / extent;
|
|
31
31
|
}
|
|
32
32
|
Quantization.computeScale = computeScale;
|
|
33
|
-
/**
|
|
33
|
+
/** Returns true if the quantized value `qpos` fits within the specified range. */
|
|
34
34
|
function isInRange(qpos, rangeScale = Quantization.rangeScale16) {
|
|
35
35
|
return qpos >= 0.0 && qpos < rangeScale + 1.0;
|
|
36
36
|
}
|
|
@@ -42,7 +42,7 @@ var Quantization;
|
|
|
42
42
|
return Math.floor(Math.max(0.0, Math.min(rangeScale, 0.5 + (pos - origin) * scale)));
|
|
43
43
|
}
|
|
44
44
|
Quantization.quantize = quantize;
|
|
45
|
-
/**
|
|
45
|
+
/** Returns true if the value `pos` can be quantized to the specified range. */
|
|
46
46
|
function isQuantizable(pos, origin, scale, rangeScale = Quantization.rangeScale16) {
|
|
47
47
|
return isInRange(quantize(pos, origin, scale, rangeScale));
|
|
48
48
|
}
|
|
@@ -54,7 +54,7 @@ var Quantization;
|
|
|
54
54
|
return 0.0 === scale ? origin : origin + qpos / scale;
|
|
55
55
|
}
|
|
56
56
|
Quantization.unquantize = unquantize;
|
|
57
|
-
/**
|
|
57
|
+
/** Returns true if `qpos` is a valid quantized 16-bit value. */
|
|
58
58
|
function isQuantized(qpos) {
|
|
59
59
|
return isInRange(qpos) && qpos === Math.floor(qpos);
|
|
60
60
|
}
|
|
@@ -126,7 +126,7 @@ class QParams2d {
|
|
|
126
126
|
static fromOriginAndScale(originX, originY, scaleX, scaleY) {
|
|
127
127
|
return new QParams2d(originX, originY, scaleX, scaleY);
|
|
128
128
|
}
|
|
129
|
-
/**
|
|
129
|
+
/** The diagonal of the unquantized range represented by these parameters. */
|
|
130
130
|
get rangeDiagonal() {
|
|
131
131
|
return core_geometry_1.Vector2d.createFrom({ x: 0 === this.scale.x ? 0 : Quantization.rangeScale16 / this.scale.x, y: 0 === this.scale.y ? 0 : Quantization.rangeScale16 / this.scale.y });
|
|
132
132
|
}
|
|
@@ -436,7 +436,7 @@ class QParams3d {
|
|
|
436
436
|
static fromZeroToOne(rangeScale = Quantization.rangeScale16) {
|
|
437
437
|
return QParams3d.fromRange(core_geometry_1.Range3d.createArray([core_geometry_1.Point3d.create(0, 0, 0), core_geometry_1.Point3d.create(1, 1, 1)]), undefined, rangeScale);
|
|
438
438
|
}
|
|
439
|
-
/**
|
|
439
|
+
/** The diagonal of the unquantized range represented by these parameters. */
|
|
440
440
|
get rangeDiagonal() {
|
|
441
441
|
return core_geometry_1.Vector3d.createFrom({
|
|
442
442
|
x: this.scale.x === 0 ? 0 : Quantization.rangeScale16 / this.scale.x,
|
package/lib/cjs/QPoint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QPoint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AAU,CAAC,UAAkB,EAAE,MAAgB;QACpD,OAAO,IAAI,CAAC,GAAG,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":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n\nimport { assert, Uint16ArrayBuilder } from \"@itwin/core-bentley\";\nimport {\n Point2d, Point3d, Range2d, Range3d, Vector2d, Vector3d, XAndY, XYAndZ,\n} from \"@itwin/core-geometry\";\n\n/**\n * Provides facilities for quantizing floating point values within a specified range into 16-bit unsigned integers.\n * This is a lossy compression technique.\n * Given a floating point range [min, max], a floating point value `x` within that range is quantized by subtracting\n * `min`, scaling the result according to `max`, and truncating the result to an integer.\n * Therefore min quantizes to 0, max to 0xffff, (min+max)/2 to 0x7fff, and so on.\n * These routines are chiefly used by classes like [[QPoint2d]] and [[QPoint3d]] to reduce the space required to store\n * coordinate values for [RenderGraphic]($frontend)s.\n * @public\n * @extensions\n */\nexport namespace Quantization {\n export const rangeScale16 = 0xffff;\n export const rangeScale8 = 0xff;\n\n /** Compute the scale factor required to quantize `extent` to `rangeScale` discrete values. */\n export function computeScale(extent: number, rangeScale = rangeScale16): number {\n return 0.0 === extent ? extent : rangeScale / extent;\n }\n\n /** @internal */\n export function isInRange(qpos: number, rangeScale = rangeScale16): boolean {\n return qpos >= 0.0 && qpos < rangeScale + 1.0;\n }\n\n /** Return `pos` quantized to the range [`origin`, `origin + rangeScale`].\n * @see [[Quantization.unquantize]] for the inverse operation.\n */\n export function quantize(pos: number, origin: number, scale: number, rangeScale = rangeScale16): number {\n return Math.floor(Math.max(0.0, Math.min(rangeScale, 0.5 + (pos - origin) * scale)));\n }\n\n /** @internal */\n export function isQuantizable(pos: number, origin: number, scale: number, rangeScale = rangeScale16) {\n return isInRange(quantize(pos, origin, scale, rangeScale));\n }\n\n /** Give `qpos` quantized to the range [`origin`, `origin + rangeScale`], return the unquantized value.\n * @see [[Quantization.quantize]] for the inverse operation.\n */\n export function unquantize(qpos: number, origin: number, scale: number): number {\n return 0.0 === scale ? origin : origin + qpos / scale;\n }\n\n /** @internal */\n export function isQuantized(qpos: number) {\n return isInRange(qpos) && qpos === Math.floor(qpos);\n }\n}\n\n/** @alpha */\nexport interface QParams2dProps {\n origin: XAndY;\n scale: XAndY;\n}\n\n/** Parameters used for [[Quantization]] of 2d points such that the `x` and `y` components are each quantized to 16-bit unsigned integers.\n * @see [[QPoint2d]] for the quantized representation of a [Point2d]($core-geometry).\n * @see [[QPoint2dList]] for a list of [[QPoint2d]]s quantized using a [[QParams2d]].\n * @public\n * @extensions\n */\nexport class QParams2d {\n /** The origin of the quantization range. */\n public readonly origin = new Point2d();\n /** The scale applied to coordinates to quantize them. */\n public readonly scale = new Point2d();\n\n private constructor(ox = 0, oy = 0, sx = 0, sy = 0) { this.setFrom(ox, oy, sx, sy); }\n\n private setFrom(ox: number, oy: number, sx: number, sy: number) {\n this.origin.x = ox;\n this.origin.y = oy;\n this.scale.x = sx;\n this.scale.y = sy;\n }\n\n /** Set [[origin]] and [[scale]] from `src`. */\n public copyFrom(src: QParams2d): void {\n this.setFrom(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\n }\n\n /** Create a copy of these params.\n * @param out If supplied, these QParams2d will be modified and returned; otherwise a new QParams2d object will be created and returned.\n */\n public clone(out?: QParams2d): QParams2d {\n const result = undefined !== out ? out : new QParams2d();\n result.copyFrom(this);\n return result;\n }\n\n /** Initialize these parameters to support quantization of values within the specified range. */\n public setFromRange(range: Range2d, rangeScale = Quantization.rangeScale16) {\n if (!range.isNull) {\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));\n } else {\n this.origin.x = this.origin.y = this.scale.x = this.scale.y = 0;\n }\n }\n\n /** Create parameters to support quantization of values within the specified range. */\n public static fromRange(range: Range2d, out?: QParams2d, rangeScale = Quantization.rangeScale16) {\n const params = undefined !== out ? out : new QParams2d();\n params.setFromRange(range, rangeScale);\n return params;\n }\n\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. */\n public unquantize(x: number, y: number, out?: Point2d): Point2d {\n out = out ?? new Point2d();\n out.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\n out.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\n return out;\n }\n\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0], appropriate for normalized 2d vectors. */\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(-1, -1), Point2d.create(1, 1)]), undefined, rangeScale);\n }\n\n /** Create parameters supporting quantization of values within the range [0.0, 1.0]. */\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(0, 0), Point2d.create(1, 1)]), undefined, rangeScale);\n }\n\n /** Create parameters from origin and scale components */\n public static fromOriginAndScale(originX: number, originY: number, scaleX: number, scaleY: number) {\n return new QParams2d(originX, originY, scaleX, scaleY);\n }\n\n /** @internal */\n public get rangeDiagonal(): Vector2d {\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 });\n }\n\n /** Return true if the point point is quantizable using these parameters. */\n public isQuantizable(point: Point2d) {\n return Quantization.isQuantizable(point.x, this.origin.x, this.scale.x) && Quantization.isQuantizable(point.y, this.origin.y, this.scale.y);\n }\n\n /** @alpha */\n public toJSON(): QParams2dProps {\n return {\n origin: { x: this.origin.x, y: this.origin.y },\n scale: { x: this.scale.x, y: this.scale.y },\n };\n }\n\n /** @alpha */\n public static fromJSON(src: QParams2dProps): QParams2d {\n return this.fromOriginAndScale(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\n }\n}\n\n/** Represents a [Point2d]($core-geometry) compressed such that each component `x` and `y` is quantized to the 16-bit integer range [0, 0xffff].\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\n * @see [[QParams2d]] to define quantization parameters for a range of points.\n * @see [[QPoint2dList]] for a list of points all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint2d {\n private _x: number = 0;\n private _y: number = 0;\n\n /** The quantized x component. */\n public get x() { return this._x; }\n public set x(x: number) {\n assert(Quantization.isQuantized(x));\n this._x = x;\n }\n\n /** The quantized y component. */\n public get y() { return this._y; }\n public set y(y: number) {\n assert(Quantization.isQuantized(y));\n this._y = y;\n }\n\n /** Construct with `x` and `y` initialized to zero. */\n public constructor() { }\n\n /** Initialize this point by quantizing the supplied { x, y } using the specified params */\n public init(pos: XAndY, params: QParams2d) {\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\n }\n\n /** Create a quantized point from the supplied Point2d using the specified params */\n public static create(pos: Point2d, params: QParams2d) {\n const qpt = new QPoint2d();\n qpt.init(pos, params);\n return qpt;\n }\n\n /** Initialize `x` and `y` from `src`. */\n public copyFrom(src: QPoint2d) {\n this.x = src.x;\n this.y = src.y;\n }\n\n /** Create a copy of this point.\n * @param out If supplied, it will be modified in-place and returned; otherwise a new QPoint2d will be allocated and returned.\n */\n public clone(out?: QPoint2d) {\n const result = undefined !== out ? out : new QPoint2d();\n result.copyFrom(this);\n return result;\n }\n\n /**\n * Set the x and y components directly.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n */\n public setFromScalars(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Create a QPoint2d directly from x and y components.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n */\n public static fromScalars(x: number, y: number) {\n const pt = new QPoint2d();\n pt.setFromScalars(x, y);\n return pt;\n }\n\n /** Return a Point2d unquantized according to the supplied `params`. If `out` is supplied, it will be modified in-place and returned. */\n public unquantize(params: QParams2d, out?: Point2d): Point2d {\n const pt: Point2d = undefined !== out ? out : new Point2d();\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\n return pt;\n }\n}\n\n/** A compact representation of a list of [[QPoint2d]]s stored in a `Uint16Array`\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.uvs]($frontend).\n * @see [[QPoint3dBuffer]] for 3d points.\n * @public\n * @extensions\n */\nexport interface QPoint2dBuffer {\n /** The parameters used to quantize the [[points]]. */\n params: QParams2d;\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.\n * To obtain the `n`th point, use `QPoint2d.fromScalars(buffer.points[n * 2], buffer.points[n * 2 + 1])`.\n */\n points: Uint16Array;\n}\n\n/**\n * @public\n * @extensions\n */\nexport namespace QPoint2dBuffer {\n const scratchQPoint2d = new QPoint2d();\n\n /** Extracts the point at the specified index from a buffer.\n * @param points The buffer in which each consecutive pair of integers is a 2d quantized point.\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [[QPoint2d]] to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint2d): QPoint2d {\n const index = pointIndex * 2;\n const x = points[index + 0];\n const y = points[index + 1];\n if (undefined === x || undefined === y)\n throw new Error(\"Index out of range\");\n\n result = result ?? new QPoint2d();\n result.setFromScalars(x, y);\n return result;\n }\n\n /** Extracts and unquantizes the point at the specified index from a buffer.\n * @param buffer The array of points and the quantization parameters.\n * @param The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [Point2d]($core-geometry) to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function unquantizePoint(buffer: QPoint2dBuffer, pointIndex: number, result?: Point2d): Point2d {\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint2d);\n return qpt.unquantize(buffer.params, result);\n }\n}\n\n/** A list of [[QPoint2d]]s all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint2dList {\n /** Parameters used to quantize the points. */\n public readonly params: QParams2d;\n private readonly _list = new Array<QPoint2d>();\n\n /** The list of quantized points. */\n public get list(): ReadonlyArray<QPoint2d> {\n return this._list;\n }\n\n /** Construct an empty list set up to use the supplied quantization parameters. */\n public constructor(params: QParams2d) {\n this.params = params.clone();\n }\n\n /** Removes all points from the list. */\n public clear() {\n this._list.length = 0;\n }\n\n /** Removes all points from the list and change the quantization parameters. */\n public reset(params: QParams2d) {\n this.clear();\n this.params.copyFrom(params);\n }\n\n /** Quantizes the supplied Point2d to this list's range and appends it to the list. */\n public add(pt: Point2d) {\n this._list.push(QPoint2d.create(pt, this.params));\n }\n\n /** Adds a previously-quantized point to this list. */\n public push(qpt: QPoint2d) {\n this._list.push(qpt.clone());\n }\n\n /** The number of points in the list. */\n public get length() {\n return this._list.length;\n }\n\n /** Returns the unquantized value of the point at the specified index in the list. */\n public unquantize(index: number, out?: Point2d): Point2d {\n assert(index < this.length);\n if (index < this.length) {\n return this._list[index].unquantize(this.params, out);\n } else {\n return undefined !== out ? out : new Point2d();\n }\n }\n\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\n * @note The loss of precision is compounded each time the points are requantized to a new range.\n */\n public requantize(params: QParams2d) {\n for (let i = 0; i < this.length; i++) {\n const pt = this.unquantize(i);\n this._list[i].init(pt, params);\n }\n\n this.params.copyFrom(params);\n }\n\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,\n * the second to the first point's `y` component, and so on.\n */\n public toTypedArray(): Uint16Array {\n const array = new Uint16Array(this.length * 2);\n const pts = this._list;\n for (let i = 0; i < this.length; i++) {\n const pt = pts[i];\n array[i * 2] = pt.x;\n array[i * 2 + 1] = pt.y;\n }\n\n return array;\n }\n\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. */\n public fromTypedArray(range: Range2d, array: Uint16Array) {\n this.params.setFromRange(range);\n this._list.length = array.length / 2;\n for (let i = 0, j = 0; i < this.list.length; i++)\n this._list[i] = QPoint2d.fromScalars(array[j++], array[j++]);\n }\n\n /** Construct a QPoint2dList containing all points in the supplied list, quantized to the range of those points. */\n public static fromPoints(points: Point2d[], out?: QPoint2dList) {\n let qPoints;\n const qParams = QParams2d.fromRange(Range2d.createArray(points));\n if (out) {\n qPoints = out;\n qPoints.reset(qParams);\n } else {\n qPoints = new QPoint2dList(qParams);\n }\n\n for (const point of points)\n qPoints.add(point);\n\n return qPoints;\n }\n}\n\n/** @alpha */\nexport interface QParams3dProps {\n origin: XYAndZ;\n scale: XYAndZ;\n}\n\n/** Parameters used for [[Quantization]] of 3d points such that the `x`, `y`, and `z` components are each quantized to 16-bit unsigned integers.\n * @see [[QPoint3d]] for the quantized representation of a [Point3d]($core-geometry).\n * @see [[QPoint3dList]] for a list of [[QPoint3d]]s quantized using a [[QParams3d]].\n * @public\n * @extensions\n */\nexport class QParams3d {\n /** The origin of the quantization range. */\n public readonly origin = new Point3d();\n /** The scale applied to coordinates to quantize them. */\n public readonly scale = new Point3d();\n\n private constructor(ox = 0, oy = 0, oz = 0, sx = 0, sy = 0, sz = 0) {\n this.setFrom(ox, oy, oz, sx, sy, sz);\n }\n\n private setFrom(ox: number, oy: number, oz: number, sx: number, sy: number, sz: number) {\n this.origin.x = ox;\n this.origin.y = oy;\n this.origin.z = oz;\n this.scale.x = sx;\n this.scale.y = sy;\n this.scale.z = sz;\n }\n\n /** Set `x`, `y`, and `z` from `src. */\n public copyFrom(src: QParams3d): void {\n this.setFrom(src.origin.x, src.origin.y, src.origin.z, src.scale.x, src.scale.y, src.scale.z);\n }\n\n /** Create a copy of these parameters.\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\n */\n public clone(out?: QParams3d): QParams3d {\n const result = undefined !== out ? out : new QParams3d();\n result.copyFrom(this);\n return result;\n }\n\n /** Initialize from origin and scale */\n public setFromOriginAndScale(origin: Point3d, scale: Point3d) {\n this.setFrom(origin.x, origin.y, origin.z, scale.x, scale.y, scale.z);\n }\n\n /** Initialize these parameters to support quantization of values within the specified range. */\n public setFromRange(range: Range3d, rangeScale = Quantization.rangeScale16) {\n if (!range.isNull) {\n this.setFrom(range.low.x, range.low.y, range.low.z,\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));\n } else {\n this.origin.x = this.origin.y = this.origin.z = 0;\n this.scale.x = this.scale.y = this.scale.z = 0;\n }\n }\n\n /** Return the unquantized point for the input components.\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new Point3d.\n */\n public unquantize(x: number, y: number, z: number, out?: Point3d): Point3d {\n const pt: Point3d = undefined !== out ? out : new Point3d();\n pt.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\n pt.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\n pt.z = Quantization.unquantize(z, this.origin.z, this.scale.z);\n return pt;\n }\n\n /** Creates parameters to support quantization of values within the specified range.\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\n */\n public static fromRange(range: Range3d, out?: QParams3d, rangeScale = Quantization.rangeScale16): QParams3d {\n const params = undefined !== out ? out : new QParams3d();\n params.setFromRange(range, rangeScale);\n return params;\n }\n\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0].\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\n */\n public static fromOriginAndScale(origin: Point3d, scale: Point3d, out?: QParams3d): QParams3d {\n const params = undefined !== out ? out : new QParams3d();\n params.setFromOriginAndScale(origin, scale);\n return params;\n }\n\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0]. */\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(-1, -1, -1), Point3d.create(1, 1, 1)]), undefined, rangeScale);\n }\n\n /** Creates parameters supporting quantization of values within the range [0.0, 1.0]. */\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(0, 0, 0), Point3d.create(1, 1, 1)]), undefined, rangeScale);\n }\n\n /** @internal */\n public get rangeDiagonal(): Vector3d {\n return Vector3d.createFrom({\n x: this.scale.x === 0 ? 0 : Quantization.rangeScale16 / this.scale.x,\n y: this.scale.y === 0 ? 0 : Quantization.rangeScale16 / this.scale.y,\n z: this.scale.z === 0 ? 0 : Quantization.rangeScale16 / this.scale.z,\n });\n }\n\n /** Return true if the point point is quantizable using these parameters. */\n public isQuantizable(point: Point3d) {\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);\n }\n\n /** Compute the range to which these parameters quantize. */\n public computeRange(out?: Range3d): Range3d {\n const range = Range3d.createNull(out);\n range.extendPoint(this.origin);\n range.extendPoint(this.origin.plus(this.rangeDiagonal));\n return range;\n }\n\n /** @alpha */\n public toJSON(): QParams3dProps {\n return {\n origin: { x: this.origin.x, y: this.origin.y, z: this.origin.z },\n scale: { x: this.scale.x, y: this.scale.y, z: this.scale.z },\n };\n }\n\n /** @alpha */\n public static fromJSON(src: QParams3dProps, out?: QParams3d): QParams3d {\n return this.fromOriginAndScale(Point3d.fromJSON(src.origin), Point3d.fromJSON(src.scale), out);\n }\n}\n\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].\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\n * @see [[QParams3d]] to define quantization parameters for a range of points.\n * @see [[QPoint3dList]] for a list of points all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint3d {\n private _x: number = 0;\n private _y: number = 0;\n private _z: number = 0;\n\n /** The quantized x component. */\n public get x() { return this._x; }\n public set x(x: number) {\n assert(Quantization.isQuantized(x));\n this._x = x;\n }\n\n /** The quantized y component. */\n public get y() { return this._y; }\n public set y(y: number) {\n assert(Quantization.isQuantized(y));\n this._y = y;\n }\n\n /** The quantized z component. */\n public get z() { return this._z; }\n public set z(z: number) {\n assert(Quantization.isQuantized(z));\n this._z = z;\n }\n\n /** Construct with all components initialized to zero. */\n public constructor() { }\n\n /** Initialize this point by quantizing the supplied { x, y, z } using the specified params */\n public init(pos: XYAndZ, params: QParams3d): void {\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\n this.z = Quantization.quantize(pos.z, params.origin.z, params.scale.z);\n }\n\n /** Creates a quantized point from the supplied Point3d using the specified params */\n public static create(pos: Point3d, params: QParams3d): QPoint3d {\n const qpt = new QPoint3d();\n qpt.init(pos, params);\n return qpt;\n }\n\n /** Set this points components from `src`. */\n public copyFrom(src: QPoint3d): void {\n this.x = src.x;\n this.y = src.y;\n this.z = src.z;\n }\n\n /** Create a copy of this point.\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\n */\n public clone(out?: QPoint3d): QPoint3d {\n const result = undefined !== out ? out : new QPoint3d();\n result.copyFrom(this);\n return result;\n }\n\n /**\n * Sets the x, y, and z components directly.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n * @param z Must be an integer in the range [0, 0xffff]\n */\n public setFromScalars(x: number, y: number, z: number) {\n this.x = x;\n this.y = y;\n this.z = z;\n }\n\n /**\n * Creates a QPoint3d directly from x, y, and z components.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n * @param z Must be an integer in the range [0, 0xffff]\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\n */\n public static fromScalars(x: number, y: number, z: number, out?: QPoint3d): QPoint3d {\n const pt = undefined === out ? new QPoint3d() : out;\n pt.setFromScalars(x, y, z);\n return pt;\n }\n\n /** Returns a Point3d unquantized according to the supplied params.\n * If `out` is supplied, it will be modified in-place instead of allocating a new Point3d.\n */\n public unquantize(params: QParams3d, out?: Point3d): Point3d {\n const pt: Point3d = undefined !== out ? out : new Point3d();\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\n pt.z = Quantization.unquantize(this.z, params.origin.z, params.scale.z);\n return pt;\n }\n\n /** Return true if this point's components are identical to the other point's components. */\n public equals(other: QPoint3d): boolean {\n return this.x === other.x && this.y === other.y && this.z === other.z;\n }\n\n /** Perform ordinal comparison to another point. The function returns:\n * - Zero if this point is identical to `rhs`; or\n * - A number less than zero if this point is ordered before `rhs`; or\n * - A number greater than zero if this point is ordered after `rhs`.\n * @see [OrderedComparator]($core-bentley).\n */\n public compare(rhs: QPoint3d): number {\n let diff = this.x - rhs.x;\n if (0 === diff) {\n diff = this.y - rhs.y;\n if (0 === diff) {\n diff = this.z - rhs.z;\n }\n }\n\n return diff;\n }\n}\n\n/** A compact representation of a list of [[QPoint3d]]s stored in a `Uint16Array`.\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.positions]($frontend).\n * @public\n * @extensions\n */\nexport interface QPoint3dBuffer {\n /** The parameters used to quantize the [[points]]. */\n params: QParams3d;\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.\n * To obtain the `n`th point, use `QPoint3d.fromScalars(buffer.points[n * 3], buffer.points[n * 3 + 1], buffer.points[n * 3 + 2])`.\n */\n points: Uint16Array;\n}\n\n/** @public\n * @extensions\n */\nexport namespace QPoint3dBuffer {\n const scratchQPoint3d = new QPoint3d();\n\n /** Extracts the point at the specified index from a buffer.\n * @param points The buffer in which each consecutive pair of integers is a 3d quantized point.\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [[QPoint3d]] to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint3d): QPoint3d {\n const index = pointIndex * 3;\n const x = points[index + 0];\n const y = points[index + 1];\n const z = points[index + 2];\n if (undefined === x || undefined === y || undefined === z)\n throw new Error(\"Index out of range\");\n\n result = result ?? new QPoint3d();\n result.setFromScalars(x, y, z);\n return result;\n }\n\n /** Extracts and unquantizes the point at the specified index from a buffer.\n * @param buffer The array of points and the quantization parameters.\n * @param buffer The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [Point3d]($core-geometry) to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function unquantizePoint(buffer: QPoint3dBuffer, pointIndex: number, result?: Point3d): Point3d {\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint3d);\n return qpt.unquantize(buffer.params, result);\n }\n}\n\n/** A list of [[QPoint3d]]s all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint3dList {\n /** Parameters used to quantize the points. */\n public readonly params: QParams3d;\n private readonly _list: QPoint3d[] = [];\n\n /** The list of quantized points. */\n public get list(): ReadonlyArray<QPoint3d> {\n return this._list;\n }\n\n /** Construct an empty list set up to quantize to the supplied range.\n * @param params The quantization parameters. If omitted, a null range will be used.\n */\n public constructor(params?: QParams3d) {\n this.params = params ? params.clone() : QParams3d.fromRange(Range3d.createNull());\n }\n\n /** Construct a QPoint3dList containing all points in the supplied list, quantized to the range of those points.\n * @param points The points to quantize and add to the list.\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.\n */\n public static fromPoints(points: Point3d[], out?: QPoint3dList): QPoint3dList {\n let qPoints;\n const qParams = QParams3d.fromRange(Range3d.createArray(points));\n if (out) {\n qPoints = out;\n qPoints.reset(qParams);\n } else {\n qPoints = new QPoint3dList(qParams);\n }\n\n for (const point of points)\n qPoints.add(point);\n\n return qPoints;\n }\n\n /** Removes all points from the list. */\n public clear() {\n this._list.length = 0;\n }\n\n /** Clears out the contents of the list and changes the quantization parameters. */\n public reset(params: QParams3d) {\n this.clear();\n this.params.copyFrom(params);\n }\n\n /** Quantizes the supplied Point3d to this list's range and appends it to the list. */\n public add(pt: Point3d) {\n this._list.push(QPoint3d.create(pt, this.params));\n }\n\n /** Adds a previously-quantized point to this list. */\n public push(qpt: QPoint3d) {\n this._list.push(qpt.clone());\n }\n\n /** The number of points in the list. */\n public get length() {\n return this._list.length;\n }\n\n /** Returns the unquantized value of the point at the specified index in the list. */\n public unquantize(index: number, out?: Point3d): Point3d {\n assert(index < this.length);\n if (index < this.length) {\n return this._list[index].unquantize(this.params, out);\n } else {\n return undefined !== out ? out : new Point3d();\n }\n }\n\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\n * @note The loss of precision is compounded each time the points are requantized to a new range.\n */\n public requantize(params: QParams3d): void {\n for (let i = 0; i < this.length; i++) {\n const pt = this.unquantize(i);\n this._list[i].init(pt, params);\n }\n\n this.params.copyFrom(params);\n }\n\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,\n * the second three elements contain the second point's components, and so on.\n */\n public toTypedArray(): Uint16Array {\n const array = new Uint16Array(this.length * 3);\n const pts = this._list;\n for (let i = 0; i < this.length; i++) {\n const pt = pts[i];\n array[i * 3 + 0] = pt.x;\n array[i * 3 + 1] = pt.y;\n array[i * 3 + 2] = pt.z;\n }\n\n return array;\n }\n\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\n * of the second point, and so on.\n */\n public fromTypedArray(range: Range3d, array: Uint16Array): void {\n this.params.setFromRange(range);\n this._list.length = array.length / 3;\n for (let i = 0, j = 0; i < this.list.length; i++)\n this._list[i] = QPoint3d.fromScalars(array[j++], array[j++], array[j++]);\n }\n\n /** Construct a list containing all points in the supplied list, quantized using the supplied parameters. */\n public static createFrom(points: Point3d[], params: QParams3d): QPoint3dList {\n const list = new QPoint3dList(params);\n for (const point of points)\n list.add(point);\n\n return list;\n }\n\n /** An iterator over the points in the list. */\n public [Symbol.iterator]() {\n return this.list[Symbol.iterator]();\n }\n}\n\n/** Options used to construct a [[QPoint2dBufferBuilder]].\n * @public\n * @extensions\n */\ninterface QPoint2dBufferBuilderOptions {\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. */\n range: Range2d;\n /** The number of points for which to allocate space.\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\n */\n initialCapacity?: number;\n /** Multiplier used to compute new capacity when resizing the buffer.\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\n */\n growthFactor?: number;\n}\n\n/** Constructs a [[QPoint2dBuffer]] using a [Uint16ArrayBuilder]($bentley).\n * @public\n * @extensions\n */\nexport class QPoint2dBufferBuilder {\n private readonly _scratchQPoint2d = new QPoint2d();\n\n /** The parameters used to quantize the points in the [[buffer]]. */\n public readonly params: QParams2d;\n /** The buffer that holds the points. */\n public readonly buffer: Uint16ArrayBuilder;\n\n /** Construct a new buffer with a [[length]] of zero. */\n public constructor(options: QPoint2dBufferBuilderOptions) {\n this.params = QParams2d.fromRange(options.range);\n const initialCapacity = options.initialCapacity ?? 0;\n this.buffer = new Uint16ArrayBuilder({\n growthFactor: options.growthFactor,\n initialCapacity: 2 * initialCapacity,\n });\n }\n\n /** Append a point with the specified quantized coordinates. */\n public pushXY(x: number, y: number): void {\n this.buffer.push(x);\n this.buffer.push(y);\n }\n\n /** Append a point with the specified quantized coordinates. */\n public push(pt: XAndY): void {\n this.pushXY(pt.x, pt.y);\n }\n\n /** The number of points currently in the [[buffer]]. */\n public get length(): number {\n const len = this.buffer.length;\n assert(len % 2 === 0);\n return len / 2;\n }\n\n /** Returns the quantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [[QPoint2d]] to initialize with the result and return.\n * @returns The quantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public get(pointIndex: number, result?: QPoint2d): QPoint2d {\n return QPoint2dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\n }\n\n /** Returns the unquantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [Point2d]($core-geometry) to initialize with the result and return.\n * @returns The unquantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public unquantize(pointIndex: number, result?: Point2d): Point2d {\n return this.get(pointIndex, this._scratchQPoint2d).unquantize(this.params, result);\n }\n\n /** Obtain a [[QPoint2dBuffer]] containing all of the points that have been appended by this builder. */\n public finish(): QPoint2dBuffer {\n return {\n params: this.params,\n points: this.buffer.toTypedArray(),\n };\n }\n}\n\n/** Options used to construct a [[QPoint3dBufferBuilder]].\n * @public\n * @extensions\n */\ninterface QPoint3dBufferBuilderOptions {\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. */\n range: Range3d;\n /** The number of points for which to allocate space.\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\n */\n initialCapacity?: number;\n /** Multiplier used to compute new capacity when resizing the buffer.\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\n */\n growthFactor?: number;\n}\n\n/** Constructs a [[QPoint3dBuffer]] using a [Uint16ArrayBuilder]($bentley).\n * @public\n * @extensions\n */\nexport class QPoint3dBufferBuilder {\n private readonly _scratchQPoint3d = new QPoint3d();\n\n /** The parameters used to quantize the points in the [[buffer]]. */\n public readonly params: QParams3d;\n /** The buffer that holds the points. */\n public readonly buffer: Uint16ArrayBuilder;\n\n /** Construct a new buffer with a [[length]] of zero. */\n public constructor(options: QPoint3dBufferBuilderOptions) {\n this.params = QParams3d.fromRange(options.range);\n const initialCapacity = options.initialCapacity ?? 0;\n this.buffer = new Uint16ArrayBuilder({\n growthFactor: options.growthFactor,\n initialCapacity: 3 * initialCapacity,\n });\n }\n\n /** Append a point with the specified quantized coordinates. */\n public pushXYZ(x: number, y: number, z: number): void {\n this.buffer.push(x);\n this.buffer.push(y);\n this.buffer.push(z);\n }\n\n /** Append a point with the specified quantized coordinates. */\n public push(pt: XYAndZ): void {\n this.pushXYZ(pt.x, pt.y, pt.z);\n }\n\n /** The number of points currently in the [[buffer]]. */\n public get length(): number {\n const len = this.buffer.length;\n assert(len % 3 === 0);\n return len / 3;\n }\n\n /** Returns the quantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [[QPoint3d]] to initialize with the result and return.\n * @returns The quantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public get(pointIndex: number, result?: QPoint3d): QPoint3d {\n return QPoint3dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\n }\n\n /** Returns the unquantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [Point3d]($core-geometry) to initialize with the result and return.\n * @returns The unquantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public unquantize(pointIndex: number, result?: Point3d): Point3d {\n return this.get(pointIndex, this._scratchQPoint3d).unquantize(this.params, result);\n }\n\n /** Obtain a [[QPoint3dBuffer]] containing all of the points that have been appended by this builder. */\n public finish(): QPoint3dBuffer {\n return {\n params: this.params,\n points: this.buffer.toTypedArray(),\n };\n }\n}\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,kFAAkF;IAClF,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,+EAA+E;IAC/E,SAAgB,aAAa,CAAC,GAAW,EAAE,MAAc,EAAE,KAAa,EAAE,UAAU,GAAG,aAAA,YAAY;QACjG,OAAO,SAAS,CAAC,QAAQ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C9C,OAAO,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAClF,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,UAAkB,EAAE,MAAgB;QACpD,OAAO,IAAI,CAAC,GAAG,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":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n\nimport { assert, Uint16ArrayBuilder } from \"@itwin/core-bentley\";\nimport {\n Point2d, Point3d, Range2d, Range3d, Vector2d, Vector3d, XAndY, XYAndZ,\n} from \"@itwin/core-geometry\";\n\n/**\n * Provides facilities for quantizing floating point values within a specified range into 16-bit unsigned integers.\n * This is a lossy compression technique.\n * Given a floating point range [min, max], a floating point value `x` within that range is quantized by subtracting\n * `min`, scaling the result according to `max`, and truncating the result to an integer.\n * Therefore min quantizes to 0, max to 0xffff, (min+max)/2 to 0x7fff, and so on.\n * These routines are chiefly used by classes like [[QPoint2d]] and [[QPoint3d]] to reduce the space required to store\n * coordinate values for [RenderGraphic]($frontend)s.\n * @public\n * @extensions\n */\nexport namespace Quantization {\n export const rangeScale16 = 0xffff;\n export const rangeScale8 = 0xff;\n\n /** Compute the scale factor required to quantize `extent` to `rangeScale` discrete values. */\n export function computeScale(extent: number, rangeScale = rangeScale16): number {\n return 0.0 === extent ? extent : rangeScale / extent;\n }\n\n /** Returns true if the quantized value `qpos` fits within the specified range. */\n export function isInRange(qpos: number, rangeScale = rangeScale16): boolean {\n return qpos >= 0.0 && qpos < rangeScale + 1.0;\n }\n\n /** Return `pos` quantized to the range [`origin`, `origin + rangeScale`].\n * @see [[Quantization.unquantize]] for the inverse operation.\n */\n export function quantize(pos: number, origin: number, scale: number, rangeScale = rangeScale16): number {\n return Math.floor(Math.max(0.0, Math.min(rangeScale, 0.5 + (pos - origin) * scale)));\n }\n\n /** Returns true if the value `pos` can be quantized to the specified range. */\n export function isQuantizable(pos: number, origin: number, scale: number, rangeScale = rangeScale16) {\n return isInRange(quantize(pos, origin, scale, rangeScale));\n }\n\n /** Give `qpos` quantized to the range [`origin`, `origin + rangeScale`], return the unquantized value.\n * @see [[Quantization.quantize]] for the inverse operation.\n */\n export function unquantize(qpos: number, origin: number, scale: number): number {\n return 0.0 === scale ? origin : origin + qpos / scale;\n }\n\n /** Returns true if `qpos` is a valid quantized 16-bit value. */\n export function isQuantized(qpos: number) {\n return isInRange(qpos) && qpos === Math.floor(qpos);\n }\n}\n\n/** @alpha */\nexport interface QParams2dProps {\n origin: XAndY;\n scale: XAndY;\n}\n\n/** Parameters used for [[Quantization]] of 2d points such that the `x` and `y` components are each quantized to 16-bit unsigned integers.\n * @see [[QPoint2d]] for the quantized representation of a [Point2d]($core-geometry).\n * @see [[QPoint2dList]] for a list of [[QPoint2d]]s quantized using a [[QParams2d]].\n * @public\n * @extensions\n */\nexport class QParams2d {\n /** The origin of the quantization range. */\n public readonly origin = new Point2d();\n /** The scale applied to coordinates to quantize them. */\n public readonly scale = new Point2d();\n\n private constructor(ox = 0, oy = 0, sx = 0, sy = 0) { this.setFrom(ox, oy, sx, sy); }\n\n private setFrom(ox: number, oy: number, sx: number, sy: number) {\n this.origin.x = ox;\n this.origin.y = oy;\n this.scale.x = sx;\n this.scale.y = sy;\n }\n\n /** Set [[origin]] and [[scale]] from `src`. */\n public copyFrom(src: QParams2d): void {\n this.setFrom(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\n }\n\n /** Create a copy of these params.\n * @param out If supplied, these QParams2d will be modified and returned; otherwise a new QParams2d object will be created and returned.\n */\n public clone(out?: QParams2d): QParams2d {\n const result = undefined !== out ? out : new QParams2d();\n result.copyFrom(this);\n return result;\n }\n\n /** Initialize these parameters to support quantization of values within the specified range. */\n public setFromRange(range: Range2d, rangeScale = Quantization.rangeScale16) {\n if (!range.isNull) {\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));\n } else {\n this.origin.x = this.origin.y = this.scale.x = this.scale.y = 0;\n }\n }\n\n /** Create parameters to support quantization of values within the specified range. */\n public static fromRange(range: Range2d, out?: QParams2d, rangeScale = Quantization.rangeScale16) {\n const params = undefined !== out ? out : new QParams2d();\n params.setFromRange(range, rangeScale);\n return params;\n }\n\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. */\n public unquantize(x: number, y: number, out?: Point2d): Point2d {\n out = out ?? new Point2d();\n out.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\n out.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\n return out;\n }\n\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0], appropriate for normalized 2d vectors. */\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(-1, -1), Point2d.create(1, 1)]), undefined, rangeScale);\n }\n\n /** Create parameters supporting quantization of values within the range [0.0, 1.0]. */\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\n return QParams2d.fromRange(Range2d.createArray([Point2d.create(0, 0), Point2d.create(1, 1)]), undefined, rangeScale);\n }\n\n /** Create parameters from origin and scale components */\n public static fromOriginAndScale(originX: number, originY: number, scaleX: number, scaleY: number) {\n return new QParams2d(originX, originY, scaleX, scaleY);\n }\n\n /** The diagonal of the unquantized range represented by these parameters. */\n public get rangeDiagonal(): Vector2d {\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 });\n }\n\n /** Return true if the point point is quantizable using these parameters. */\n public isQuantizable(point: Point2d) {\n return Quantization.isQuantizable(point.x, this.origin.x, this.scale.x) && Quantization.isQuantizable(point.y, this.origin.y, this.scale.y);\n }\n\n /** @alpha */\n public toJSON(): QParams2dProps {\n return {\n origin: { x: this.origin.x, y: this.origin.y },\n scale: { x: this.scale.x, y: this.scale.y },\n };\n }\n\n /** @alpha */\n public static fromJSON(src: QParams2dProps): QParams2d {\n return this.fromOriginAndScale(src.origin.x, src.origin.y, src.scale.x, src.scale.y);\n }\n}\n\n/** Represents a [Point2d]($core-geometry) compressed such that each component `x` and `y` is quantized to the 16-bit integer range [0, 0xffff].\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\n * @see [[QParams2d]] to define quantization parameters for a range of points.\n * @see [[QPoint2dList]] for a list of points all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint2d {\n private _x: number = 0;\n private _y: number = 0;\n\n /** The quantized x component. */\n public get x() { return this._x; }\n public set x(x: number) {\n assert(Quantization.isQuantized(x));\n this._x = x;\n }\n\n /** The quantized y component. */\n public get y() { return this._y; }\n public set y(y: number) {\n assert(Quantization.isQuantized(y));\n this._y = y;\n }\n\n /** Construct with `x` and `y` initialized to zero. */\n public constructor() { }\n\n /** Initialize this point by quantizing the supplied { x, y } using the specified params */\n public init(pos: XAndY, params: QParams2d) {\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\n }\n\n /** Create a quantized point from the supplied Point2d using the specified params */\n public static create(pos: Point2d, params: QParams2d) {\n const qpt = new QPoint2d();\n qpt.init(pos, params);\n return qpt;\n }\n\n /** Initialize `x` and `y` from `src`. */\n public copyFrom(src: QPoint2d) {\n this.x = src.x;\n this.y = src.y;\n }\n\n /** Create a copy of this point.\n * @param out If supplied, it will be modified in-place and returned; otherwise a new QPoint2d will be allocated and returned.\n */\n public clone(out?: QPoint2d) {\n const result = undefined !== out ? out : new QPoint2d();\n result.copyFrom(this);\n return result;\n }\n\n /**\n * Set the x and y components directly.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n */\n public setFromScalars(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Create a QPoint2d directly from x and y components.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n */\n public static fromScalars(x: number, y: number) {\n const pt = new QPoint2d();\n pt.setFromScalars(x, y);\n return pt;\n }\n\n /** Return a Point2d unquantized according to the supplied `params`. If `out` is supplied, it will be modified in-place and returned. */\n public unquantize(params: QParams2d, out?: Point2d): Point2d {\n const pt: Point2d = undefined !== out ? out : new Point2d();\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\n return pt;\n }\n}\n\n/** A compact representation of a list of [[QPoint2d]]s stored in a `Uint16Array`\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.uvs]($frontend).\n * @see [[QPoint3dBuffer]] for 3d points.\n * @public\n * @extensions\n */\nexport interface QPoint2dBuffer {\n /** The parameters used to quantize the [[points]]. */\n params: QParams2d;\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.\n * To obtain the `n`th point, use `QPoint2d.fromScalars(buffer.points[n * 2], buffer.points[n * 2 + 1])`.\n */\n points: Uint16Array;\n}\n\n/**\n * @public\n * @extensions\n */\nexport namespace QPoint2dBuffer {\n const scratchQPoint2d = new QPoint2d();\n\n /** Extracts the point at the specified index from a buffer.\n * @param points The buffer in which each consecutive pair of integers is a 2d quantized point.\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [[QPoint2d]] to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint2d): QPoint2d {\n const index = pointIndex * 2;\n const x = points[index + 0];\n const y = points[index + 1];\n if (undefined === x || undefined === y)\n throw new Error(\"Index out of range\");\n\n result = result ?? new QPoint2d();\n result.setFromScalars(x, y);\n return result;\n }\n\n /** Extracts and unquantizes the point at the specified index from a buffer.\n * @param buffer The array of points and the quantization parameters.\n * @param The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [Point2d]($core-geometry) to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function unquantizePoint(buffer: QPoint2dBuffer, pointIndex: number, result?: Point2d): Point2d {\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint2d);\n return qpt.unquantize(buffer.params, result);\n }\n}\n\n/** A list of [[QPoint2d]]s all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint2dList {\n /** Parameters used to quantize the points. */\n public readonly params: QParams2d;\n private readonly _list = new Array<QPoint2d>();\n\n /** The list of quantized points. */\n public get list(): ReadonlyArray<QPoint2d> {\n return this._list;\n }\n\n /** Construct an empty list set up to use the supplied quantization parameters. */\n public constructor(params: QParams2d) {\n this.params = params.clone();\n }\n\n /** Removes all points from the list. */\n public clear() {\n this._list.length = 0;\n }\n\n /** Removes all points from the list and change the quantization parameters. */\n public reset(params: QParams2d) {\n this.clear();\n this.params.copyFrom(params);\n }\n\n /** Quantizes the supplied Point2d to this list's range and appends it to the list. */\n public add(pt: Point2d) {\n this._list.push(QPoint2d.create(pt, this.params));\n }\n\n /** Adds a previously-quantized point to this list. */\n public push(qpt: QPoint2d) {\n this._list.push(qpt.clone());\n }\n\n /** The number of points in the list. */\n public get length() {\n return this._list.length;\n }\n\n /** Returns the unquantized value of the point at the specified index in the list. */\n public unquantize(index: number, out?: Point2d): Point2d {\n assert(index < this.length);\n if (index < this.length) {\n return this._list[index].unquantize(this.params, out);\n } else {\n return undefined !== out ? out : new Point2d();\n }\n }\n\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\n * @note The loss of precision is compounded each time the points are requantized to a new range.\n */\n public requantize(params: QParams2d) {\n for (let i = 0; i < this.length; i++) {\n const pt = this.unquantize(i);\n this._list[i].init(pt, params);\n }\n\n this.params.copyFrom(params);\n }\n\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,\n * the second to the first point's `y` component, and so on.\n */\n public toTypedArray(): Uint16Array {\n const array = new Uint16Array(this.length * 2);\n const pts = this._list;\n for (let i = 0; i < this.length; i++) {\n const pt = pts[i];\n array[i * 2] = pt.x;\n array[i * 2 + 1] = pt.y;\n }\n\n return array;\n }\n\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. */\n public fromTypedArray(range: Range2d, array: Uint16Array) {\n this.params.setFromRange(range);\n this._list.length = array.length / 2;\n for (let i = 0, j = 0; i < this.list.length; i++)\n this._list[i] = QPoint2d.fromScalars(array[j++], array[j++]);\n }\n\n /** Construct a QPoint2dList containing all points in the supplied list, quantized to the range of those points. */\n public static fromPoints(points: Point2d[], out?: QPoint2dList) {\n let qPoints;\n const qParams = QParams2d.fromRange(Range2d.createArray(points));\n if (out) {\n qPoints = out;\n qPoints.reset(qParams);\n } else {\n qPoints = new QPoint2dList(qParams);\n }\n\n for (const point of points)\n qPoints.add(point);\n\n return qPoints;\n }\n}\n\n/** @alpha */\nexport interface QParams3dProps {\n origin: XYAndZ;\n scale: XYAndZ;\n}\n\n/** Parameters used for [[Quantization]] of 3d points such that the `x`, `y`, and `z` components are each quantized to 16-bit unsigned integers.\n * @see [[QPoint3d]] for the quantized representation of a [Point3d]($core-geometry).\n * @see [[QPoint3dList]] for a list of [[QPoint3d]]s quantized using a [[QParams3d]].\n * @public\n * @extensions\n */\nexport class QParams3d {\n /** The origin of the quantization range. */\n public readonly origin = new Point3d();\n /** The scale applied to coordinates to quantize them. */\n public readonly scale = new Point3d();\n\n private constructor(ox = 0, oy = 0, oz = 0, sx = 0, sy = 0, sz = 0) {\n this.setFrom(ox, oy, oz, sx, sy, sz);\n }\n\n private setFrom(ox: number, oy: number, oz: number, sx: number, sy: number, sz: number) {\n this.origin.x = ox;\n this.origin.y = oy;\n this.origin.z = oz;\n this.scale.x = sx;\n this.scale.y = sy;\n this.scale.z = sz;\n }\n\n /** Set `x`, `y`, and `z` from `src. */\n public copyFrom(src: QParams3d): void {\n this.setFrom(src.origin.x, src.origin.y, src.origin.z, src.scale.x, src.scale.y, src.scale.z);\n }\n\n /** Create a copy of these parameters.\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\n */\n public clone(out?: QParams3d): QParams3d {\n const result = undefined !== out ? out : new QParams3d();\n result.copyFrom(this);\n return result;\n }\n\n /** Initialize from origin and scale */\n public setFromOriginAndScale(origin: Point3d, scale: Point3d) {\n this.setFrom(origin.x, origin.y, origin.z, scale.x, scale.y, scale.z);\n }\n\n /** Initialize these parameters to support quantization of values within the specified range. */\n public setFromRange(range: Range3d, rangeScale = Quantization.rangeScale16) {\n if (!range.isNull) {\n this.setFrom(range.low.x, range.low.y, range.low.z,\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));\n } else {\n this.origin.x = this.origin.y = this.origin.z = 0;\n this.scale.x = this.scale.y = this.scale.z = 0;\n }\n }\n\n /** Return the unquantized point for the input components.\n * @param out If supplied, it will be modified in-place and returned instead of allocating a new Point3d.\n */\n public unquantize(x: number, y: number, z: number, out?: Point3d): Point3d {\n const pt: Point3d = undefined !== out ? out : new Point3d();\n pt.x = Quantization.unquantize(x, this.origin.x, this.scale.x);\n pt.y = Quantization.unquantize(y, this.origin.y, this.scale.y);\n pt.z = Quantization.unquantize(z, this.origin.z, this.scale.z);\n return pt;\n }\n\n /** Creates parameters to support quantization of values within the specified range.\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\n */\n public static fromRange(range: Range3d, out?: QParams3d, rangeScale = Quantization.rangeScale16): QParams3d {\n const params = undefined !== out ? out : new QParams3d();\n params.setFromRange(range, rangeScale);\n return params;\n }\n\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0].\n * If `out` is supplied, it will be modified in-place and returned instead of allocating a new QParams3d.\n */\n public static fromOriginAndScale(origin: Point3d, scale: Point3d, out?: QParams3d): QParams3d {\n const params = undefined !== out ? out : new QParams3d();\n params.setFromOriginAndScale(origin, scale);\n return params;\n }\n\n /** Creates parameters supporting quantization of values within the range [-1.0, 1.0]. */\n public static fromNormalizedRange(rangeScale = Quantization.rangeScale16) {\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(-1, -1, -1), Point3d.create(1, 1, 1)]), undefined, rangeScale);\n }\n\n /** Creates parameters supporting quantization of values within the range [0.0, 1.0]. */\n public static fromZeroToOne(rangeScale = Quantization.rangeScale16) {\n return QParams3d.fromRange(Range3d.createArray([Point3d.create(0, 0, 0), Point3d.create(1, 1, 1)]), undefined, rangeScale);\n }\n\n /** The diagonal of the unquantized range represented by these parameters. */\n public get rangeDiagonal(): Vector3d {\n return Vector3d.createFrom({\n x: this.scale.x === 0 ? 0 : Quantization.rangeScale16 / this.scale.x,\n y: this.scale.y === 0 ? 0 : Quantization.rangeScale16 / this.scale.y,\n z: this.scale.z === 0 ? 0 : Quantization.rangeScale16 / this.scale.z,\n });\n }\n\n /** Return true if the point point is quantizable using these parameters. */\n public isQuantizable(point: Point3d) {\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);\n }\n\n /** Compute the range to which these parameters quantize. */\n public computeRange(out?: Range3d): Range3d {\n const range = Range3d.createNull(out);\n range.extendPoint(this.origin);\n range.extendPoint(this.origin.plus(this.rangeDiagonal));\n return range;\n }\n\n /** @alpha */\n public toJSON(): QParams3dProps {\n return {\n origin: { x: this.origin.x, y: this.origin.y, z: this.origin.z },\n scale: { x: this.scale.x, y: this.scale.y, z: this.scale.z },\n };\n }\n\n /** @alpha */\n public static fromJSON(src: QParams3dProps, out?: QParams3d): QParams3d {\n return this.fromOriginAndScale(Point3d.fromJSON(src.origin), Point3d.fromJSON(src.scale), out);\n }\n}\n\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].\n * These are primarily used to reduce the space required for coordinates used by [RenderGraphic]($frontend)s.\n * @see [[QParams3d]] to define quantization parameters for a range of points.\n * @see [[QPoint3dList]] for a list of points all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint3d {\n private _x: number = 0;\n private _y: number = 0;\n private _z: number = 0;\n\n /** The quantized x component. */\n public get x() { return this._x; }\n public set x(x: number) {\n assert(Quantization.isQuantized(x));\n this._x = x;\n }\n\n /** The quantized y component. */\n public get y() { return this._y; }\n public set y(y: number) {\n assert(Quantization.isQuantized(y));\n this._y = y;\n }\n\n /** The quantized z component. */\n public get z() { return this._z; }\n public set z(z: number) {\n assert(Quantization.isQuantized(z));\n this._z = z;\n }\n\n /** Construct with all components initialized to zero. */\n public constructor() { }\n\n /** Initialize this point by quantizing the supplied { x, y, z } using the specified params */\n public init(pos: XYAndZ, params: QParams3d): void {\n this.x = Quantization.quantize(pos.x, params.origin.x, params.scale.x);\n this.y = Quantization.quantize(pos.y, params.origin.y, params.scale.y);\n this.z = Quantization.quantize(pos.z, params.origin.z, params.scale.z);\n }\n\n /** Creates a quantized point from the supplied Point3d using the specified params */\n public static create(pos: Point3d, params: QParams3d): QPoint3d {\n const qpt = new QPoint3d();\n qpt.init(pos, params);\n return qpt;\n }\n\n /** Set this points components from `src`. */\n public copyFrom(src: QPoint3d): void {\n this.x = src.x;\n this.y = src.y;\n this.z = src.z;\n }\n\n /** Create a copy of this point.\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\n */\n public clone(out?: QPoint3d): QPoint3d {\n const result = undefined !== out ? out : new QPoint3d();\n result.copyFrom(this);\n return result;\n }\n\n /**\n * Sets the x, y, and z components directly.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n * @param z Must be an integer in the range [0, 0xffff]\n */\n public setFromScalars(x: number, y: number, z: number) {\n this.x = x;\n this.y = y;\n this.z = z;\n }\n\n /**\n * Creates a QPoint3d directly from x, y, and z components.\n * @param x Must be an integer in the range [0, 0xffff]\n * @param y Must be an integer in the range [0, 0xffff]\n * @param z Must be an integer in the range [0, 0xffff]\n * @param out If supplied, it will be modified in-place instead of allocating a new QPoint3d.\n */\n public static fromScalars(x: number, y: number, z: number, out?: QPoint3d): QPoint3d {\n const pt = undefined === out ? new QPoint3d() : out;\n pt.setFromScalars(x, y, z);\n return pt;\n }\n\n /** Returns a Point3d unquantized according to the supplied params.\n * If `out` is supplied, it will be modified in-place instead of allocating a new Point3d.\n */\n public unquantize(params: QParams3d, out?: Point3d): Point3d {\n const pt: Point3d = undefined !== out ? out : new Point3d();\n pt.x = Quantization.unquantize(this.x, params.origin.x, params.scale.x);\n pt.y = Quantization.unquantize(this.y, params.origin.y, params.scale.y);\n pt.z = Quantization.unquantize(this.z, params.origin.z, params.scale.z);\n return pt;\n }\n\n /** Return true if this point's components are identical to the other point's components. */\n public equals(other: QPoint3d): boolean {\n return this.x === other.x && this.y === other.y && this.z === other.z;\n }\n\n /** Perform ordinal comparison to another point. The function returns:\n * - Zero if this point is identical to `rhs`; or\n * - A number less than zero if this point is ordered before `rhs`; or\n * - A number greater than zero if this point is ordered after `rhs`.\n * @see [OrderedComparator]($core-bentley).\n */\n public compare(rhs: QPoint3d): number {\n let diff = this.x - rhs.x;\n if (0 === diff) {\n diff = this.y - rhs.y;\n if (0 === diff) {\n diff = this.z - rhs.z;\n }\n }\n\n return diff;\n }\n}\n\n/** A compact representation of a list of [[QPoint3d]]s stored in a `Uint16Array`.\n * This representation is particularly useful when passing data to WebGL; for example, see [RealityMeshParams.positions]($frontend).\n * @public\n * @extensions\n */\nexport interface QPoint3dBuffer {\n /** The parameters used to quantize the [[points]]. */\n params: QParams3d;\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.\n * To obtain the `n`th point, use `QPoint3d.fromScalars(buffer.points[n * 3], buffer.points[n * 3 + 1], buffer.points[n * 3 + 2])`.\n */\n points: Uint16Array;\n}\n\n/** @public\n * @extensions\n */\nexport namespace QPoint3dBuffer {\n const scratchQPoint3d = new QPoint3d();\n\n /** Extracts the point at the specified index from a buffer.\n * @param points The buffer in which each consecutive pair of integers is a 3d quantized point.\n * @param pointIndex The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [[QPoint3d]] to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function getQPoint(points: Uint16Array, pointIndex: number, result?: QPoint3d): QPoint3d {\n const index = pointIndex * 3;\n const x = points[index + 0];\n const y = points[index + 1];\n const z = points[index + 2];\n if (undefined === x || undefined === y || undefined === z)\n throw new Error(\"Index out of range\");\n\n result = result ?? new QPoint3d();\n result.setFromScalars(x, y, z);\n return result;\n }\n\n /** Extracts and unquantizes the point at the specified index from a buffer.\n * @param buffer The array of points and the quantization parameters.\n * @param buffer The index of the point to extract, ranging from zero to one less than the number of points in the buffer.\n * @param result If supplied, a preallocated [Point3d]($core-geometry) to initialize with the result and return.\n * @returns The point at `pointIndex`.\n * @throws Error if `pointIndex` is out of bounds.\n */\n export function unquantizePoint(buffer: QPoint3dBuffer, pointIndex: number, result?: Point3d): Point3d {\n const qpt = getQPoint(buffer.points, pointIndex, scratchQPoint3d);\n return qpt.unquantize(buffer.params, result);\n }\n}\n\n/** A list of [[QPoint3d]]s all quantized to the same range.\n * @public\n * @extensions\n */\nexport class QPoint3dList {\n /** Parameters used to quantize the points. */\n public readonly params: QParams3d;\n private readonly _list: QPoint3d[] = [];\n\n /** The list of quantized points. */\n public get list(): ReadonlyArray<QPoint3d> {\n return this._list;\n }\n\n /** Construct an empty list set up to quantize to the supplied range.\n * @param params The quantization parameters. If omitted, a null range will be used.\n */\n public constructor(params?: QParams3d) {\n this.params = params ? params.clone() : QParams3d.fromRange(Range3d.createNull());\n }\n\n /** Construct a QPoint3dList containing all points in the supplied list, quantized to the range of those points.\n * @param points The points to quantize and add to the list.\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.\n */\n public static fromPoints(points: Point3d[], out?: QPoint3dList): QPoint3dList {\n let qPoints;\n const qParams = QParams3d.fromRange(Range3d.createArray(points));\n if (out) {\n qPoints = out;\n qPoints.reset(qParams);\n } else {\n qPoints = new QPoint3dList(qParams);\n }\n\n for (const point of points)\n qPoints.add(point);\n\n return qPoints;\n }\n\n /** Removes all points from the list. */\n public clear() {\n this._list.length = 0;\n }\n\n /** Clears out the contents of the list and changes the quantization parameters. */\n public reset(params: QParams3d) {\n this.clear();\n this.params.copyFrom(params);\n }\n\n /** Quantizes the supplied Point3d to this list's range and appends it to the list. */\n public add(pt: Point3d) {\n this._list.push(QPoint3d.create(pt, this.params));\n }\n\n /** Adds a previously-quantized point to this list. */\n public push(qpt: QPoint3d) {\n this._list.push(qpt.clone());\n }\n\n /** The number of points in the list. */\n public get length() {\n return this._list.length;\n }\n\n /** Returns the unquantized value of the point at the specified index in the list. */\n public unquantize(index: number, out?: Point3d): Point3d {\n assert(index < this.length);\n if (index < this.length) {\n return this._list[index].unquantize(this.params, out);\n } else {\n return undefined !== out ? out : new Point3d();\n }\n }\n\n /** Changes the quantization parameters and requantizes all points in the list to the new range.\n * @note The loss of precision is compounded each time the points are requantized to a new range.\n */\n public requantize(params: QParams3d): void {\n for (let i = 0; i < this.length; i++) {\n const pt = this.unquantize(i);\n this._list[i].init(pt, params);\n }\n\n this.params.copyFrom(params);\n }\n\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,\n * the second three elements contain the second point's components, and so on.\n */\n public toTypedArray(): Uint16Array {\n const array = new Uint16Array(this.length * 3);\n const pts = this._list;\n for (let i = 0; i < this.length; i++) {\n const pt = pts[i];\n array[i * 3 + 0] = pt.x;\n array[i * 3 + 1] = pt.y;\n array[i * 3 + 2] = pt.z;\n }\n\n return array;\n }\n\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\n * of the second point, and so on.\n */\n public fromTypedArray(range: Range3d, array: Uint16Array): void {\n this.params.setFromRange(range);\n this._list.length = array.length / 3;\n for (let i = 0, j = 0; i < this.list.length; i++)\n this._list[i] = QPoint3d.fromScalars(array[j++], array[j++], array[j++]);\n }\n\n /** Construct a list containing all points in the supplied list, quantized using the supplied parameters. */\n public static createFrom(points: Point3d[], params: QParams3d): QPoint3dList {\n const list = new QPoint3dList(params);\n for (const point of points)\n list.add(point);\n\n return list;\n }\n\n /** An iterator over the points in the list. */\n public [Symbol.iterator]() {\n return this.list[Symbol.iterator]();\n }\n}\n\n/** Options used to construct a [[QPoint2dBufferBuilder]].\n * @public\n * @extensions\n */\ninterface QPoint2dBufferBuilderOptions {\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. */\n range: Range2d;\n /** The number of points for which to allocate space.\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\n */\n initialCapacity?: number;\n /** Multiplier used to compute new capacity when resizing the buffer.\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\n */\n growthFactor?: number;\n}\n\n/** Constructs a [[QPoint2dBuffer]] using a [Uint16ArrayBuilder]($bentley).\n * @public\n * @extensions\n */\nexport class QPoint2dBufferBuilder {\n private readonly _scratchQPoint2d = new QPoint2d();\n\n /** The parameters used to quantize the points in the [[buffer]]. */\n public readonly params: QParams2d;\n /** The buffer that holds the points. */\n public readonly buffer: Uint16ArrayBuilder;\n\n /** Construct a new buffer with a [[length]] of zero. */\n public constructor(options: QPoint2dBufferBuilderOptions) {\n this.params = QParams2d.fromRange(options.range);\n const initialCapacity = options.initialCapacity ?? 0;\n this.buffer = new Uint16ArrayBuilder({\n growthFactor: options.growthFactor,\n initialCapacity: 2 * initialCapacity,\n });\n }\n\n /** Append a point with the specified quantized coordinates. */\n public pushXY(x: number, y: number): void {\n this.buffer.push(x);\n this.buffer.push(y);\n }\n\n /** Append a point with the specified quantized coordinates. */\n public push(pt: XAndY): void {\n this.pushXY(pt.x, pt.y);\n }\n\n /** The number of points currently in the [[buffer]]. */\n public get length(): number {\n const len = this.buffer.length;\n assert(len % 2 === 0);\n return len / 2;\n }\n\n /** Returns the quantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [[QPoint2d]] to initialize with the result and return.\n * @returns The quantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public get(pointIndex: number, result?: QPoint2d): QPoint2d {\n return QPoint2dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\n }\n\n /** Returns the unquantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [Point2d]($core-geometry) to initialize with the result and return.\n * @returns The unquantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public unquantize(pointIndex: number, result?: Point2d): Point2d {\n return this.get(pointIndex, this._scratchQPoint2d).unquantize(this.params, result);\n }\n\n /** Obtain a [[QPoint2dBuffer]] containing all of the points that have been appended by this builder. */\n public finish(): QPoint2dBuffer {\n return {\n params: this.params,\n points: this.buffer.toTypedArray(),\n };\n }\n}\n\n/** Options used to construct a [[QPoint3dBufferBuilder]].\n * @public\n * @extensions\n */\ninterface QPoint3dBufferBuilderOptions {\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. */\n range: Range3d;\n /** The number of points for which to allocate space.\n * @see [TypedArrayBuilderOptions.initialCapacity]($bentley).\n */\n initialCapacity?: number;\n /** Multiplier used to compute new capacity when resizing the buffer.\n * @see [TypedArrayBuilderOptions.growthFactor]($bentley).\n */\n growthFactor?: number;\n}\n\n/** Constructs a [[QPoint3dBuffer]] using a [Uint16ArrayBuilder]($bentley).\n * @public\n * @extensions\n */\nexport class QPoint3dBufferBuilder {\n private readonly _scratchQPoint3d = new QPoint3d();\n\n /** The parameters used to quantize the points in the [[buffer]]. */\n public readonly params: QParams3d;\n /** The buffer that holds the points. */\n public readonly buffer: Uint16ArrayBuilder;\n\n /** Construct a new buffer with a [[length]] of zero. */\n public constructor(options: QPoint3dBufferBuilderOptions) {\n this.params = QParams3d.fromRange(options.range);\n const initialCapacity = options.initialCapacity ?? 0;\n this.buffer = new Uint16ArrayBuilder({\n growthFactor: options.growthFactor,\n initialCapacity: 3 * initialCapacity,\n });\n }\n\n /** Append a point with the specified quantized coordinates. */\n public pushXYZ(x: number, y: number, z: number): void {\n this.buffer.push(x);\n this.buffer.push(y);\n this.buffer.push(z);\n }\n\n /** Append a point with the specified quantized coordinates. */\n public push(pt: XYAndZ): void {\n this.pushXYZ(pt.x, pt.y, pt.z);\n }\n\n /** The number of points currently in the [[buffer]]. */\n public get length(): number {\n const len = this.buffer.length;\n assert(len % 3 === 0);\n return len / 3;\n }\n\n /** Returns the quantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [[QPoint3d]] to initialize with the result and return.\n * @returns The quantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public get(pointIndex: number, result?: QPoint3d): QPoint3d {\n return QPoint3dBuffer.getQPoint(this.buffer.toTypedArray(), pointIndex, result);\n }\n\n /** Returns the unquantized point at the specified index in [[buffer]].\n * @param pointIndex The index of the point of interest, ranging from zero to one minus the number of points currently in the [[buffer]].\n * @param result If supplied, a [Point3d]($core-geometry) to initialize with the result and return.\n * @returns The unquantized point at the specified index in [[buffer]].\n * @throws Error if `pointIndex` is out of bounds.\n */\n public unquantize(pointIndex: number, result?: Point3d): Point3d {\n return this.get(pointIndex, this._scratchQPoint3d).unquantize(this.params, result);\n }\n\n /** Obtain a [[QPoint3dBuffer]] containing all of the points that have been appended by this builder. */\n public finish(): QPoint3dBuffer {\n return {\n params: this.params,\n points: this.buffer.toTypedArray(),\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Rendering
|
|
3
|
+
*/
|
|
4
|
+
/** Describes the semantics of a [PolylineArgs]($frontend).
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare enum PolylineTypeFlags {
|
|
8
|
+
/** Just an ordinary polyline with no special semantics. */
|
|
9
|
+
Normal = 0,
|
|
10
|
+
/** A polyline used to define the edges of a planar region. */
|
|
11
|
+
Edge = 1,
|
|
12
|
+
/** Like [[Edge]], but the edges are only displayed in [[RenderMode.Wireframe]] when the surface's fill is not displayed.
|
|
13
|
+
* [[FillFlags]] controls whether the fill is displayed.
|
|
14
|
+
*/
|
|
15
|
+
Outline = 2
|
|
16
|
+
}
|
|
17
|
+
/** Flags describing a [PolylineArgs]($frontend).
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export interface PolylineFlags {
|
|
21
|
+
/** If `true`, the polylines are to be drawn as individual disconnected point strings instead of as connected line strings. */
|
|
22
|
+
isDisjoint?: boolean;
|
|
23
|
+
/** If `true`, the polylines' positions are all coplanar. */
|
|
24
|
+
isPlanar?: boolean;
|
|
25
|
+
/** If `true`, the polylines' positions all have the same z coordinate. */
|
|
26
|
+
is2d?: boolean;
|
|
27
|
+
/** Default: Normal. */
|
|
28
|
+
type?: PolylineTypeFlags;
|
|
29
|
+
}
|
|
30
|
+
/** Describes the vertex indices of a single line within a [PolylineArgs]($frontend).
|
|
31
|
+
* The indices represent either a line string as a connected series of points, or a point string as a set of disconnected points, depending
|
|
32
|
+
* on the [[PolylineFlags.isDisjoint]] value of [PolylineArgs.flags]($frontend).
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export type PolylineIndices = number[];
|
|
36
|
+
//# sourceMappingURL=RenderPolyline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderPolyline.d.ts","sourceRoot":"","sources":["../../src/RenderPolyline.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,2DAA2D;IAC3D,MAAM,IAAI;IACV,8DAA8D;IAC9D,IAAI,IAAS;IACb;;OAEG;IACH,OAAO,IAAS;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8HAA8H;IAC9H,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Rendering
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PolylineTypeFlags = void 0;
|
|
11
|
+
// cSpell:ignore vals
|
|
12
|
+
/** Describes the semantics of a [PolylineArgs]($frontend).
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
var PolylineTypeFlags;
|
|
16
|
+
(function (PolylineTypeFlags) {
|
|
17
|
+
/** Just an ordinary polyline with no special semantics. */
|
|
18
|
+
PolylineTypeFlags[PolylineTypeFlags["Normal"] = 0] = "Normal";
|
|
19
|
+
/** A polyline used to define the edges of a planar region. */
|
|
20
|
+
PolylineTypeFlags[PolylineTypeFlags["Edge"] = 1] = "Edge";
|
|
21
|
+
/** Like [[Edge]], but the edges are only displayed in [[RenderMode.Wireframe]] when the surface's fill is not displayed.
|
|
22
|
+
* [[FillFlags]] controls whether the fill is displayed.
|
|
23
|
+
*/
|
|
24
|
+
PolylineTypeFlags[PolylineTypeFlags["Outline"] = 2] = "Outline";
|
|
25
|
+
})(PolylineTypeFlags || (exports.PolylineTypeFlags = PolylineTypeFlags = {}));
|
|
26
|
+
//# sourceMappingURL=RenderPolyline.js.map
|