@itwin/core-frontend 5.0.0-dev.22 → 5.0.0-dev.24
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/lib/cjs/GraphicalEditingScope.js +1 -1
- package/lib/cjs/GraphicalEditingScope.js.map +1 -1
- package/lib/cjs/SelectionSet.d.ts +84 -35
- package/lib/cjs/SelectionSet.d.ts.map +1 -1
- package/lib/cjs/SelectionSet.js +430 -166
- package/lib/cjs/SelectionSet.js.map +1 -1
- package/lib/cjs/common/imdl/ImdlSchema.d.ts +4 -0
- package/lib/cjs/common/imdl/ImdlSchema.d.ts.map +1 -1
- package/lib/cjs/common/imdl/ImdlSchema.js.map +1 -1
- package/lib/cjs/common/imdl/ParseImdlDocument.d.ts +1 -1
- package/lib/cjs/common/imdl/ParseImdlDocument.d.ts.map +1 -1
- package/lib/cjs/common/imdl/ParseImdlDocument.js +80 -7
- package/lib/cjs/common/imdl/ParseImdlDocument.js.map +1 -1
- package/lib/cjs/tile/ImdlParser.js +2 -2
- package/lib/cjs/tile/ImdlParser.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.js +1 -1
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/MeshoptCompression.d.ts +9 -0
- package/lib/cjs/tile/MeshoptCompression.d.ts.map +1 -1
- package/lib/cjs/tile/MeshoptCompression.js +98 -66
- package/lib/cjs/tile/MeshoptCompression.js.map +1 -1
- package/lib/cjs/tools/ClipViewTool.js +8 -8
- package/lib/cjs/tools/ClipViewTool.js.map +1 -1
- package/lib/cjs/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/cjs/tools/ElementSetTool.js +11 -4
- package/lib/cjs/tools/ElementSetTool.js.map +1 -1
- package/lib/cjs/tools/MeasureTool.js +3 -3
- package/lib/cjs/tools/MeasureTool.js.map +1 -1
- package/lib/cjs/tools/SelectTool.js +2 -2
- package/lib/cjs/tools/SelectTool.js.map +1 -1
- package/lib/cjs/workers/ImdlParser/Worker.js +2 -2
- package/lib/cjs/workers/ImdlParser/Worker.js.map +1 -1
- package/lib/esm/GraphicalEditingScope.js +1 -1
- package/lib/esm/GraphicalEditingScope.js.map +1 -1
- package/lib/esm/SelectionSet.d.ts +84 -35
- package/lib/esm/SelectionSet.d.ts.map +1 -1
- package/lib/esm/SelectionSet.js +429 -165
- package/lib/esm/SelectionSet.js.map +1 -1
- package/lib/esm/common/imdl/ImdlSchema.d.ts +4 -0
- package/lib/esm/common/imdl/ImdlSchema.d.ts.map +1 -1
- package/lib/esm/common/imdl/ImdlSchema.js.map +1 -1
- package/lib/esm/common/imdl/ParseImdlDocument.d.ts +1 -1
- package/lib/esm/common/imdl/ParseImdlDocument.d.ts.map +1 -1
- package/lib/esm/common/imdl/ParseImdlDocument.js +80 -7
- package/lib/esm/common/imdl/ParseImdlDocument.js.map +1 -1
- package/lib/esm/tile/ImdlParser.js +2 -2
- package/lib/esm/tile/ImdlParser.js.map +1 -1
- package/lib/esm/tile/ImdlReader.js +1 -1
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/MeshoptCompression.d.ts +9 -0
- package/lib/esm/tile/MeshoptCompression.d.ts.map +1 -1
- package/lib/esm/tile/MeshoptCompression.js +98 -44
- package/lib/esm/tile/MeshoptCompression.js.map +1 -1
- package/lib/esm/tools/ClipViewTool.js +8 -8
- package/lib/esm/tools/ClipViewTool.js.map +1 -1
- package/lib/esm/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/esm/tools/ElementSetTool.js +11 -4
- package/lib/esm/tools/ElementSetTool.js.map +1 -1
- package/lib/esm/tools/MeasureTool.js +3 -3
- package/lib/esm/tools/MeasureTool.js.map +1 -1
- package/lib/esm/tools/SelectTool.js +2 -2
- package/lib/esm/tools/SelectTool.js.map +1 -1
- package/lib/esm/workers/ImdlParser/Worker.js +2 -2
- package/lib/esm/workers/ImdlParser/Worker.js.map +1 -1
- package/lib/public/locales/en/CoreTools.json +1 -0
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +17 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAuB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,2CAA2C;IAC3C,+DAAG,CAAA;IACH,+CAA+C;IAC/C,qEAAM,CAAA;IACN,6EAA6E;IAC7E,uEAAO,CAAA;IACP,yDAAyD;IACzD,mEAAK,CAAA;AACP,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAyDD;;GAEG;AACH,MAAM,UAAW,SAAQ,IAAI,CAAC,SAAS;IAIrC,YAAmB,MAAwB;QACzC,KAAK,EAAE,CAAC;QAHA,cAAS,GAAG,KAAK,CAAC;QAI1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEe,GAAG,CAAC,GAAW,EAAE,IAAY;QAC3C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,MAAM,CAAC,GAAW,EAAE,IAAY;QAC9C,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,KAAK;QACnB,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,MAAM,CAAC,GAAY;QACjC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,G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AC,CAAC;IAC5D,CAAC;IAED,0DAA0D;IACnD,OAAO,CAAC,IAAa;QAC1B,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;YAC/B,OAAO;QAET,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEvB,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,GAAgB,EAAE,GAAY;IAC9C,wDAAwD;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACpB,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1B,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAC/B,OAAO,KAAK,CAAC;IAEf,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACd,OAAO,KAAK,CAAC;IAEjB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module SelectionSet\r\n */\r\nimport { BeEvent, Id64, Id64Arg, Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SelectionSetEventType {\r\n /** Elements have been added to the set. */\r\n Add,\r\n /** Elements have been removed from the set. */\r\n Remove,\r\n /** Some elements have been added to the set and others have been removed. */\r\n Replace,\r\n /** All elements are about to be removed from the set. */\r\n Clear,\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are added to the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectAddEvent {\r\n type: SelectionSetEventType.Add;\r\n /** The Ids of the elements added to the set. */\r\n added: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectRemoveEvent {\r\n /** The type of operation that produced this event. */\r\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are simultaneously added to and removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectReplaceEvent {\r\n type: SelectionSetEventType.Replace;\r\n /** The element Ids added to the set. */\r\n added: Id64Arg;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\r\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\r\n * ```ts\r\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\r\n * console.log(\"Added \" + ev.added.size + \" elements\");\r\n *\r\n * if (SelectionSetEventType.Add !== ev.type)\r\n * console.log(\"Removed \" + ev.removed.size + \" elements\");\r\n * }\r\n * ```\r\n * @public\r\n * @extensions\r\n */\r\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\r\n\r\n/** Tracks a set of hilited entities. When the set changes, notifies ViewManager so that symbology overrides can be updated in active Viewports.\r\n * @internal\r\n */\r\nclass HilitedIds extends Id64.Uint32Set {\r\n protected _iModel: IModelConnection;\r\n protected _changing = false;\r\n\r\n public constructor(iModel: IModelConnection) {\r\n super();\r\n this._iModel = iModel;\r\n }\r\n\r\n public override add(low: number, high: number) {\r\n super.add(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override delete(low: number, high: number) {\r\n super.delete(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override clear() {\r\n super.clear();\r\n this.onChanged();\r\n }\r\n\r\n public override addIds(ids: Id64Arg) {\r\n this.change(() => super.addIds(ids));\r\n }\r\n\r\n public override deleteIds(ids: Id64Arg) {\r\n this.change(() => super.deleteIds(ids));\r\n }\r\n\r\n protected onChanged() {\r\n if (!this._changing)\r\n IModelApp.viewManager.onSelectionSetChanged(this._iModel);\r\n }\r\n\r\n protected change(func: () => void) {\r\n const changing = this._changing;\r\n this._changing = false;\r\n func();\r\n this._changing = changing;\r\n this.onChanged();\r\n }\r\n}\r\n\r\n/** Keeps the set of hilited elements in sync with the selection set.\r\n * @internal\r\n */\r\nclass HilitedElementIds extends HilitedIds {\r\n private _removeListener?: () => void;\r\n\r\n public constructor(iModel: IModelConnection, syncWithSelectionSet = true) {\r\n super(iModel);\r\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\r\n }\r\n\r\n public get wantSyncWithSelectionSet(): boolean { return undefined !== this._removeListener; }\r\n public set wantSyncWithSelectionSet(want: boolean) {\r\n if (want === this.wantSyncWithSelectionSet)\r\n return;\r\n\r\n if (want) {\r\n const set = this._iModel.selectionSet;\r\n this._removeListener = set.onChanged.addListener((ev) => this.change(() => this.processSelectionSetEvent(ev)));\r\n this.processSelectionSetEvent({\r\n set,\r\n type: SelectionSetEventType.Add,\r\n added: set.elements,\r\n });\r\n } else {\r\n this._removeListener!();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n private processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n if (SelectionSetEventType.Add !== ev.type)\r\n this.deleteIds(ev.removed);\r\n\r\n if (ev.type === SelectionSetEventType.Add || ev.type === SelectionSetEventType.Replace)\r\n this.addIds(ev.added);\r\n }\r\n}\r\n\r\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\r\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\r\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\r\n *\r\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\r\n * @public\r\n */\r\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\r\n\r\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\r\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\r\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\r\n *\r\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\r\n * features belonging to different subcategories.\r\n *\r\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\r\n *\r\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\r\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\r\n * are also responsible for removing them as appropriate.\r\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class HiliteSet {\r\n private readonly _elements: HilitedElementIds;\r\n private _mode: ModelSubCategoryHiliteMode = \"union\";\r\n\r\n /** The set of hilited subcategories.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\r\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\r\n */\r\n public readonly subcategories: Id64.Uint32Set;\r\n\r\n /** The set of hilited [[GeometricModelState]]s.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\r\n */\r\n public readonly models: Id64.Uint32Set;\r\n\r\n /** The set of hilited elements. */\r\n public get elements(): Id64.Uint32Set { return this._elements; }\r\n\r\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\r\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\r\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\r\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\r\n * [[elements]] is always hilited regardless of its model or subcategories.\r\n */\r\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\r\n return this._mode;\r\n }\r\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\r\n if (mode === this._mode)\r\n return;\r\n\r\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\r\n this._mode = mode;\r\n }\r\n\r\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\r\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\r\n\r\n /** Construct a HiliteSet\r\n * @param iModel The iModel containing the entities to be hilited.\r\n * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].\r\n */\r\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\r\n this._elements = new HilitedElementIds(iModel, syncWithSelectionSet);\r\n this.subcategories = new HilitedIds(iModel);\r\n this.models = new HilitedIds(iModel);\r\n }\r\n\r\n /** Control whether the hilited elements will be synchronized with the contents of the [[SelectionSet]].\r\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\r\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\r\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\r\n */\r\n public get wantSyncWithSelectionSet(): boolean { return this._elements.wantSyncWithSelectionSet; }\r\n public set wantSyncWithSelectionSet(want: boolean) { this._elements.wantSyncWithSelectionSet = want; }\r\n\r\n /** Remove all elements from the hilited set. */\r\n public clear() {\r\n this.elements.clear();\r\n this.subcategories.clear();\r\n this.models.clear();\r\n }\r\n\r\n /** Returns true if nothing is hilited. */\r\n public get isEmpty(): boolean { return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty; }\r\n\r\n /** Toggle the hilited state of one or more elements.\r\n * @param arg the ID(s) of the elements whose state is to be toggled.\r\n * @param onOff True to add the elements to the hilited set, false to remove them.\r\n */\r\n public setHilite(arg: Id64Arg, onOff: boolean): void {\r\n const oldSize = this.elements.size;\r\n\r\n for (const id of Id64.iterable(arg)) {\r\n if (onOff)\r\n this.elements.addId(id);\r\n else\r\n this.elements.deleteId(id);\r\n }\r\n\r\n if (oldSize !== this.elements.size)\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n }\r\n}\r\n\r\n/** A set of *currently selected* elements for an IModelConnection.\r\n * Selected elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class SelectionSet {\r\n private _elements = new Set<string>();\r\n\r\n /** The IDs of the selected elements.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get elements(): Set<string> { return this._elements; }\r\n\r\n /** Called whenever elements are added or removed from this SelectionSet */\r\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\r\n\r\n public constructor(public iModel: IModelConnection) { }\r\n\r\n private sendChangedEvent(ev: SelectionSetEvent) {\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n this.onChanged.raiseEvent(ev);\r\n }\r\n\r\n /** Get the number of entries in this selection set. */\r\n public get size() { return this.elements.size; }\r\n\r\n /** Check whether there are any selected elements. */\r\n public get isActive() { return this.size !== 0; }\r\n\r\n /** Return true if elemId is in this SelectionSet.\r\n * @see [[isSelected]]\r\n */\r\n public has(elemId?: string) { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Query whether an Id is in the selection set.\r\n * @see [[has]]\r\n */\r\n public isSelected(elemId?: Id64String): boolean { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Clear current selection set.\r\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\r\n */\r\n public emptyAll(): void {\r\n if (!this.isActive)\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this.sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removed });\r\n }\r\n\r\n /**\r\n * Add one or more Ids to the current selection set.\r\n * @param elem The set of Ids to add.\r\n * @returns true if any elements were added.\r\n */\r\n public add(elem: Id64Arg): boolean {\r\n return this._add(elem);\r\n }\r\n\r\n private _add(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.add(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Remove one or more Ids from the current selection set.\r\n * @param elem The set of Ids to remove.\r\n * @returns true if any elements were removed.\r\n */\r\n public remove(elem: Id64Arg): boolean {\r\n return this._remove(elem);\r\n }\r\n\r\n private _remove(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.delete(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\r\n * @returns True if any Ids were either added or removed.\r\n */\r\n public addAndRemove(adds: Id64Arg, removes: Id64Arg): boolean {\r\n const added = this._add(adds, false);\r\n const removed = this._remove(removes, false);\r\n\r\n if (added && removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: adds, removed: removes });\r\n else if (added)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: adds });\r\n else if (removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: removes });\r\n\r\n return (added || removed);\r\n }\r\n\r\n /** Invert the state of a set of Ids in the SelectionSet */\r\n public invert(elem: Id64Arg): boolean {\r\n const elementsToAdd = new Set<string>();\r\n const elementsToRemove = new Set<string>();\r\n for (const id of Id64.iterable(elem)) {\r\n if (this.elements.has(id))\r\n elementsToRemove.add(id);\r\n else\r\n elementsToAdd.add(id);\r\n }\r\n\r\n return this.addAndRemove(elementsToAdd, elementsToRemove);\r\n }\r\n\r\n /** Change selection set to be the supplied set of Ids. */\r\n public replace(elem: Id64Arg): void {\r\n if (areEqual(this.elements, elem))\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this._add(elem, false);\r\n\r\n if (0 < removed.size) {\r\n for (const id of Id64.iterable(elem)) {\r\n if (removed.has(id))\r\n removed.delete(id);\r\n }\r\n }\r\n\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: elem, removed });\r\n }\r\n}\r\n\r\nfunction areEqual(lhs: Set<string>, rhs: Id64Arg): boolean {\r\n // Size is unreliable if input can contain duplicates...\r\n if (Array.isArray(rhs))\r\n rhs = Id64.toIdSet(rhs);\r\n\r\n if (lhs.size !== Id64.sizeOf(rhs))\r\n return false;\r\n\r\n for (const id of Id64.iterable(rhs))\r\n if (!lhs.has(id))\r\n return false;\r\n\r\n return true;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;;;AAEhG;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAA2C,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,sCAAsC;IACtC,+DAAG,CAAA;IACH,0CAA0C;IAC1C,qEAAM,CAAA;IACN,wEAAwE;IACxE,uEAAO,CAAA;IACP,8CAA8C;IAC9C,mEAAK,CAAA;AACP,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AA6ED;;;GAGG;AACH,MAAM,UAAW,SAAQ,IAAI,CAAC,SAAS;IACrC,YAA2B,OAAmC;QAC5D,KAAK,EAAE,CAAC;QADiB,YAAO,GAAP,OAAO,CAA4B;IAE9D,CAAC;IAEe,GAAG,CAAC,GAAW,EAAE,IAAY;QAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3C,CAAC;IAEe,MAAM,CAAC,GAAW,EAAE,IAAY;QAC9C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,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E,CAAC,EAAE,CAAC,CAAC;QACnB,CAAC;QACD,IAAI,GAAG,OAAO,CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module SelectionSet\r\n */\r\nimport { BeEvent, Id64, Id64Arg, Id64Array, Id64Set, Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SelectionSetEventType {\r\n /** Ids have been added to the set. */\r\n Add,\r\n /** Ids have been removed from the set. */\r\n Remove,\r\n /** Some ids have been added to the set and others have been removed. */\r\n Replace,\r\n /** All ids have been removed from the set. */\r\n Clear,\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are added to the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectAddEvent {\r\n type: SelectionSetEventType.Add;\r\n /**\r\n * The Ids of the elements added to the set.\r\n * @deprecated in 5.0. Use the [[additions]] attribute instead.\r\n */\r\n added: Id64Arg;\r\n /** A collection of geometric element, model and subcategory ids that have been added to selection set. */\r\n additions: SelectableIds;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectRemoveEvent {\r\n /** The type of operation that produced this event. */\r\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\r\n /**\r\n * The element Ids removed from the set.\r\n * @deprecated in 5.0. Use the [[removals]] attribute instead.\r\n */\r\n removed: Id64Arg;\r\n /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */\r\n removals: SelectableIds;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are simultaneously added to and removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectReplaceEvent {\r\n type: SelectionSetEventType.Replace;\r\n /**\r\n * The element Ids added to the set.\r\n * @deprecated in 5.0. Use the [[additions]] attribute instead.\r\n */\r\n added: Id64Arg;\r\n /** A collection of geometric element, model and subcategory ids that have been added to selection set. */\r\n additions: SelectableIds;\r\n /**\r\n * The element Ids removed from the set.\r\n * @deprecated in 5.0. Use the [[removals]] attribute instead.\r\n */\r\n removed: Id64Arg;\r\n /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */\r\n removals: SelectableIds;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\r\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\r\n * ```ts\r\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\r\n * console.log(\"Added \" + (ev.additions.elements?.size ?? 0) + \" elements\");\r\n *\r\n * if (SelectionSetEventType.Add !== ev.type)\r\n * console.log(\"Removed \" + (ev.removals.elements?.size ?? 0) + \" elements\");\r\n * }\r\n * ```\r\n * @public\r\n * @extensions\r\n */\r\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\r\n\r\n/** Holds a set of hilited entities and makes any changes to the set by passing the change\r\n * function to given `change` callback.\r\n * @internal\r\n */\r\nclass HilitedIds extends Id64.Uint32Set {\r\n public constructor(private _change: (func: () => void) => void) {\r\n super();\r\n }\r\n\r\n public override add(low: number, high: number) {\r\n this._change(() => super.add(low, high));\r\n }\r\n\r\n public override delete(low: number, high: number) {\r\n this._change(() => super.delete(low, high));\r\n }\r\n\r\n public override clear() {\r\n this._change(() => super.clear());\r\n }\r\n\r\n public override addIds(ids: Id64Arg) {\r\n this._change(() => super.addIds(ids));\r\n }\r\n\r\n public override deleteIds(ids: Id64Arg) {\r\n this._change(() => super.deleteIds(ids));\r\n }\r\n}\r\n\r\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\r\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\r\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\r\n *\r\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\r\n * @public\r\n */\r\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\r\n\r\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\r\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\r\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\r\n *\r\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\r\n * features belonging to different subcategories.\r\n *\r\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\r\n *\r\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\r\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\r\n * are also responsible for removing them as appropriate.\r\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class HiliteSet {\r\n #mode: ModelSubCategoryHiliteMode = \"union\";\r\n #selectionChangesListener?: () => void;\r\n #changing = false;\r\n\r\n /** The set of hilited elements. */\r\n public readonly elements: Id64.Uint32Set;\r\n\r\n /** The set of hilited subcategories.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\r\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\r\n */\r\n public readonly subcategories: Id64.Uint32Set;\r\n\r\n /** The set of hilited [[GeometricModelState]]s.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\r\n */\r\n public readonly models: Id64.Uint32Set;\r\n\r\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\r\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\r\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\r\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\r\n * [[elements]] is always hilited regardless of its model or subcategories.\r\n */\r\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\r\n return this.#mode;\r\n }\r\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\r\n if (mode === this.#mode) {\r\n return;\r\n }\r\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\r\n this.#mode = mode;\r\n }\r\n\r\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\r\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\r\n\r\n /** Construct a HiliteSet\r\n * @param iModel The iModel containing the entities to be hilited.\r\n * @param syncWithSelectionSet If true, the hilite set contents will be synchronized with those in the `iModel`'s [[SelectionSet]].\r\n */\r\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\r\n this.elements = new HilitedIds((func) => this.#change(func));\r\n this.subcategories = new HilitedIds((func) => this.#change(func));\r\n this.models = new HilitedIds((func) => this.#change(func));\r\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\r\n }\r\n\r\n /** Control whether the hilite set will be synchronized with the contents of the [[SelectionSet]].\r\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\r\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\r\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\r\n */\r\n public get wantSyncWithSelectionSet(): boolean {\r\n return !!this.#selectionChangesListener;\r\n }\r\n public set wantSyncWithSelectionSet(want: boolean) {\r\n if (want === this.wantSyncWithSelectionSet) {\r\n return;\r\n }\r\n if (want) {\r\n const set = this.iModel.selectionSet;\r\n this.#selectionChangesListener = set.onChanged.addListener((ev) => this.#processSelectionSetEvent(ev));\r\n this.add(set.active);\r\n } else {\r\n this.#selectionChangesListener!();\r\n this.#selectionChangesListener = undefined;\r\n }\r\n }\r\n\r\n #onChanged() {\r\n if (!this.#changing) {\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n }\r\n }\r\n\r\n #change(func: () => void) {\r\n const changing = this.#changing;\r\n this.#changing = true;\r\n try {\r\n func();\r\n } finally {\r\n this.#changing = changing;\r\n }\r\n this.#onChanged();\r\n }\r\n\r\n #processSelectionSetEvent(ev: SelectionSetEvent) {\r\n switch (ev.type) {\r\n case SelectionSetEventType.Add:\r\n return this.add(ev.additions);\r\n case SelectionSetEventType.Replace:\r\n return this.#change(() => {\r\n this.add(ev.additions);\r\n this.remove(ev.removals);\r\n });\r\n case SelectionSetEventType.Remove:\r\n case SelectionSetEventType.Clear:\r\n return this.remove(ev.removals);\r\n }\r\n }\r\n\r\n /** Adds a collection of geometric element, model and subcategory ids to this hilite set. */\r\n public add(additions: SelectableIds): void {\r\n this.#change(() => {\r\n additions.elements && this.elements.addIds(additions.elements);\r\n additions.models && this.models.addIds(additions.models);\r\n additions.subcategories && this.subcategories.addIds(additions.subcategories);\r\n });\r\n }\r\n\r\n /** Removes a collection of geometric element, model and subcategory ids from this hilite set. */\r\n public remove(removals: SelectableIds): void {\r\n this.#change(() => {\r\n removals.elements && this.elements.deleteIds(removals.elements);\r\n removals.models && this.models.deleteIds(removals.models);\r\n removals.subcategories && this.subcategories.deleteIds(removals.subcategories);\r\n });\r\n }\r\n\r\n /** Replaces ids currently in the hilite set with the given collection. */\r\n public replace(ids: SelectableIds): void {\r\n this.#change(() => {\r\n this.clear();\r\n this.add(ids);\r\n });\r\n }\r\n\r\n /** Remove all elements from the hilited set. */\r\n public clear() {\r\n this.#change(() => {\r\n this.elements.clear();\r\n this.models.clear();\r\n this.subcategories.clear();\r\n });\r\n }\r\n\r\n /** Returns true if nothing is hilited. */\r\n public get isEmpty(): boolean {\r\n return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty;\r\n }\r\n\r\n /** Toggle the hilited state of one or more elements.\r\n * @param arg the ID(s) of the elements whose state is to be toggled.\r\n * @param onOff True to add the elements to the hilited set, false to remove them.\r\n * @deprecated in 5.0. Use [[add]], [[remove]], [[replace]] instead.\r\n */\r\n public setHilite(arg: Id64Arg, onOff: boolean): void {\r\n if (onOff) {\r\n this.add({ elements: arg });\r\n } else {\r\n this.remove({ elements: arg });\r\n }\r\n }\r\n}\r\n\r\n/** A set of *currently selected* geometric elements, models and subcategories for an `IModelConnection`.\r\n * Generally, selected elements are displayed with a customizable hilite effect within a [[Viewport]], see [[HiliteSet]].\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class SelectionSet {\r\n #selection: {\r\n [P in keyof SelectableIds]-?: Id64Set;\r\n };\r\n\r\n /** The IDs of the selected elements.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get elements(): Set<Id64String> {\r\n return this.#selection.elements;\r\n }\r\n\r\n /** The IDs of the selected models.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get models(): Set<Id64String> {\r\n return this.#selection.models;\r\n }\r\n\r\n /** The IDs of the selected subcategories.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get subcategories(): Set<Id64String> {\r\n return this.#selection.subcategories;\r\n }\r\n\r\n /** Get the active selection as a collection of geometric element, model and subcategory ids.\r\n * @note Do not modify the sets in returned collection directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get active(): { [P in keyof SelectableIds]-?: Set<Id64String> } {\r\n return { ...this.#selection };\r\n }\r\n\r\n /** Called whenever ids are added or removed from this `SelectionSet` */\r\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\r\n\r\n public constructor(public iModel: IModelConnection) {\r\n this.#selection = {\r\n elements: new Set(),\r\n models: new Set(),\r\n subcategories: new Set(),\r\n };\r\n }\r\n\r\n #sendChangedEvent(ev: SelectionSetEvent) {\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n this.onChanged.raiseEvent(ev);\r\n }\r\n\r\n /** Get the number of entries in this selection set. */\r\n public get size() {\r\n return this.elements.size + this.models.size + this.subcategories.size;\r\n }\r\n\r\n /** Check whether there are any ids in this selection set. */\r\n public get isActive() {\r\n return this.elements.size > 0 || this.models.size > 0 || this.subcategories.size > 0;\r\n }\r\n\r\n /** Return true if elemId is in this `SelectionSet`.\r\n * @see [[isSelected]]\r\n * @deprecated in 5.0. Use `SelectionSet.elements.has(elemId)` instead.\r\n */\r\n public has(elemId?: string) {\r\n return !!elemId && this.elements.has(elemId);\r\n }\r\n\r\n /** Query whether an Id is in the selection set.\r\n * @see [[has]]\r\n * @deprecated in 5.0. Use `SelectionSet.elements.has(elemId)` instead.\r\n */\r\n public isSelected(elemId?: Id64String): boolean {\r\n return !!elemId && this.elements.has(elemId);\r\n }\r\n\r\n /** Clear current selection set.\r\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\r\n */\r\n public emptyAll(): void {\r\n if (!this.isActive) {\r\n return;\r\n }\r\n const removals = this.#selection;\r\n this.#selection = {\r\n elements: new Set(),\r\n models: new Set(),\r\n subcategories: new Set(),\r\n };\r\n this.#sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removals, removed: removals.elements });\r\n }\r\n\r\n /**\r\n * Add one or more Ids to the current selection set.\r\n * @param elem The set of Ids to add.\r\n * @returns true if any elements were added.\r\n */\r\n public add(adds: Id64Arg | SelectableIds): boolean {\r\n return !!this.#add(adds);\r\n }\r\n\r\n #add(adds: Id64Arg | SelectableIds, sendEvent = true): SelectableIds | undefined {\r\n const oldSize = this.size;\r\n const additions: { [P in keyof SelectableIds]: Id64Array } = {};\r\n forEachSelectableType({\r\n ids: adds,\r\n elements: (elementIds) =>\r\n addIds({\r\n target: this.#selection.elements,\r\n ids: elementIds,\r\n onAdd: (id) => (additions.elements ??= []).push(id),\r\n }),\r\n models: (modelIds) =>\r\n addIds({\r\n target: this.#selection.models,\r\n ids: modelIds,\r\n onAdd: (id) => (additions.models ??= []).push(id),\r\n }),\r\n subcategories: (subcategoryIds) =>\r\n addIds({\r\n target: this.#selection.subcategories,\r\n ids: subcategoryIds,\r\n onAdd: (id) => (additions.subcategories ??= []).push(id),\r\n }),\r\n });\r\n const changed = oldSize !== this.size;\r\n if (!changed) {\r\n return undefined;\r\n }\r\n if (sendEvent) {\r\n this.#sendChangedEvent({\r\n type: SelectionSetEventType.Add,\r\n set: this,\r\n additions,\r\n added: additions.elements ?? [],\r\n });\r\n }\r\n return additions;\r\n }\r\n\r\n /**\r\n * Remove one or more Ids from the current selection set.\r\n * @param elem The set of Ids to remove.\r\n * @returns true if any elements were removed.\r\n */\r\n public remove(removes: Id64Arg | SelectableIds): boolean {\r\n return !!this.#remove(removes);\r\n }\r\n\r\n #remove(removes: Id64Arg | SelectableIds, sendEvent = true): SelectableIds | undefined {\r\n const oldSize = this.size;\r\n const removals: { [P in keyof SelectableIds]: Id64Array } = {};\r\n forEachSelectableType({\r\n ids: removes,\r\n elements: (elementIds) =>\r\n removeIds({\r\n target: this.#selection.elements,\r\n ids: elementIds,\r\n onRemove: (id) => (removals.elements ??= []).push(id),\r\n }),\r\n models: (modelIds) =>\r\n removeIds({\r\n target: this.#selection.models,\r\n ids: modelIds,\r\n onRemove: (id) => (removals.models ??= []).push(id),\r\n }),\r\n subcategories: (subcategoryIds) =>\r\n removeIds({\r\n target: this.#selection.subcategories,\r\n ids: subcategoryIds,\r\n onRemove: (id) => (removals.subcategories ??= []).push(id),\r\n }),\r\n });\r\n const changed = oldSize !== this.size;\r\n if (!changed) {\r\n return undefined;\r\n }\r\n if (sendEvent) {\r\n this.#sendChangedEvent({\r\n type: SelectionSetEventType.Remove,\r\n set: this,\r\n removals,\r\n removed: removals.elements ?? [],\r\n });\r\n }\r\n return removals;\r\n }\r\n\r\n /**\r\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\r\n * @returns True if any Ids were either added or removed.\r\n */\r\n public addAndRemove(adds: Id64Arg | SelectableIds, removes: Id64Arg | SelectableIds): boolean {\r\n const additions = this.#add(adds, false);\r\n const removals = this.#remove(removes, false);\r\n const addedElements = additions?.elements ?? [];\r\n const removedElements = removals?.elements ?? [];\r\n if (additions && removals) {\r\n this.#sendChangedEvent({\r\n type: SelectionSetEventType.Replace,\r\n set: this,\r\n additions,\r\n added: addedElements,\r\n removals,\r\n removed: removedElements,\r\n });\r\n } else if (additions) {\r\n this.#sendChangedEvent({\r\n type: SelectionSetEventType.Add,\r\n set: this,\r\n additions,\r\n added: addedElements,\r\n });\r\n } else if (removals) {\r\n this.#sendChangedEvent({\r\n type: SelectionSetEventType.Remove,\r\n set: this,\r\n removals,\r\n removed: removedElements,\r\n });\r\n }\r\n return !!additions || !!removals;\r\n }\r\n\r\n /** Invert the state of a set of Ids in the `SelectionSet` */\r\n public invert(ids: Id64Arg | SelectableIds): boolean {\r\n const adds: { [P in keyof SelectableIds]: Id64Set } = {};\r\n const removes: { [P in keyof SelectableIds]: Id64Set } = {};\r\n forEachSelectableType({\r\n ids,\r\n elements: (elementIds) => {\r\n for (const id of Id64.iterable(elementIds)) {\r\n ((this.elements.has(id) ? removes : adds).elements ??= new Set()).add(id);\r\n }\r\n },\r\n models: (modelIds) => {\r\n for (const id of Id64.iterable(modelIds)) {\r\n ((this.models.has(id) ? removes : adds).models ??= new Set()).add(id);\r\n }\r\n },\r\n subcategories: (subcategoryIds) => {\r\n for (const id of Id64.iterable(subcategoryIds)) {\r\n ((this.subcategories.has(id) ? removes : adds).subcategories ??= new Set()).add(id);\r\n }\r\n },\r\n });\r\n return this.addAndRemove(adds, removes);\r\n }\r\n\r\n /** Change selection set to be the supplied set of Ids. */\r\n public replace(ids: Id64Arg | SelectableIds): boolean {\r\n if (areEqual(this.#selection, ids)) {\r\n return false;\r\n }\r\n\r\n const previousSelection = this.#selection;\r\n this.#selection = {\r\n elements: new Set(),\r\n models: new Set(),\r\n subcategories: new Set(),\r\n };\r\n this.#add(ids, false);\r\n\r\n const additions: { [P in keyof SelectableIds]: Id64Set } = {};\r\n const removals: { [P in keyof SelectableIds]: Id64Set } = {};\r\n forEachSelectableType({\r\n ids: this.#selection,\r\n elements: (elementIds) => {\r\n removeIds({\r\n target: previousSelection.elements,\r\n ids: elementIds,\r\n onNotFound: (id) => (additions.elements ??= new Set()).add(id),\r\n });\r\n if (previousSelection.elements.size > 0) {\r\n removals.elements = previousSelection.elements;\r\n }\r\n },\r\n models: (modelIds) => {\r\n removeIds({\r\n target: previousSelection.models,\r\n ids: modelIds,\r\n onNotFound: (id) => (additions.models ??= new Set()).add(id),\r\n });\r\n if (previousSelection.models.size > 0) {\r\n removals.models = previousSelection.models;\r\n }\r\n },\r\n subcategories: (subcategoryIds) => {\r\n removeIds({\r\n target: previousSelection.subcategories,\r\n ids: subcategoryIds,\r\n onNotFound: (id) => (additions.subcategories ??= new Set()).add(id),\r\n });\r\n if (previousSelection.subcategories.size > 0) {\r\n removals.subcategories = previousSelection.subcategories;\r\n }\r\n },\r\n });\r\n\r\n this.#sendChangedEvent({\r\n type: SelectionSetEventType.Replace,\r\n set: this,\r\n additions,\r\n added: additions.elements ?? [],\r\n removals,\r\n removed: removals.elements ?? [],\r\n });\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * A collection of geometric element, model and subcategory ids that can be added to\r\n * a [[SelectionSet]] or [[HiliteSet]].\r\n * @public\r\n */\r\nexport interface SelectableIds {\r\n elements?: Id64Arg;\r\n models?: Id64Arg;\r\n subcategories?: Id64Arg;\r\n}\r\n\r\nfunction forEachSelectableType({\r\n ids,\r\n elements,\r\n models,\r\n subcategories,\r\n}: {\r\n ids: Id64Arg | SelectableIds;\r\n elements: (ids: Id64Arg) => void;\r\n models: (ids: Id64Arg) => void;\r\n subcategories: (ids: Id64Arg) => void;\r\n}): SelectableIds {\r\n if (typeof ids === \"string\" || Array.isArray(ids) || ids instanceof Set) {\r\n elements(ids);\r\n return { elements: ids };\r\n }\r\n elements(ids.elements ?? []);\r\n models(ids.models ?? []);\r\n subcategories(ids.subcategories ?? []);\r\n return ids;\r\n}\r\n\r\nfunction areEqual(lhs: { [P in keyof SelectableIds]-?: Id64Set }, rhs: Id64Arg | SelectableIds): boolean {\r\n let result = true;\r\n forEachSelectableType({\r\n ids: rhs,\r\n elements: (elementIds) => {\r\n if (result && !areIdsEqual(lhs.elements, elementIds)) {\r\n result = false;\r\n }\r\n },\r\n models: (modelIds) => {\r\n if (result && !areIdsEqual(lhs.models, modelIds)) {\r\n result = false;\r\n }\r\n },\r\n subcategories: (subcategoryIds) => {\r\n if (result && !areIdsEqual(lhs.subcategories, subcategoryIds)) {\r\n result = false;\r\n }\r\n },\r\n });\r\n return result;\r\n}\r\n\r\nfunction areIdsEqual(lhs: Set<Id64String>, rhs: Id64Arg): boolean {\r\n // Size is unreliable if input can contain duplicates...\r\n if (Array.isArray(rhs)) {\r\n rhs = Id64.toIdSet(rhs);\r\n }\r\n if (lhs.size !== Id64.sizeOf(rhs)) {\r\n return false;\r\n }\r\n for (const id of Id64.iterable(rhs)) {\r\n if (!lhs.has(id)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nfunction addIds({ target, ids, onAdd }: { target: Id64Set; ids: Id64Arg; onAdd?: (id: Id64String) => void }) {\r\n let size = target.size;\r\n for (const id of Id64.iterable(ids)) {\r\n target.add(id);\r\n const newSize = target.size;\r\n if (newSize !== size) {\r\n onAdd?.(id);\r\n }\r\n size = newSize;\r\n }\r\n}\r\n\r\nfunction removeIds({\r\n target,\r\n ids,\r\n onRemove,\r\n onNotFound,\r\n}: {\r\n target: Id64Set;\r\n ids: Id64Arg;\r\n onRemove?: (id: Id64String) => void;\r\n onNotFound?: (id: Id64String) => void;\r\n}) {\r\n let size = target.size;\r\n for (const id of Id64.iterable(ids)) {\r\n target.delete(id);\r\n const newSize = target.size;\r\n if (newSize !== size) {\r\n onRemove?.(id);\r\n } else {\r\n onNotFound?.(id);\r\n }\r\n size = newSize;\r\n }\r\n}\r\n"]}
|
|
@@ -119,6 +119,8 @@ export interface ImdlVertexTable {
|
|
|
119
119
|
readonly width: number;
|
|
120
120
|
/** The height of the lookup texture. */
|
|
121
121
|
readonly height: number;
|
|
122
|
+
/** The size of the compressed data, only set if data is compressed. */
|
|
123
|
+
readonly compressedSize?: number;
|
|
122
124
|
/** True if [[uniformColor]] has transparency or the embedded color table contains transparent colors. */
|
|
123
125
|
readonly hasTranslucency: boolean;
|
|
124
126
|
/** Describes the number (0, 1, or more than 1) of features contained in the vertex table. */
|
|
@@ -301,6 +303,8 @@ export interface ImdlSurface {
|
|
|
301
303
|
readonly type: SurfaceType;
|
|
302
304
|
/** The 24-bit indices into the [[ImdlVertexTable]] of each triangle's vertex. */
|
|
303
305
|
readonly indices: string;
|
|
306
|
+
/** The number of indices, only set if data is compressed. */
|
|
307
|
+
readonly compressedIndexCount?: number;
|
|
304
308
|
/** If true, the [[ImdlTextureMapping]] is applied regardless of [ViewFlags.textures]($common). */
|
|
305
309
|
readonly alwaysDisplayTexture?: boolean;
|
|
306
310
|
/** The quantization range for the UV coordinates. @see [QParams2d]($common). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImdlSchema.d.ts","sourceRoot":"","sources":["../../../../src/common/imdl/ImdlSch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2E;IAC3E,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjC,WAAW,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC9C,cAAc,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,eAAe,CAAC,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACrD,aAAa,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;CAClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImdlSchema.js","sourceRoot":"","sources":["../../../../src/common/imdl/ImdlSchema.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAiOH;;GAEG;AACH,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,+DAAM,CAAA;IACN,sKAAsK;IACtK,uEAAU,CAAA;IACV,kCAAkC;IAClC,iEAAO,CAAA;AACT,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { ClipVectorProps, Range3dProps, TransformProps, XYProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport {\r\n ColorDefProps, FeatureIndexType, FillFlags, Gradient, ImageSourceFormat, LinePixels, TextureMapping, TextureTransparency,\r\n} from \"@itwin/core-common\";\r\nimport { AuxChannelTableProps } from \"../internal/render/AuxChannelTable\";\r\nimport { DisplayParams } from \"../internal/render/DisplayParams\";\r\nimport { MeshPrimitiveType } from \"../internal/render/MeshPrimitive\";\r\nimport { SurfaceType } from \"../internal/render/SurfaceParams\";\r\n\r\n/** Describes a [ColorDef]($common) as [r, g, b] with each component in [0..1].\r\n * @internal\r\n */\r\nexport type ImdlColorDef = number[];\r\n\r\n/** Describes a [TextureMapping]($common).\r\n * @internal\r\n */\r\nexport interface ImdlTextureMapping {\r\n /** Optional name, which may be the Id of a persistent [RenderTexture]($common) or some other name unique among all texture mappings within the tile. */\r\n name?: string;\r\n /** Describes the [TextureMapping.Params]($common). */\r\n params: {\r\n /** Describes a [TextureMapping.Trans2x3]($common) as a 2x3 matrix. */\r\n transform: number[][];\r\n /** @see [TextureMapping.Params.weight]($common). Default: 1.0. */\r\n weight?: number;\r\n /** Default: [TextureMapping.Mode.Parametric]($common). */\r\n mode?: TextureMapping.Mode;\r\n /** @see [TextureMapping.Params.worldMapping]($common). Default: false. */\r\n worldMapping?: boolean;\r\n /** @see [TextureMapping.Params.useConstantLod]($common). Default: false. */\r\n useConstantLod?: boolean;\r\n /** Describes the [TextureMapping.ConstantLodParamProps]($common). */\r\n constantLodParams?: {\r\n repetitions?: number;\r\n offset?: number[];\r\n minDistClamp?: number;\r\n maxDistClamp?: number;\r\n };\r\n };\r\n /** @see [NormalMapParams]($common). */\r\n normalMapParams?: {\r\n textureName?: string;\r\n greenUp?: boolean;\r\n scale?: number;\r\n useConstantLod?: boolean;\r\n };\r\n}\r\n\r\n/** Describes a [RenderTexture]($common) with its image embedded into the tile data.\r\n * @internal\r\n */\r\nexport interface ImdlNamedTexture {\r\n /** If true, the image is a texture atlas containing any number of glyphs used for text. */\r\n isGlyph?: boolean;\r\n /** If true, the texture should not repeat and should not be mip-mapped. */\r\n isTileSection?: boolean;\r\n /** The Id of the [[ImdlBufferView]] containing the image data. */\r\n bufferView: string;\r\n /** The format of the image data referenced by [[bufferView]]. */\r\n format: ImageSourceFormat;\r\n /** The kind of transparency present in the texture image. Default: Mixed. */\r\n transparency?: TextureTransparency;\r\n}\r\n\r\n/** Describes a [[DisplayParams]].\r\n * @internal\r\n */\r\nexport interface ImdlDisplayParams {\r\n type: DisplayParams.Type;\r\n lineColor?: ColorDefProps;\r\n fillColor?: ColorDefProps;\r\n lineWidth?: number;\r\n linePixels?: LinePixels;\r\n fillFlags?: FillFlags;\r\n ignoreLighting?: boolean;\r\n materialId?: string;\r\n texture?: ImdlTextureMapping;\r\n gradient?: Gradient.SymbProps;\r\n}\r\n\r\n/** Describes a [RenderMaterial]($common).\r\n * @internal\r\n */\r\nexport interface ImdlRenderMaterial {\r\n diffuseColor?: ImdlColorDef;\r\n diffuse?: number;\r\n specularColor?: ImdlColorDef;\r\n specular?: number;\r\n reflectColor?: ImdlColorDef;\r\n reflect?: number;\r\n specularExponent?: number;\r\n /** In [0..1] where 0 is fully opaque. */\r\n transparency?: number;\r\n refract?: number;\r\n shadows?: boolean;\r\n ambient?: number;\r\n textureMapping?: {\r\n texture: ImdlTextureMapping;\r\n };\r\n}\r\n\r\n/** Describes a [[SurfaceMaterialAtlas]] embedded into an [[ImdlVertexTable]].\r\n * @internal\r\n */\r\nexport interface ImdlMaterialAtlas {\r\n readonly numMaterials: number;\r\n readonly hasTranslucency?: boolean;\r\n readonly overridesAlpha?: boolean;\r\n}\r\n\r\n/** Describes a [[VertexTable]].\r\n * @internal\r\n */\r\nexport interface ImdlVertexTable {\r\n /** Id of the [[ImdlBufferView]] containing the binary vertex table data. */\r\n readonly bufferView: string;\r\n /** The number of vertices in the table. */\r\n readonly count: number;\r\n /** The number of RGBA values in the lookup texture allocated per vertex. */\r\n readonly numRgbaPerVertex: number;\r\n /** The number of colors in the color table embedded into the vertex table, or undefined if [[uniformColor]] is defined. */\r\n readonly numColors?: number;\r\n /** The width of the lookup texture. */\r\n readonly width: number;\r\n /** The height of the lookup texture. */\r\n readonly height: number;\r\n /** True if [[uniformColor]] has transparency or the embedded color table contains transparent colors. */\r\n readonly hasTranslucency: boolean;\r\n /** Describes the number (0, 1, or more than 1) of features contained in the vertex table. */\r\n readonly featureIndexType: FeatureIndexType;\r\n /** If [[featureIndexType]] is [FeatureIndexType.Uniform]($common), the ID of the feature associated with all vertices in the table. */\r\n readonly featureID?: number;\r\n /** If defined, the color associated with all vertices in the table. */\r\n readonly uniformColor?: ColorDefProps;\r\n /** The quantization range of the vertex positions. @see [QParams3d]($common). */\r\n readonly params: {\r\n readonly decodedMin: number[];\r\n readonly decodedMax: number[];\r\n };\r\n /** If the vertex table contains multiple surface materials, describes the embedded material atlas. */\r\n readonly materialAtlas?: ImdlMaterialAtlas;\r\n readonly usesUnquantizedPositions?: boolean;\r\n}\r\n\r\n/** Describes how to draw a single [[ImdlPrimitive]] repeatedly.\r\n * @see [[InstancedGraphicParams]].\r\n * @internal\r\n */\r\nexport interface ImdlInstances {\r\n readonly count: number;\r\n readonly transformCenter: number[];\r\n readonly featureIds: string;\r\n readonly transforms: string;\r\n readonly symbologyOverrides?: string;\r\n}\r\n\r\n/** Describes a unit of geometry within an [[ImdlMesh]].\r\n * @internal\r\n */\r\nexport interface ImdlPrimitive {\r\n /** The Id of the associated [[ImdlDisplayParams]]. */\r\n readonly material?: string;\r\n /** A lookup table containing the primitive's vertices. */\r\n readonly vertices: ImdlVertexTable;\r\n /** If true, all the vertices lie in a single plane. */\r\n readonly isPlanar?: boolean;\r\n /** If defined, a point about which the primitive should rotate when displayed to always face the camera. */\r\n readonly viewIndependentOrigin?: XYZProps;\r\n /** If defined, describes repeated instances of the same primitive. */\r\n readonly instances?: ImdlInstances;\r\n}\r\n\r\n/** Per-vertex data used to animate and/or resymbolize a mesh.\r\n * @see [[AuxChannelTable]].\r\n * @internal\r\n */\r\nexport type ImdlAuxChannelTable = Omit<AuxChannelTableProps, \"data\"> & { bufferView: string };\r\n\r\n/** Describes the \"hard\" edges of an [[ImdlMeshPrimitive]]. These edges represent simple line segments connecting two vertices of the mesh.\r\n * They are always visible regardless of view orientation.\r\n * Each segment is represented as a quad such that it can be expanded to a desired width in pixels.\r\n * @internal\r\n */\r\nexport interface ImdlSegmentEdges {\r\n /** Id of the [[ImdlBufferView]] containing - for each vertex of each quad - the 24-bit index of the vertex in the mesh's [[ImdlVertexTable]]. */\r\n readonly indices: string;\r\n /** Id of the [[ImdlBufferView]] containing - for each vertex of each quad - the 24-bit index of the segmnent's other endpoint in the mesh's [[ImdlVertexTable]],\r\n * along with a \"quad index\" in [0..3] identifying which corner of the quad the vertex represents.\r\n */\r\n readonly endPointAndQuadIndices: string;\r\n}\r\n\r\n/** Describes \"hidden\" edges of an [[ImdlMeshPrimitive]]. These edges represent simple line segments connecting two vertices of the mesh.\r\n * A given silhouette is visible when only one of the faces associated with the edge is facing the camera, producing view-dependent outlines for curved\r\n * geometry like spheres and cones.\r\n * @internal\r\n */\r\nexport interface ImdlSilhouetteEdges extends ImdlSegmentEdges {\r\n /** The Id of the [[ImdlBufferView]] containing - for each vertex - a pair of [OctEncodedNormal]($common)s for the two faces associated with the edge. */\r\n readonly normalPairs: string;\r\n}\r\n\r\n/** A compact alternative representation of [[ImdlSegmentEdges]] and [[ImdlSilhouetteEdges]] consisting of a lookup table containing information about each unique\r\n * edge, along with indices into that table.\r\n * @see [[IndexedEdgeParams]].\r\n * @internal\r\n */\r\nexport interface ImdlIndexedEdges {\r\n /** Id of the [[ImdlBufferView]] containing the indices - 6 per segment, forming a quad. */\r\n readonly indices: string;\r\n /** Id of the [[ImdlBufferView]] containing the lookup table binary data. */\r\n readonly edges: string;\r\n /** Width of the lookup texture. */\r\n readonly width: number;\r\n /** Height of the lookup texture. */\r\n readonly height: number;\r\n /** The number of simple segments in the lower partition of the lookup table. @see [[IndexedEdgeParams.numSegments]]. */\r\n readonly numSegments: number;\r\n /** The number of bytes inserted for alignment between the lower and upper partitions of the lookup table. @see [[IndexedEdgeParams.silhouettePadding]]. */\r\n readonly silhouettePadding: number;\r\n}\r\n\r\n/** As part of [[ImdlCompactEdges]], describes the visibility of an edge of a triangle.\r\n * @internal\r\n */\r\nexport enum ImdlEdgeVisibility {\r\n /** The edge is never visible. */\r\n Hidden,\r\n /** The edge is shared between two adjacent triangles. It is visible only if one triangle is facing away from the viewer and the other is facing toward the viewer. */\r\n Silhouette,\r\n /** The edge is always visible. */\r\n Visible,\r\n}\r\n\r\n/** A more compact representation of [[ImdlIndexedEdges]]. For each vertex index in the mesh, it encodes 2 bits indicating the visibility of the edge between\r\n * that vertex and the next vertex in the triangle. A second buffer holds oct-encoded normal pairs such that the pair at index N corresponds to the Nth edge\r\n * with [[ImdlEdgeVisibility.Silhouette]] in the visibility buffer.\r\n * This information is used to construct the edge table that would otherwise be described more verbosely by [[ImdlIndexedEdges]].\r\n * @see [[CompactEdgeParams]].\r\n * @internal\r\n */\r\nexport interface ImdlCompactEdges {\r\n /** Id of the [[ImdlBufferView]] containing the [[ImdlEdgeVisibility]] of each edge of each triangle in the mesh.\r\n * The order of the edges in the buffer is the same as the order of the corresponding [[ImdlSurface.indices]].\r\n * 2 bits are allocated per edge.\r\n */\r\n readonly visibility: string;\r\n /** Id of the [[ImdlBufferView]] containing the [OctEncodedNormalPair]($common)s of each silhouette edge in [[visibility]].\r\n * Each pair is represented as a 32-bit unsigned integer - `normal1 | (normal2 << 16)`.\r\n * If no silhouettes are present, this property will be `undefined`.\r\n */\r\n readonly normalPairs?: string;\r\n /** The number of edges with [[ImdlVisibility.Visible]].\r\n * @note The number of edges with [[ImdlVisibility.Silhouette]] is implicit in the number of [[normalPairs]].\r\n */\r\n readonly numVisible: number;\r\n}\r\n\r\n/** Describes the edges of an [[ImdlMeshPrimitive]].\r\n * @internal\r\n */\r\nexport interface ImdlMeshEdges {\r\n readonly segments?: ImdlSegmentEdges;\r\n readonly silhouettes?: ImdlSilhouetteEdges;\r\n /** Line strings with additional joint triangles inserted to produce wide edges with rounded corners.\r\n * Typically only produced for 2d views.\r\n */\r\n readonly indexed?: ImdlIndexedEdges;\r\n readonly compact?: ImdlCompactEdges;\r\n readonly polylines?: ImdlPolyline;\r\n}\r\n\r\n/** Describes a collection of line strings with additional joint triangles inserted to produce wide line strings with rounded corners.\r\n * @see [[TesselatedPolyline]] and [[PolylineParams]].\r\n * @internal\r\n */\r\nexport interface ImdlPolyline {\r\n /** Id of the [[ImdlBufferView]] containing the [[TesselatedPolyline.indices]]. */\r\n readonly indices: string;\r\n /** Id of the [[ImdlBufferView]] containing the [[TesselatedPolyline.prevIndices]]. */\r\n readonly prevIndices: string;\r\n /** Id of the [[ImdlBufferView]] containing the [[TesselatedPolyline.nextIndicesAndParams]]. */\r\n readonly nextIndicesAndParams: string;\r\n}\r\n\r\n/** Describes a planar region in which a pattern symbol is repeated in a regular grid.\r\n * @see [[PatternGraphicParams]].\r\n * @internal\r\n */\r\nexport interface ImdlAreaPattern {\r\n readonly type: \"areaPattern\";\r\n /** The Id of the [[ImdlAreaPatternSymbol]] containing the pattern geometry. */\r\n readonly symbolName: string;\r\n /** A [ClipVector]($core-geometry) used to clip symbols to the pattern region's boundary. */\r\n readonly clip: ClipVectorProps;\r\n /** Uniform scale applied to the pattern geometry. */\r\n readonly scale: number;\r\n /** Spacing between each instance of the pattern in meters. */\r\n readonly spacing: XYProps;\r\n readonly orgTransform: TransformProps;\r\n readonly origin: XYProps;\r\n /** Id of the [[ImdlBufferView]] containing the offset of each occurrence of the symbol in pattern-space. */\r\n readonly xyOffsets: string;\r\n readonly featureId: number;\r\n readonly modelTransform: TransformProps;\r\n readonly range: Range3dProps;\r\n readonly symbolTranslation: XYZProps;\r\n readonly viewIndependentOrigin?: XYZProps;\r\n}\r\n\r\n/** Describes the surface of an [[ImdlMeshPrimitive]] as a collection of triangles.\r\n * @internal\r\n */\r\nexport interface ImdlSurface {\r\n /** The type of surface. */\r\n readonly type: SurfaceType;\r\n /** The 24-bit indices into the [[ImdlVertexTable]] of each triangle's vertex. */\r\n readonly indices: string;\r\n /** If true, the [[ImdlTextureMapping]] is applied regardless of [ViewFlags.textures]($common). */\r\n readonly alwaysDisplayTexture?: boolean;\r\n /** The quantization range for the UV coordinates. @see [QParams2d]($common). */\r\n readonly uvParams?: {\r\n readonly decodedMin: number[];\r\n readonly decodedMax: number[];\r\n };\r\n}\r\n\r\n/** Describes a triangle mesh, optionally including its edges. @see [[MeshParams]].\r\n * @internal\r\n */\r\nexport interface ImdlMeshPrimitive extends ImdlPrimitive {\r\n /** Type discriminator for [[AnyImdlPrimitive]]. */\r\n readonly type: MeshPrimitiveType.Mesh;\r\n readonly surface: ImdlSurface;\r\n readonly edges?: ImdlMeshEdges;\r\n readonly auxChannels?: ImdlAuxChannelTable;\r\n readonly areaPattern?: ImdlAreaPattern;\r\n}\r\n\r\n/** Describes a collection of line strings. @see [[PolylineParams]].\r\n * @internal\r\n */\r\nexport interface ImdlPolylinePrimitive extends ImdlPrimitive, ImdlPolyline {\r\n /** Type discriminator for [[AnyImdlPrimitive]]. */\r\n readonly type: MeshPrimitiveType.Polyline;\r\n}\r\n\r\n/** Describes a collection of individual points. @see [[PointStringParams.\r\n * @internal\r\n */\r\nexport interface ImdlPointStringPrimitive extends ImdlPrimitive {\r\n /** Type discriminator for [[AnyImdlPrimitive]]. */\r\n readonly type: MeshPrimitiveType.Point;\r\n /** The Id of the [[ImdlBufferView]] containing - for each point - the 24-bit index of the corresponding vertex in the [[ImdlVertexTable]]. */\r\n readonly indices: string;\r\n}\r\n\r\n/** @internal */\r\nexport type AnyImdlPrimitive = ImdlMeshPrimitive | ImdlPolylinePrimitive | ImdlPointStringPrimitive;\r\n\r\n/** A collection of primitive geometry to be rendered.\r\n * @internal\r\n */\r\nexport interface ImdlMesh {\r\n /** The geometry to be rendered. */\r\n readonly primitives?: Array<AnyImdlPrimitive | ImdlAreaPattern>;\r\n /** If this mesh defines a layer, the unique Id of that layer.\r\n * @see [[RenderSystem.createGraphicLayer]] for a description of layers.\r\n */\r\n readonly layer?: string;\r\n}\r\n\r\n/** A collection of primitive geometry to be rendered as the pattern symbol for an [[ImdlAreaPattern]].\r\n * @internal\r\n */\r\nexport interface ImdlAreaPatternSymbol {\r\n readonly primitives: AnyImdlPrimitive[];\r\n}\r\n\r\n/** If the tile has an associated [RenderSchedule.Script]($common), an array of Ids of nodes in the script used to group elements.\r\n * @internal\r\n */\r\nexport interface ImdlAnimationNodes {\r\n /** The number of bytes in each integer Id provided by [[bufferView]] - either 1, 2, or 4. */\r\n bytesPerId: number;\r\n /** The Id of the [[ImdlBufferView]] containing the tightly-packed array of 1-, 2- or 4-byte unsigned integer node Ids; the number of bytes is specified by [[bytesPerId]]. */\r\n bufferView: string;\r\n}\r\n\r\n/** Describes a contiguous array of bytes within the binary portion of the tile.\r\n * @internal\r\n */\r\nexport interface ImdlBufferView {\r\n /** The number of bytes in the array. */\r\n byteLength: number;\r\n /** The offset from the beginning of the binary portion of the tile data to the first byte in the array. */\r\n byteOffset: number;\r\n}\r\n\r\n/** A top-level dictionary of resources of a particular type contained in an [[Imdl]] tile.\r\n * Each resource has a unique name by which it can be referred to by other contents of the tile.\r\n * @internal\r\n */\r\nexport interface ImdlDictionary<T> {\r\n [key: string]: T | undefined;\r\n}\r\n\r\n/** Describes all of the geometry contained in the tile.\r\n * @internal\r\n */\r\nexport interface ImdlScene {\r\n /** The Ids of the elements of [[Imdl.nodes]] to be included in the scene. */\r\n nodes: string[];\r\n}\r\n\r\n/** Describes the top-level contents of a tile.\r\n * @internal\r\n */\r\nexport interface ImdlDocument {\r\n /** The Id of the ImdlScene in [[scenes]] that describes the tile's geometry. */\r\n scene: string;\r\n /** The collection of ImdlScenes included in the tile. */\r\n scenes: ImdlDictionary<ImdlScene>;\r\n /** Specifies point to which all vertex positions in the tile are relative, as an array of 3 numbers.\r\n * Currently only used for requestElementGraphics - see GraphicsRequestProps.useAbsolutePositions.\r\n */\r\n rtcCenter?: number[];\r\n /** Maps each node Id to the Id of the corresponding mesh in [[meshes]]. */\r\n nodes: ImdlDictionary<string>;\r\n meshes: ImdlDictionary<ImdlMesh>;\r\n bufferViews: ImdlDictionary<ImdlBufferView>;\r\n materials?: ImdlDictionary<ImdlDisplayParams>;\r\n patternSymbols?: ImdlDictionary<ImdlAreaPatternSymbol>;\r\n animationNodes?: ImdlAnimationNodes;\r\n renderMaterials?: ImdlDictionary<ImdlRenderMaterial>;\r\n namedTextures?: ImdlDictionary<ImdlNamedTexture>;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ImdlSchema.js","sourceRoot":"","sources":["../../../../src/common/imdl/ImdlSchema.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAmOH;;GAEG;AACH,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,+DAAM,CAAA;IACN,sKAAsK;IACtK,uEAAU,CAAA;IACV,kCAAkC;IAClC,iEAAO,CAAA;AACT,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { ClipVectorProps, Range3dProps, TransformProps, XYProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport {\r\n ColorDefProps, FeatureIndexType, FillFlags, Gradient, ImageSourceFormat, LinePixels, TextureMapping, TextureTransparency,\r\n} from \"@itwin/core-common\";\r\nimport { AuxChannelTableProps } from \"../internal/render/AuxChannelTable\";\r\nimport { DisplayParams } from \"../internal/render/DisplayParams\";\r\nimport { MeshPrimitiveType } from \"../internal/render/MeshPrimitive\";\r\nimport { SurfaceType } from \"../internal/render/SurfaceParams\";\r\n\r\n/** Describes a [ColorDef]($common) as [r, g, b] with each component in [0..1].\r\n * @internal\r\n */\r\nexport type ImdlColorDef = number[];\r\n\r\n/** Describes a [TextureMapping]($common).\r\n * @internal\r\n */\r\nexport interface ImdlTextureMapping {\r\n /** Optional name, which may be the Id of a persistent [RenderTexture]($common) or some other name unique among all texture mappings within the tile. */\r\n name?: string;\r\n /** Describes the [TextureMapping.Params]($common). */\r\n params: {\r\n /** Describes a [TextureMapping.Trans2x3]($common) as a 2x3 matrix. */\r\n transform: number[][];\r\n /** @see [TextureMapping.Params.weight]($common). Default: 1.0. */\r\n weight?: number;\r\n /** Default: [TextureMapping.Mode.Parametric]($common). */\r\n mode?: TextureMapping.Mode;\r\n /** @see [TextureMapping.Params.worldMapping]($common). Default: false. */\r\n worldMapping?: boolean;\r\n /** @see [TextureMapping.Params.useConstantLod]($common). Default: false. */\r\n useConstantLod?: boolean;\r\n /** Describes the [TextureMapping.ConstantLodParamProps]($common). */\r\n constantLodParams?: {\r\n repetitions?: number;\r\n offset?: number[];\r\n minDistClamp?: number;\r\n maxDistClamp?: number;\r\n };\r\n };\r\n /** @see [NormalMapParams]($common). */\r\n normalMapParams?: {\r\n textureName?: string;\r\n greenUp?: boolean;\r\n scale?: number;\r\n useConstantLod?: boolean;\r\n };\r\n}\r\n\r\n/** Describes a [RenderTexture]($common) with its image embedded into the tile data.\r\n * @internal\r\n */\r\nexport interface ImdlNamedTexture {\r\n /** If true, the image is a texture atlas containing any number of glyphs used for text. */\r\n isGlyph?: boolean;\r\n /** If true, the texture should not repeat and should not be mip-mapped. */\r\n isTileSection?: boolean;\r\n /** The Id of the [[ImdlBufferView]] containing the image data. */\r\n bufferView: string;\r\n /** The format of the image data referenced by [[bufferView]]. */\r\n format: ImageSourceFormat;\r\n /** The kind of transparency present in the texture image. Default: Mixed. */\r\n transparency?: TextureTransparency;\r\n}\r\n\r\n/** Describes a [[DisplayParams]].\r\n * @internal\r\n */\r\nexport interface ImdlDisplayParams {\r\n type: DisplayParams.Type;\r\n lineColor?: ColorDefProps;\r\n fillColor?: ColorDefProps;\r\n lineWidth?: number;\r\n linePixels?: LinePixels;\r\n fillFlags?: FillFlags;\r\n ignoreLighting?: boolean;\r\n materialId?: string;\r\n texture?: ImdlTextureMapping;\r\n gradient?: Gradient.SymbProps;\r\n}\r\n\r\n/** Describes a [RenderMaterial]($common).\r\n * @internal\r\n */\r\nexport interface ImdlRenderMaterial {\r\n diffuseColor?: ImdlColorDef;\r\n diffuse?: number;\r\n specularColor?: ImdlColorDef;\r\n specular?: number;\r\n reflectColor?: ImdlColorDef;\r\n reflect?: number;\r\n specularExponent?: number;\r\n /** In [0..1] where 0 is fully opaque. */\r\n transparency?: number;\r\n refract?: number;\r\n shadows?: boolean;\r\n ambient?: number;\r\n textureMapping?: {\r\n texture: ImdlTextureMapping;\r\n };\r\n}\r\n\r\n/** Describes a [[SurfaceMaterialAtlas]] embedded into an [[ImdlVertexTable]].\r\n * @internal\r\n */\r\nexport interface ImdlMaterialAtlas {\r\n readonly numMaterials: number;\r\n readonly hasTranslucency?: boolean;\r\n readonly overridesAlpha?: boolean;\r\n}\r\n\r\n/** Describes a [[VertexTable]].\r\n * @internal\r\n */\r\nexport interface ImdlVertexTable {\r\n /** Id of the [[ImdlBufferView]] containing the binary vertex table data. */\r\n readonly bufferView: string;\r\n /** The number of vertices in the table. */\r\n readonly count: number;\r\n /** The number of RGBA values in the lookup texture allocated per vertex. */\r\n readonly numRgbaPerVertex: number;\r\n /** The number of colors in the color table embedded into the vertex table, or undefined if [[uniformColor]] is defined. */\r\n readonly numColors?: number;\r\n /** The width of the lookup texture. */\r\n readonly width: number;\r\n /** The height of the lookup texture. */\r\n readonly height: number;\r\n /** The size of the compressed data, only set if data is compressed. */\r\n readonly compressedSize?: number;\r\n /** True if [[uniformColor]] has transparency or the embedded color table contains transparent colors. */\r\n readonly hasTranslucency: boolean;\r\n /** Describes the number (0, 1, or more than 1) of features contained in the vertex table. */\r\n readonly featureIndexType: FeatureIndexType;\r\n /** If [[featureIndexType]] is [FeatureIndexType.Uniform]($common), the ID of the feature associated with all vertices in the table. */\r\n readonly featureID?: number;\r\n /** If defined, the color associated with all vertices in the table. */\r\n readonly uniformColor?: ColorDefProps;\r\n /** The quantization range of the vertex positions. @see [QParams3d]($common). */\r\n readonly params: {\r\n readonly decodedMin: number[];\r\n readonly decodedMax: number[];\r\n };\r\n /** If the vertex table contains multiple surface materials, describes the embedded material atlas. */\r\n readonly materialAtlas?: ImdlMaterialAtlas;\r\n readonly usesUnquantizedPositions?: boolean;\r\n}\r\n\r\n/** Describes how to draw a single [[ImdlPrimitive]] repeatedly.\r\n * @see [[InstancedGraphicParams]].\r\n * @internal\r\n */\r\nexport interface ImdlInstances {\r\n readonly count: number;\r\n readonly transformCenter: number[];\r\n readonly featureIds: string;\r\n readonly transforms: string;\r\n readonly symbologyOverrides?: string;\r\n}\r\n\r\n/** Describes a unit of geometry within an [[ImdlMesh]].\r\n * @internal\r\n */\r\nexport interface ImdlPrimitive {\r\n /** The Id of the associated [[ImdlDisplayParams]]. */\r\n readonly material?: string;\r\n /** A lookup table containing the primitive's vertices. */\r\n readonly vertices: ImdlVertexTable;\r\n /** If true, all the vertices lie in a single plane. */\r\n readonly isPlanar?: boolean;\r\n /** If defined, a point about which the primitive should rotate when displayed to always face the camera. */\r\n readonly viewIndependentOrigin?: XYZProps;\r\n /** If defined, describes repeated instances of the same primitive. */\r\n readonly instances?: ImdlInstances;\r\n}\r\n\r\n/** Per-vertex data used to animate and/or resymbolize a mesh.\r\n * @see [[AuxChannelTable]].\r\n * @internal\r\n */\r\nexport type ImdlAuxChannelTable = Omit<AuxChannelTableProps, \"data\"> & { bufferView: string };\r\n\r\n/** Describes the \"hard\" edges of an [[ImdlMeshPrimitive]]. These edges represent simple line segments connecting two vertices of the mesh.\r\n * They are always visible regardless of view orientation.\r\n * Each segment is represented as a quad such that it can be expanded to a desired width in pixels.\r\n * @internal\r\n */\r\nexport interface ImdlSegmentEdges {\r\n /** Id of the [[ImdlBufferView]] containing - for each vertex of each quad - the 24-bit index of the vertex in the mesh's [[ImdlVertexTable]]. */\r\n readonly indices: string;\r\n /** Id of the [[ImdlBufferView]] containing - for each vertex of each quad - the 24-bit index of the segmnent's other endpoint in the mesh's [[ImdlVertexTable]],\r\n * along with a \"quad index\" in [0..3] identifying which corner of the quad the vertex represents.\r\n */\r\n readonly endPointAndQuadIndices: string;\r\n}\r\n\r\n/** Describes \"hidden\" edges of an [[ImdlMeshPrimitive]]. These edges represent simple line segments connecting two vertices of the mesh.\r\n * A given silhouette is visible when only one of the faces associated with the edge is facing the camera, producing view-dependent outlines for curved\r\n * geometry like spheres and cones.\r\n * @internal\r\n */\r\nexport interface ImdlSilhouetteEdges extends ImdlSegmentEdges {\r\n /** The Id of the [[ImdlBufferView]] containing - for each vertex - a pair of [OctEncodedNormal]($common)s for the two faces associated with the edge. */\r\n readonly normalPairs: string;\r\n}\r\n\r\n/** A compact alternative representation of [[ImdlSegmentEdges]] and [[ImdlSilhouetteEdges]] consisting of a lookup table containing information about each unique\r\n * edge, along with indices into that table.\r\n * @see [[IndexedEdgeParams]].\r\n * @internal\r\n */\r\nexport interface ImdlIndexedEdges {\r\n /** Id of the [[ImdlBufferView]] containing the indices - 6 per segment, forming a quad. */\r\n readonly indices: string;\r\n /** Id of the [[ImdlBufferView]] containing the lookup table binary data. */\r\n readonly edges: string;\r\n /** Width of the lookup texture. */\r\n readonly width: number;\r\n /** Height of the lookup texture. */\r\n readonly height: number;\r\n /** The number of simple segments in the lower partition of the lookup table. @see [[IndexedEdgeParams.numSegments]]. */\r\n readonly numSegments: number;\r\n /** The number of bytes inserted for alignment between the lower and upper partitions of the lookup table. @see [[IndexedEdgeParams.silhouettePadding]]. */\r\n readonly silhouettePadding: number;\r\n}\r\n\r\n/** As part of [[ImdlCompactEdges]], describes the visibility of an edge of a triangle.\r\n * @internal\r\n */\r\nexport enum ImdlEdgeVisibility {\r\n /** The edge is never visible. */\r\n Hidden,\r\n /** The edge is shared between two adjacent triangles. It is visible only if one triangle is facing away from the viewer and the other is facing toward the viewer. */\r\n Silhouette,\r\n /** The edge is always visible. */\r\n Visible,\r\n}\r\n\r\n/** A more compact representation of [[ImdlIndexedEdges]]. For each vertex index in the mesh, it encodes 2 bits indicating the visibility of the edge between\r\n * that vertex and the next vertex in the triangle. A second buffer holds oct-encoded normal pairs such that the pair at index N corresponds to the Nth edge\r\n * with [[ImdlEdgeVisibility.Silhouette]] in the visibility buffer.\r\n * This information is used to construct the edge table that would otherwise be described more verbosely by [[ImdlIndexedEdges]].\r\n * @see [[CompactEdgeParams]].\r\n * @internal\r\n */\r\nexport interface ImdlCompactEdges {\r\n /** Id of the [[ImdlBufferView]] containing the [[ImdlEdgeVisibility]] of each edge of each triangle in the mesh.\r\n * The order of the edges in the buffer is the same as the order of the corresponding [[ImdlSurface.indices]].\r\n * 2 bits are allocated per edge.\r\n */\r\n readonly visibility: string;\r\n /** Id of the [[ImdlBufferView]] containing the [OctEncodedNormalPair]($common)s of each silhouette edge in [[visibility]].\r\n * Each pair is represented as a 32-bit unsigned integer - `normal1 | (normal2 << 16)`.\r\n * If no silhouettes are present, this property will be `undefined`.\r\n */\r\n readonly normalPairs?: string;\r\n /** The number of edges with [[ImdlVisibility.Visible]].\r\n * @note The number of edges with [[ImdlVisibility.Silhouette]] is implicit in the number of [[normalPairs]].\r\n */\r\n readonly numVisible: number;\r\n}\r\n\r\n/** Describes the edges of an [[ImdlMeshPrimitive]].\r\n * @internal\r\n */\r\nexport interface ImdlMeshEdges {\r\n readonly segments?: ImdlSegmentEdges;\r\n readonly silhouettes?: ImdlSilhouetteEdges;\r\n /** Line strings with additional joint triangles inserted to produce wide edges with rounded corners.\r\n * Typically only produced for 2d views.\r\n */\r\n readonly indexed?: ImdlIndexedEdges;\r\n readonly compact?: ImdlCompactEdges;\r\n readonly polylines?: ImdlPolyline;\r\n}\r\n\r\n/** Describes a collection of line strings with additional joint triangles inserted to produce wide line strings with rounded corners.\r\n * @see [[TesselatedPolyline]] and [[PolylineParams]].\r\n * @internal\r\n */\r\nexport interface ImdlPolyline {\r\n /** Id of the [[ImdlBufferView]] containing the [[TesselatedPolyline.indices]]. */\r\n readonly indices: string;\r\n /** Id of the [[ImdlBufferView]] containing the [[TesselatedPolyline.prevIndices]]. */\r\n readonly prevIndices: string;\r\n /** Id of the [[ImdlBufferView]] containing the [[TesselatedPolyline.nextIndicesAndParams]]. */\r\n readonly nextIndicesAndParams: string;\r\n}\r\n\r\n/** Describes a planar region in which a pattern symbol is repeated in a regular grid.\r\n * @see [[PatternGraphicParams]].\r\n * @internal\r\n */\r\nexport interface ImdlAreaPattern {\r\n readonly type: \"areaPattern\";\r\n /** The Id of the [[ImdlAreaPatternSymbol]] containing the pattern geometry. */\r\n readonly symbolName: string;\r\n /** A [ClipVector]($core-geometry) used to clip symbols to the pattern region's boundary. */\r\n readonly clip: ClipVectorProps;\r\n /** Uniform scale applied to the pattern geometry. */\r\n readonly scale: number;\r\n /** Spacing between each instance of the pattern in meters. */\r\n readonly spacing: XYProps;\r\n readonly orgTransform: TransformProps;\r\n readonly origin: XYProps;\r\n /** Id of the [[ImdlBufferView]] containing the offset of each occurrence of the symbol in pattern-space. */\r\n readonly xyOffsets: string;\r\n readonly featureId: number;\r\n readonly modelTransform: TransformProps;\r\n readonly range: Range3dProps;\r\n readonly symbolTranslation: XYZProps;\r\n readonly viewIndependentOrigin?: XYZProps;\r\n}\r\n\r\n/** Describes the surface of an [[ImdlMeshPrimitive]] as a collection of triangles.\r\n * @internal\r\n */\r\nexport interface ImdlSurface {\r\n /** The type of surface. */\r\n readonly type: SurfaceType;\r\n /** The 24-bit indices into the [[ImdlVertexTable]] of each triangle's vertex. */\r\n readonly indices: string;\r\n /** The number of indices, only set if data is compressed. */\r\n readonly compressedIndexCount?: number;\r\n /** If true, the [[ImdlTextureMapping]] is applied regardless of [ViewFlags.textures]($common). */\r\n readonly alwaysDisplayTexture?: boolean;\r\n /** The quantization range for the UV coordinates. @see [QParams2d]($common). */\r\n readonly uvParams?: {\r\n readonly decodedMin: number[];\r\n readonly decodedMax: number[];\r\n };\r\n}\r\n\r\n/** Describes a triangle mesh, optionally including its edges. @see [[MeshParams]].\r\n * @internal\r\n */\r\nexport interface ImdlMeshPrimitive extends ImdlPrimitive {\r\n /** Type discriminator for [[AnyImdlPrimitive]]. */\r\n readonly type: MeshPrimitiveType.Mesh;\r\n readonly surface: ImdlSurface;\r\n readonly edges?: ImdlMeshEdges;\r\n readonly auxChannels?: ImdlAuxChannelTable;\r\n readonly areaPattern?: ImdlAreaPattern;\r\n}\r\n\r\n/** Describes a collection of line strings. @see [[PolylineParams]].\r\n * @internal\r\n */\r\nexport interface ImdlPolylinePrimitive extends ImdlPrimitive, ImdlPolyline {\r\n /** Type discriminator for [[AnyImdlPrimitive]]. */\r\n readonly type: MeshPrimitiveType.Polyline;\r\n}\r\n\r\n/** Describes a collection of individual points. @see [[PointStringParams.\r\n * @internal\r\n */\r\nexport interface ImdlPointStringPrimitive extends ImdlPrimitive {\r\n /** Type discriminator for [[AnyImdlPrimitive]]. */\r\n readonly type: MeshPrimitiveType.Point;\r\n /** The Id of the [[ImdlBufferView]] containing - for each point - the 24-bit index of the corresponding vertex in the [[ImdlVertexTable]]. */\r\n readonly indices: string;\r\n}\r\n\r\n/** @internal */\r\nexport type AnyImdlPrimitive = ImdlMeshPrimitive | ImdlPolylinePrimitive | ImdlPointStringPrimitive;\r\n\r\n/** A collection of primitive geometry to be rendered.\r\n * @internal\r\n */\r\nexport interface ImdlMesh {\r\n /** The geometry to be rendered. */\r\n readonly primitives?: Array<AnyImdlPrimitive | ImdlAreaPattern>;\r\n /** If this mesh defines a layer, the unique Id of that layer.\r\n * @see [[RenderSystem.createGraphicLayer]] for a description of layers.\r\n */\r\n readonly layer?: string;\r\n}\r\n\r\n/** A collection of primitive geometry to be rendered as the pattern symbol for an [[ImdlAreaPattern]].\r\n * @internal\r\n */\r\nexport interface ImdlAreaPatternSymbol {\r\n readonly primitives: AnyImdlPrimitive[];\r\n}\r\n\r\n/** If the tile has an associated [RenderSchedule.Script]($common), an array of Ids of nodes in the script used to group elements.\r\n * @internal\r\n */\r\nexport interface ImdlAnimationNodes {\r\n /** The number of bytes in each integer Id provided by [[bufferView]] - either 1, 2, or 4. */\r\n bytesPerId: number;\r\n /** The Id of the [[ImdlBufferView]] containing the tightly-packed array of 1-, 2- or 4-byte unsigned integer node Ids; the number of bytes is specified by [[bytesPerId]]. */\r\n bufferView: string;\r\n}\r\n\r\n/** Describes a contiguous array of bytes within the binary portion of the tile.\r\n * @internal\r\n */\r\nexport interface ImdlBufferView {\r\n /** The number of bytes in the array. */\r\n byteLength: number;\r\n /** The offset from the beginning of the binary portion of the tile data to the first byte in the array. */\r\n byteOffset: number;\r\n}\r\n\r\n/** A top-level dictionary of resources of a particular type contained in an [[Imdl]] tile.\r\n * Each resource has a unique name by which it can be referred to by other contents of the tile.\r\n * @internal\r\n */\r\nexport interface ImdlDictionary<T> {\r\n [key: string]: T | undefined;\r\n}\r\n\r\n/** Describes all of the geometry contained in the tile.\r\n * @internal\r\n */\r\nexport interface ImdlScene {\r\n /** The Ids of the elements of [[Imdl.nodes]] to be included in the scene. */\r\n nodes: string[];\r\n}\r\n\r\n/** Describes the top-level contents of a tile.\r\n * @internal\r\n */\r\nexport interface ImdlDocument {\r\n /** The Id of the ImdlScene in [[scenes]] that describes the tile's geometry. */\r\n scene: string;\r\n /** The collection of ImdlScenes included in the tile. */\r\n scenes: ImdlDictionary<ImdlScene>;\r\n /** Specifies point to which all vertex positions in the tile are relative, as an array of 3 numbers.\r\n * Currently only used for requestElementGraphics - see GraphicsRequestProps.useAbsolutePositions.\r\n */\r\n rtcCenter?: number[];\r\n /** Maps each node Id to the Id of the corresponding mesh in [[meshes]]. */\r\n nodes: ImdlDictionary<string>;\r\n meshes: ImdlDictionary<ImdlMesh>;\r\n bufferViews: ImdlDictionary<ImdlBufferView>;\r\n materials?: ImdlDictionary<ImdlDisplayParams>;\r\n patternSymbols?: ImdlDictionary<ImdlAreaPatternSymbol>;\r\n animationNodes?: ImdlAnimationNodes;\r\n renderMaterials?: ImdlDictionary<ImdlRenderMaterial>;\r\n namedTextures?: ImdlDictionary<ImdlNamedTexture>;\r\n}\r\n"]}
|
|
@@ -45,5 +45,5 @@ export declare function toMaterialParams(mat: Imdl.SurfaceMaterialParams): Mater
|
|
|
45
45
|
/** @internal */
|
|
46
46
|
export declare function convertFeatureTable(imdlFeatureTable: Imdl.FeatureTable, batchModelId: Id64String): RenderFeatureTable;
|
|
47
47
|
/** @internal */
|
|
48
|
-
export declare function parseImdlDocument(options: ParseImdlDocumentArgs): Imdl.Document | ImdlParseError
|
|
48
|
+
export declare function parseImdlDocument(options: ParseImdlDocumentArgs): Promise<Imdl.Document | ImdlParseError>;
|
|
49
49
|
//# sourceMappingURL=ParseImdlDocument.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParseImdlDocument.d.ts","sourceRoot":"","sources":["../../../../src/common/imdl/ParseImdlDocument.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA4B,OAAO,EAAE,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AAE7G,OAAO,EAEwD,kBAAkB,EAAkB,cAAc,EACnG,cAAc,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC;AAWhD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ParseImdlDocument.d.ts","sourceRoot":"","sources":["../../../../src/common/imdl/ParseImdlDocument.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA4B,OAAO,EAAE,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AAE7G,OAAO,EAEwD,kBAAkB,EAAkB,cAAc,EACnG,cAAc,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC;AAWhD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7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QAAQ,GAAG,cAAc,CAAC,CA0D/G"}
|
|
@@ -16,6 +16,7 @@ import { splitMeshParams, splitPointStringParams, splitPolylineParams } from "..
|
|
|
16
16
|
import { AnimationNodeId } from "../internal/render/AnimationNodeId";
|
|
17
17
|
import { VertexIndices } from "../internal/render/VertexIndices";
|
|
18
18
|
import { indexedEdgeParamsFromCompactEdges } from "./CompactEdges";
|
|
19
|
+
import { getMeshoptDecoder } from "../../tile/internal";
|
|
19
20
|
/** Header preceding "glTF" data in iMdl tile. */
|
|
20
21
|
class GltfHeader extends TileHeader {
|
|
21
22
|
get isValid() { return TileFormat.Gltf === this.format; }
|
|
@@ -207,10 +208,15 @@ class Parser {
|
|
|
207
208
|
this._stream = stream;
|
|
208
209
|
this._timeline = options.timeline;
|
|
209
210
|
}
|
|
210
|
-
parse() {
|
|
211
|
+
async parse() {
|
|
211
212
|
const featureTable = this.parseFeatureTable();
|
|
212
213
|
if (!featureTable)
|
|
213
214
|
return TileReadStatus.InvalidFeatureTable;
|
|
215
|
+
if (this.hasMeshoptCompression()) {
|
|
216
|
+
this._meshoptDecoder = await getMeshoptDecoder();
|
|
217
|
+
if (!this._meshoptDecoder)
|
|
218
|
+
return TileReadStatus.InvalidTileData;
|
|
219
|
+
}
|
|
214
220
|
const rtcCenter = this._document.rtcCenter ? {
|
|
215
221
|
x: this._document.rtcCenter[0] ?? 0,
|
|
216
222
|
y: this._document.rtcCenter[1] ?? 0,
|
|
@@ -227,6 +233,26 @@ class Parser {
|
|
|
227
233
|
patterns: this._patterns,
|
|
228
234
|
};
|
|
229
235
|
}
|
|
236
|
+
hasMeshoptCompression() {
|
|
237
|
+
let hasMeshoptCompression = false;
|
|
238
|
+
for (const meshKey of Object.keys(this._document.meshes)) {
|
|
239
|
+
const mesh = this._document.meshes[meshKey];
|
|
240
|
+
mesh?.primitives?.forEach((primitive) => {
|
|
241
|
+
if (primitive.type !== "areaPattern") {
|
|
242
|
+
const imdlPrimitive = primitive;
|
|
243
|
+
const vertexTable = imdlPrimitive.vertices;
|
|
244
|
+
if (vertexTable.compressedSize && vertexTable.compressedSize > 0) {
|
|
245
|
+
hasMeshoptCompression = true;
|
|
246
|
+
}
|
|
247
|
+
const surf = imdlPrimitive.surface;
|
|
248
|
+
if (surf && surf.compressedIndexCount && surf.compressedIndexCount > 0) {
|
|
249
|
+
hasMeshoptCompression = true;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
return hasMeshoptCompression;
|
|
255
|
+
}
|
|
230
256
|
parseFeatureTable() {
|
|
231
257
|
this._stream.curPos = this._featureTableInfo.startPos;
|
|
232
258
|
const header = FeatureTableHeader.readFrom(this._stream);
|
|
@@ -728,9 +754,25 @@ class Parser {
|
|
|
728
754
|
const surf = mesh.surface;
|
|
729
755
|
if (!surf)
|
|
730
756
|
return undefined;
|
|
731
|
-
|
|
757
|
+
let indices = this.findBuffer(surf.indices);
|
|
732
758
|
if (!indices)
|
|
733
759
|
return undefined;
|
|
760
|
+
if (surf.compressedIndexCount && surf.compressedIndexCount > 0) {
|
|
761
|
+
if (!this._meshoptDecoder) {
|
|
762
|
+
return undefined;
|
|
763
|
+
}
|
|
764
|
+
const decompressedIndices = new Uint8Array(surf.compressedIndexCount * 4);
|
|
765
|
+
this._meshoptDecoder.decodeIndexSequence(decompressedIndices, surf.compressedIndexCount, 4, indices);
|
|
766
|
+
// reduce from 32 to 24 bits
|
|
767
|
+
indices = new Uint8Array(surf.compressedIndexCount * 3);
|
|
768
|
+
for (let i = 0; i < surf.compressedIndexCount; i++) {
|
|
769
|
+
const srcIndex = i * 4;
|
|
770
|
+
const dstIndex = i * 3;
|
|
771
|
+
indices[dstIndex + 0] = decompressedIndices[srcIndex + 0];
|
|
772
|
+
indices[dstIndex + 1] = decompressedIndices[srcIndex + 1];
|
|
773
|
+
indices[dstIndex + 2] = decompressedIndices[srcIndex + 2];
|
|
774
|
+
}
|
|
775
|
+
}
|
|
734
776
|
const type = surf.type;
|
|
735
777
|
if (!isValidSurfaceType(type))
|
|
736
778
|
return undefined;
|
|
@@ -790,9 +832,40 @@ class Parser {
|
|
|
790
832
|
const json = primitive.vertices;
|
|
791
833
|
if (!json)
|
|
792
834
|
return undefined;
|
|
793
|
-
|
|
794
|
-
if (
|
|
795
|
-
|
|
835
|
+
let bytes;
|
|
836
|
+
if (json.compressedSize && json.compressedSize > 0) {
|
|
837
|
+
if (!this._meshoptDecoder) {
|
|
838
|
+
return undefined;
|
|
839
|
+
}
|
|
840
|
+
const bufferViewJson = this._document.bufferViews[JsonUtils.asString(json.bufferView)];
|
|
841
|
+
if (undefined === bufferViewJson)
|
|
842
|
+
return undefined;
|
|
843
|
+
const byteOffset = JsonUtils.asInt(bufferViewJson.byteOffset);
|
|
844
|
+
const byteLength = JsonUtils.asInt(bufferViewJson.byteLength);
|
|
845
|
+
if (0 === byteLength)
|
|
846
|
+
return undefined;
|
|
847
|
+
const compressedBytes = this._binaryData.subarray(byteOffset, byteOffset + json.compressedSize);
|
|
848
|
+
if (!compressedBytes)
|
|
849
|
+
return undefined;
|
|
850
|
+
bytes = new Uint8Array(json.width * json.height * 4);
|
|
851
|
+
this._meshoptDecoder.decodeVertexBuffer(bytes, json.count, json.numRgbaPerVertex * 4, compressedBytes);
|
|
852
|
+
const remainingBytesSize = byteLength - json.compressedSize;
|
|
853
|
+
// if there are remaining bytes, copy the data that did not go through the compression
|
|
854
|
+
if (remainingBytesSize > 0) {
|
|
855
|
+
const remainingBytes = this._binaryData.subarray(byteOffset + json.compressedSize, byteOffset + byteLength);
|
|
856
|
+
if (!remainingBytes)
|
|
857
|
+
return undefined;
|
|
858
|
+
const decompressedSize = json.count * json.numRgbaPerVertex * 4;
|
|
859
|
+
for (let i = 0; i < remainingBytesSize; i++) {
|
|
860
|
+
bytes[decompressedSize + i] = remainingBytes[i];
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
bytes = this.findBuffer(JsonUtils.asString(json.bufferView));
|
|
866
|
+
if (!bytes)
|
|
867
|
+
return undefined;
|
|
868
|
+
}
|
|
796
869
|
const uniformFeatureID = undefined !== json.featureID ? JsonUtils.asInt(json.featureID) : undefined;
|
|
797
870
|
const rangeMin = JsonUtils.asArray(json.params.decodedMin);
|
|
798
871
|
const rangeMax = JsonUtils.asArray(json.params.decodedMax);
|
|
@@ -1004,7 +1077,7 @@ export function convertFeatureTable(imdlFeatureTable, batchModelId) {
|
|
|
1004
1077
|
return table;
|
|
1005
1078
|
}
|
|
1006
1079
|
/** @internal */
|
|
1007
|
-
export function parseImdlDocument(options) {
|
|
1080
|
+
export async function parseImdlDocument(options) {
|
|
1008
1081
|
const stream = ByteStream.fromUint8Array(options.data);
|
|
1009
1082
|
const imdlHeader = new ImdlHeader(stream);
|
|
1010
1083
|
if (!imdlHeader.isValid)
|
|
@@ -1049,7 +1122,7 @@ export function parseImdlDocument(options) {
|
|
|
1049
1122
|
multiModel: 0 !== (imdlHeader.flags & ImdlFlags.MultiModelFeatureTable),
|
|
1050
1123
|
};
|
|
1051
1124
|
const parser = new Parser(imdlDoc, binaryData, options, featureTable, stream);
|
|
1052
|
-
return parser.parse();
|
|
1125
|
+
return await parser.parse();
|
|
1053
1126
|
}
|
|
1054
1127
|
catch {
|
|
1055
1128
|
return TileReadStatus.InvalidTileData;
|