@itwin/core-frontend 4.1.0-dev.25 → 4.1.0-dev.27
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/common/imdl/CompactEdges.d.ts +27 -0
- package/lib/cjs/common/imdl/CompactEdges.d.ts.map +1 -0
- package/lib/cjs/common/imdl/CompactEdges.js +96 -0
- package/lib/cjs/common/imdl/CompactEdges.js.map +1 -0
- package/lib/cjs/common/imdl/ImdlSchema.d.ts +36 -4
- package/lib/cjs/common/imdl/ImdlSchema.d.ts.map +1 -1
- package/lib/cjs/common/imdl/ImdlSchema.js +13 -0
- package/lib/cjs/common/imdl/ImdlSchema.js.map +1 -1
- package/lib/cjs/common/imdl/ParseImdlDocument.d.ts.map +1 -1
- package/lib/cjs/common/imdl/ParseImdlDocument.js +19 -3
- package/lib/cjs/common/imdl/ParseImdlDocument.js.map +1 -1
- package/lib/cjs/render/primitives/EdgeParams.js +1 -1
- package/lib/cjs/render/primitives/EdgeParams.js.map +1 -1
- package/lib/cjs/tile/DynamicIModelTile.js +1 -1
- package/lib/cjs/tile/DynamicIModelTile.js.map +1 -1
- package/lib/cjs/tile/IModelTileTree.d.ts +1 -0
- package/lib/cjs/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/IModelTileTree.js +1 -0
- package/lib/cjs/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +7 -10
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +5 -15
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +14 -7
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/common/imdl/CompactEdges.d.ts +27 -0
- package/lib/esm/common/imdl/CompactEdges.d.ts.map +1 -0
- package/lib/esm/common/imdl/CompactEdges.js +92 -0
- package/lib/esm/common/imdl/CompactEdges.js.map +1 -0
- package/lib/esm/common/imdl/ImdlSchema.d.ts +36 -4
- package/lib/esm/common/imdl/ImdlSchema.d.ts.map +1 -1
- package/lib/esm/common/imdl/ImdlSchema.js +12 -1
- package/lib/esm/common/imdl/ImdlSchema.js.map +1 -1
- package/lib/esm/common/imdl/ParseImdlDocument.d.ts.map +1 -1
- package/lib/esm/common/imdl/ParseImdlDocument.js +19 -3
- package/lib/esm/common/imdl/ParseImdlDocument.js.map +1 -1
- package/lib/esm/render/primitives/EdgeParams.js +1 -1
- package/lib/esm/render/primitives/EdgeParams.js.map +1 -1
- package/lib/esm/tile/DynamicIModelTile.js +1 -1
- package/lib/esm/tile/DynamicIModelTile.js.map +1 -1
- package/lib/esm/tile/IModelTileTree.d.ts +1 -0
- package/lib/esm/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/IModelTileTree.js +1 -0
- package/lib/esm/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +7 -10
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +5 -15
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +14 -7
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageryTileTree.js","sourceRoot":"","sources":["../../../../src/tile/map/ImageryTileTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkI;AAClI,wDAAiE;AACjE,oDAA0I;AAC1I,+CAA4C;AAK5C,0CAIqB;AAOrB,gBAAgB;AAChB,MAAa,cAAe,SAAQ,sBAAW;IAM7C,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,EAAE,mBAAmB,CAAC,CAAC;IACtG,CAAC;IAED,IAAoB,eAAe;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;YAChD,OAAO,SAAS,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;IAC5C,CAAC;CACF;AAvBD,oEAuBC","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 { assert, compareBooleans, compareNumbers, compareStrings, compareStringsOrUndefined, dispose } from \"@itwin/core-bentley\";\r\nimport { Angle, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, MapLayerSettings, RenderTexture, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { RenderMemory } from \"../../render/RenderMemory\";\r\nimport { RenderSystem } from \"../../render/RenderSystem\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport {\r\n MapCartoRectangle, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTileTreeScaleRangeVisibility, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree,\r\n RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTree, TileTreeLoadStatus, TileTreeOwner,\r\n TileTreeSupplier,\r\n} from \"../internal\";\r\n\r\n/** @internal */\r\nexport interface ImageryTileContent extends TileContent {\r\n imageryTexture?: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTile extends RealityTile {\r\n private _texture?: RenderTexture;\r\n private _mapTileUsageCount = 0;\r\n\r\n private readonly _outOfLodRange: boolean;\r\n\r\n constructor(params: TileParams, public imageryTree: ImageryMapTileTree, public quadId: QuadId, public rectangle: MapCartoRectangle) {\r\n super(params, imageryTree);\r\n\r\n this._outOfLodRange = this.depth < imageryTree.minDepth;\r\n }\r\n\r\n public get texture() { return this._texture; }\r\n public get tilingScheme() { return this.imageryTree.tilingScheme; }\r\n public override get isDisplayable() { return (this.depth > 1) && super.isDisplayable; }\r\n public override get isOutOfLodRange(): boolean { return this._outOfLodRange;}\r\n\r\n public override setContent(content: ImageryTileContent): void {\r\n this._texture = content.imageryTexture; // No dispose - textures may be shared by terrain tiles so let garbage collector dispose them.\r\n if (undefined === content.imageryTexture)\r\n (this.parent! as ImageryMapTile).setLeaf(); // Avoid traversing bing branches after no graphics is found.\r\n\r\n this.setIsReady();\r\n }\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], rectangleToDrape: MapCartoRectangle, drapePixelSize: number, args: TileDrawArgs): TileTreeLoadStatus {\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const isSmallerThanDrape = (this.rectangle.xLength() / this.maximumSize) < drapePixelSize;\r\n if ( (this.isLeaf ) // Include leaves so tiles get stretched past max LOD levels. (Only for base imagery layer)\r\n || isSmallerThanDrape\r\n || this._anyChildNotFound) {\r\n if (this.isOutOfLodRange ) {\r\n drapeTiles.push(this);\r\n this.setIsReady();\r\n } else if (this.isLeaf && !isSmallerThanDrape && !this._anyChildNotFound) {\r\n // These tiles are selected because we are beyond the max LOD of the tile tree,\r\n // might be used to display \"stretched\" tiles instead of having blank.\r\n highResolutionReplacementTiles.push(this);\r\n } else {\r\n drapeTiles.push(this);\r\n }\r\n return TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n let status = this.loadChildren();\r\n if (TileTreeLoadStatus.Loading === status) {\r\n args.markChildrenLoading();\r\n } else if (TileTreeLoadStatus.Loaded === status) {\r\n if (undefined !== this.children) {\r\n for (const child of this.children) {\r\n const mapChild = child as ImageryMapTile;\r\n if (mapChild.rectangle.intersectsRange(rectangleToDrape))\r\n status = mapChild.selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, rectangleToDrape, drapePixelSize, args);\r\n if (TileTreeLoadStatus.Loaded !== status)\r\n break;\r\n }\r\n }\r\n }\r\n return status;\r\n }\r\n public markMapTileUsage() {\r\n this._mapTileUsageCount++;\r\n }\r\n public releaseMapTileUsage() {\r\n assert(!this._texture || this._mapTileUsageCount > 0);\r\n if (this._mapTileUsageCount)\r\n this._mapTileUsageCount--;\r\n }\r\n\r\n /** @internal */\r\n public override setLeaf(): void {\r\n // Don't potentially re-request the children later.\r\n this.disposeChildren();\r\n this._isLeaf = true;\r\n this._childrenLoadStatus = TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n protected override _loadChildren(resolve: (children: Tile[] | undefined) => void, _reject: (error: Error) => void): void {\r\n\r\n const imageryTree = this.imageryTree;\r\n const resolveChildren = (childIds: QuadId[]) => {\r\n const children = new Array<Tile>();\r\n const childrenAreLeaves = (this.depth + 1) === imageryTree.maxDepth;\r\n // If children depth is lower than min LOD, mark them as disabled.\r\n // This is important: if those tiles are requested and the server refuse to serve them,\r\n // they will be marked as not found and their descendant will never be displayed.\r\n\r\n childIds.forEach((quadId) => {\r\n const rectangle = imageryTree.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n const range = Range3d.createXYZXYZ(rectangle.low.x, rectangle.low.x, 0, rectangle.high.x, rectangle.high.y, 0);\r\n const maximumSize = imageryTree.imageryLoader.maximumScreenSize;\r\n const tile = new ImageryMapTile({ parent: this, isLeaf: childrenAreLeaves, contentId: quadId.contentId, range, maximumSize}, imageryTree, quadId, rectangle);\r\n children.push(tile);\r\n });\r\n\r\n resolve(children);\r\n };\r\n\r\n imageryTree.imageryLoader.generateChildIds(this, resolveChildren);\r\n }\r\n\r\n protected override _collectStatistics(stats: RenderMemory.Statistics): void {\r\n super._collectStatistics(stats);\r\n if (this._texture)\r\n stats.addTexture(this._texture.bytesUsed);\r\n }\r\n\r\n public override freeMemory(): void {\r\n // ###TODO MapTiles and ImageryMapTiles share resources and don't currently interact well with TileAdmin.freeMemory(). Opt out for now.\r\n }\r\n\r\n public override disposeContents() {\r\n if (0 === this._mapTileUsageCount) {\r\n super.disposeContents();\r\n this.disposeTexture();\r\n }\r\n }\r\n\r\n private disposeTexture(): void {\r\n this._texture = dispose(this._texture);\r\n }\r\n public override dispose() {\r\n this._mapTileUsageCount = 0;\r\n super.dispose();\r\n }\r\n}\r\n\r\n/** Object that holds various state values for an ImageryTileTree\r\n * @internal */\r\nexport class ImageryTileTreeState {\r\n private _scaleRangeVis: MapTileTreeScaleRangeVisibility;\r\n\r\n constructor() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Get the scale range visibility of the imagery tile tree.\r\n * @returns the scale range visibility of the imagery tile tree.\r\n */\r\n public getScaleRangeVisibility() {return this._scaleRangeVis;}\r\n\r\n /** Makes a deep copy of the current object.\r\n */\r\n public clone() {\r\n const clone = new ImageryTileTreeState();\r\n clone._scaleRangeVis = this._scaleRangeVis;\r\n return clone;\r\n }\r\n\r\n /** Reset the scale range visibility of imagery tile tree (i.e. unknown)\r\n */\r\n public reset() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Sets the scale range visibility of the current imagery tile tree.\r\n * The state will be derived based on the previous visibility values:\r\n * Initial state: 'Unknown'\r\n * The first call will set the state to either: 'Visible' or 'Hidden'.\r\n * If subsequent visibility values are not consistent with the first visibility state, the state become 'Partial',\r\n * meaning the imagery tree currently contains a mixed of tiles being in range and out of range.\r\n */\r\n public setScaleRangeVisibility(visible: boolean) {\r\n if (this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Unknown) {\r\n this._scaleRangeVis = (visible ? MapTileTreeScaleRangeVisibility.Visible : MapTileTreeScaleRangeVisibility.Hidden);\r\n } else if ((visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Hidden) || (!visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Visible)) {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Partial;\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTileTree extends RealityTileTree {\r\n constructor(params: RealityTileTreeParams, private _imageryLoader: ImageryTileLoader) {\r\n super(params);\r\n const rootQuadId = new QuadId(_imageryLoader.imageryProvider.tilingScheme.rootLevel, 0, 0);\r\n this._rootTile = new ImageryMapTile(params.rootTile, this, rootQuadId, this.getTileRectangle(rootQuadId));\r\n }\r\n public get tilingScheme(): MapTilingScheme { return this._imageryLoader.imageryProvider.tilingScheme; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryLoader.addLogoCards(cards, vp);\r\n }\r\n\r\n public getTileRectangle(quadId: QuadId): MapCartoRectangle {\r\n return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n }\r\n public get imageryLoader(): ImageryTileLoader { return this._imageryLoader; }\r\n public override get is3d(): boolean {\r\n assert(false);\r\n return false;\r\n }\r\n public override get viewFlagOverrides(): ViewFlagOverrides {\r\n assert(false);\r\n return {};\r\n }\r\n public override get isContentUnbounded(): boolean {\r\n assert(false);\r\n return true;\r\n }\r\n protected override _selectTiles(_args: TileDrawArgs): Tile[] {\r\n assert(false);\r\n return [];\r\n }\r\n public override draw(_args: TileDrawArgs): void { assert(false); }\r\n\r\n private static _scratchDrapeRectangle = MapCartoRectangle.createZero();\r\n private static _drapeIntersectionScale = 1.0 - 1.0E-5;\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], tileToDrape: MapTile, args: TileDrawArgs): TileTreeLoadStatus {\r\n const drapeRectangle = tileToDrape.rectangle.clone(ImageryMapTileTree._scratchDrapeRectangle);\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const drapePixelSize = 1.05 * tileToDrape.rectangle.xLength() / tileToDrape.maximumSize;\r\n drapeRectangle.scaleAboutCenterInPlace(ImageryMapTileTree._drapeIntersectionScale); // Contract slightly to avoid draping adjacent or slivers.\r\n return (this.rootTile as ImageryMapTile).selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, drapeRectangle, drapePixelSize, args);\r\n }\r\n public cartoRectangleFromQuadId(quadId: QuadId): MapCartoRectangle { return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level); }\r\n}\r\n\r\nclass ImageryTileLoader extends RealityTileLoader {\r\n constructor(private _imageryProvider: MapLayerImageryProvider, private _iModel: IModelConnection) {\r\n super();\r\n }\r\n public override computeTilePriority(tile: Tile): number {\r\n return 25 * (this._imageryProvider.usesCachedTiles ? 2 : 1) - tile.depth; // Always cached first then descending by depth (high resolution/front first)\r\n } // Prioritized fast, cached tiles first.\r\n\r\n public get maxDepth(): number { return this._imageryProvider.maximumZoomLevel; }\r\n public get minDepth(): number { return this._imageryProvider.minimumZoomLevel; }\r\n public get priority(): TileLoadPriority { return TileLoadPriority.Map; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryProvider.addLogoCards(cards, vp);\r\n }\r\n\r\n public get maximumScreenSize(): number { return this._imageryProvider.maximumScreenSize; }\r\n public get imageryProvider(): MapLayerImageryProvider { return this._imageryProvider; }\r\n public async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }\r\n\r\n public async getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree);\r\n }\r\n\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) { return this._imageryProvider.generateChildIds(tile, resolveChildren); }\r\n\r\n /** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */\r\n public async loadChildren(_tile: RealityTile): Promise<Tile[] | undefined> {\r\n assert(false);\r\n return undefined;\r\n }\r\n public async requestTileContent(tile: Tile, _isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n return this._imageryProvider.loadTile(quadId.row, quadId.column, quadId.level);\r\n }\r\n\r\n public getRequestChannel(_tile: Tile) {\r\n // ###TODO use hostname from url - but so many layers to go through to get that...\r\n return IModelApp.tileAdmin.channels.getForHttp(\"itwinjs-imagery\");\r\n }\r\n\r\n public override async loadTileContent(tile: Tile, data: TileRequest.ResponseData, system: RenderSystem): Promise<ImageryTileContent> {\r\n assert(data instanceof ImageSource);\r\n assert(tile instanceof ImageryMapTile);\r\n const content: ImageryTileContent = {};\r\n const texture = await this.loadTextureImage(data, system);\r\n if (undefined === texture)\r\n return content;\r\n\r\n content.imageryTexture = texture;\r\n return content;\r\n }\r\n\r\n private async loadTextureImage(source: ImageSource, system: RenderSystem): Promise<RenderTexture | undefined> {\r\n try {\r\n return await system.createTextureFromSource({\r\n type: RenderTexture.Type.FilteredTileSection,\r\n source,\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\ninterface ImageryMapLayerTreeId {\r\n settings: ImageMapLayerSettings;\r\n}\r\n\r\n/** Supplies a TileTree that can load and draw tiles based on our imagery provider.\r\n * The TileTree is uniquely identified by its imagery type.\r\n */\r\nclass ImageryMapLayerTreeSupplier implements TileTreeSupplier {\r\n /** Return a numeric value indicating how two tree IDs are ordered relative to one another.\r\n * This allows the ID to serve as a lookup key to find the corresponding TileTree.\r\n */\r\n public compareTileTreeIds(lhs: ImageryMapLayerTreeId, rhs: ImageryMapLayerTreeId): number {\r\n let cmp = compareStrings(lhs.settings.url, rhs.settings.url);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.userName, rhs.settings.userName);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.password, rhs.settings.password);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.transparentBackground, rhs.settings.transparentBackground);\r\n if (0 === cmp) {\r\n cmp = compareNumbers(lhs.settings.subLayers.length, rhs.settings.subLayers.length);\r\n if (0 === cmp) {\r\n for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++)\r\n cmp = compareBooleans(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n /** The first time a tree of a particular imagery type is requested, this function creates it. */\r\n public async createTileTree(id: ImageryMapLayerTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n const imageryProvider = IModelApp.mapLayerFormatRegistry.createImageryProvider(id.settings);\r\n if (undefined === imageryProvider)\r\n return undefined;\r\n\r\n await imageryProvider.initialize();\r\n const modelId = iModel.transientIds.getNext();\r\n const tilingScheme = imageryProvider.tilingScheme;\r\n const rootLevel = (1 === tilingScheme.numberOfLevelZeroTilesX && 1 === tilingScheme.numberOfLevelZeroTilesY) ? 0 : -1;\r\n const rootTileId = new QuadId(rootLevel, 0, 0).contentId;\r\n const rootRange = Range3d.createXYZXYZ(-Angle.piRadians, -Angle.piOver2Radians, 0, Angle.piRadians, Angle.piOver2Radians, 0);\r\n const rootTileProps = { contentId: rootTileId, range: rootRange, maximumSize: 0 };\r\n const loader = new ImageryTileLoader(imageryProvider, iModel);\r\n const treeProps = { rootTile: rootTileProps, id: modelId, modelId, iModel, location: Transform.createIdentity(), priority: TileLoadPriority.Map, loader, gcsConverterAvailable: false };\r\n return new ImageryMapTileTree(treeProps, loader);\r\n }\r\n}\r\n\r\nconst imageryTreeSupplier = new ImageryMapLayerTreeSupplier();\r\n\r\n/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.\r\n * @internal\r\n */\r\nexport class ImageryMapLayerTreeReference extends MapLayerTileTreeReference {\r\n public constructor(layerSettings: MapLayerSettings, layerIndex: number, iModel: IModelConnection) {\r\n super(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n public override get castsShadows() { return false; }\r\n\r\n /** Return the owner of the TileTree to draw. */\r\n public get treeOwner(): TileTreeOwner {\r\n return this.iModel.tiles.getTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override resetTreeOwner() {\r\n return this.iModel.tiles.resetTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override get imageryProvider(): MapLayerImageryProvider | undefined {\r\n const tree = this.treeOwner.load();\r\n if (!tree || !(tree instanceof ImageryMapTileTree))\r\n return undefined;\r\n\r\n return tree.imageryLoader.imageryProvider;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ImageryTileTree.js","sourceRoot":"","sources":["../../../../src/tile/map/ImageryTileTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkI;AAClI,wDAAiE;AACjE,oDAA0I;AAC1I,+CAA4C;AAK5C,0CAIqB;AAOrB,gBAAgB;AAChB,MAAa,cAAe,SAAQ,sBAAW;IAM7C,YAAY,MAAkB,EAAS,WAA+B,EAAS,MAAc,EAAS,SAA4B;QAChI,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QADU,gBAAW,GAAX,WAAW,CAAoB;QAAS,WAAM,GAAN,MAAM,CAAQ;QAAS,cAAS,GAAT,SAAS,CAAmB;QAJ1H,uBAAkB,GAAG,CAAC,CAAC;QAO7B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC;IAC1D,CAAC;IAED,IAAW,OAAO,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9C,IAAW,YAAY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AmB,CAAC,CAAC;IACtG,CAAC;IAED,IAAoB,eAAe;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;YAChD,OAAO,SAAS,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;IAC5C,CAAC;CACF;AAvBD,oEAuBC","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 { assert, compareBooleans, compareNumbers, compareStrings, compareStringsOrUndefined, dispose } from \"@itwin/core-bentley\";\r\nimport { Angle, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ImageMapLayerSettings, ImageSource, MapLayerSettings, RenderTexture, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { RenderMemory } from \"../../render/RenderMemory\";\r\nimport { RenderSystem } from \"../../render/RenderSystem\";\r\nimport { ScreenViewport } from \"../../Viewport\";\r\nimport {\r\n MapCartoRectangle, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTileTreeScaleRangeVisibility, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree,\r\n RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTree, TileTreeLoadStatus, TileTreeOwner,\r\n TileTreeSupplier,\r\n} from \"../internal\";\r\n\r\n/** @internal */\r\nexport interface ImageryTileContent extends TileContent {\r\n imageryTexture?: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTile extends RealityTile {\r\n private _texture?: RenderTexture;\r\n private _mapTileUsageCount = 0;\r\n\r\n private readonly _outOfLodRange: boolean;\r\n\r\n constructor(params: TileParams, public imageryTree: ImageryMapTileTree, public quadId: QuadId, public rectangle: MapCartoRectangle) {\r\n super(params, imageryTree);\r\n\r\n this._outOfLodRange = this.depth < imageryTree.minDepth;\r\n }\r\n\r\n public get texture() { return this._texture; }\r\n public get tilingScheme() { return this.imageryTree.tilingScheme; }\r\n public override get isDisplayable() { return (this.depth > 1) && super.isDisplayable; }\r\n public override get isOutOfLodRange(): boolean { return this._outOfLodRange;}\r\n\r\n public override setContent(content: ImageryTileContent): void {\r\n this._texture = content.imageryTexture; // No dispose - textures may be shared by terrain tiles so let garbage collector dispose them.\r\n if (undefined === content.imageryTexture)\r\n (this.parent! as ImageryMapTile).setLeaf(); // Avoid traversing bing branches after no graphics is found.\r\n\r\n this.setIsReady();\r\n }\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], rectangleToDrape: MapCartoRectangle, drapePixelSize: number, args: TileDrawArgs): TileTreeLoadStatus {\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const isSmallerThanDrape = (this.rectangle.xLength() / this.maximumSize) < drapePixelSize;\r\n if ( (this.isLeaf ) // Include leaves so tiles get stretched past max LOD levels. (Only for base imagery layer)\r\n || isSmallerThanDrape\r\n || this._anyChildNotFound) {\r\n if (this.isOutOfLodRange ) {\r\n drapeTiles.push(this);\r\n this.setIsReady();\r\n } else if (this.isLeaf && !isSmallerThanDrape && !this._anyChildNotFound) {\r\n // These tiles are selected because we are beyond the max LOD of the tile tree,\r\n // might be used to display \"stretched\" tiles instead of having blank.\r\n highResolutionReplacementTiles.push(this);\r\n } else {\r\n drapeTiles.push(this);\r\n }\r\n return TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n let status = this.loadChildren();\r\n if (TileTreeLoadStatus.Loading === status) {\r\n args.markChildrenLoading();\r\n } else if (TileTreeLoadStatus.Loaded === status) {\r\n if (undefined !== this.children) {\r\n for (const child of this.children) {\r\n const mapChild = child as ImageryMapTile;\r\n if (mapChild.rectangle.intersectsRange(rectangleToDrape))\r\n status = mapChild.selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, rectangleToDrape, drapePixelSize, args);\r\n if (TileTreeLoadStatus.Loaded !== status)\r\n break;\r\n }\r\n }\r\n }\r\n return status;\r\n }\r\n public markMapTileUsage() {\r\n this._mapTileUsageCount++;\r\n }\r\n public releaseMapTileUsage() {\r\n assert(!this._texture || this._mapTileUsageCount > 0);\r\n if (this._mapTileUsageCount)\r\n this._mapTileUsageCount--;\r\n }\r\n\r\n /** @internal */\r\n public override setLeaf(): void {\r\n // Don't potentially re-request the children later.\r\n this.disposeChildren();\r\n this._isLeaf = true;\r\n this._childrenLoadStatus = TileTreeLoadStatus.Loaded;\r\n }\r\n\r\n protected override _loadChildren(resolve: (children: Tile[] | undefined) => void, _reject: (error: Error) => void): void {\r\n\r\n const imageryTree = this.imageryTree;\r\n const resolveChildren = (childIds: QuadId[]) => {\r\n const children = new Array<Tile>();\r\n const childrenAreLeaves = (this.depth + 1) === imageryTree.maxDepth;\r\n // If children depth is lower than min LOD, mark them as disabled.\r\n // This is important: if those tiles are requested and the server refuse to serve them,\r\n // they will be marked as not found and their descendant will never be displayed.\r\n\r\n childIds.forEach((quadId) => {\r\n const rectangle = imageryTree.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n const range = Range3d.createXYZXYZ(rectangle.low.x, rectangle.low.x, 0, rectangle.high.x, rectangle.high.y, 0);\r\n const maximumSize = imageryTree.imageryLoader.maximumScreenSize;\r\n const tile = new ImageryMapTile({ parent: this, isLeaf: childrenAreLeaves, contentId: quadId.contentId, range, maximumSize}, imageryTree, quadId, rectangle);\r\n children.push(tile);\r\n });\r\n\r\n resolve(children);\r\n };\r\n\r\n imageryTree.imageryLoader.generateChildIds(this, resolveChildren);\r\n }\r\n\r\n protected override _collectStatistics(stats: RenderMemory.Statistics): void {\r\n super._collectStatistics(stats);\r\n if (this._texture)\r\n stats.addTexture(this._texture.bytesUsed);\r\n }\r\n\r\n public override freeMemory(): void {\r\n // ###TODO MapTiles and ImageryMapTiles share resources and don't currently interact well with TileAdmin.freeMemory(). Opt out for now.\r\n }\r\n\r\n public override disposeContents() {\r\n if (0 === this._mapTileUsageCount) {\r\n super.disposeContents();\r\n this.disposeTexture();\r\n }\r\n }\r\n\r\n private disposeTexture(): void {\r\n this._texture = dispose(this._texture);\r\n }\r\n public override dispose() {\r\n this._mapTileUsageCount = 0;\r\n super.dispose();\r\n }\r\n}\r\n\r\n/** Object that holds various state values for an ImageryTileTree\r\n * @internal */\r\nexport class ImageryTileTreeState {\r\n private _scaleRangeVis: MapTileTreeScaleRangeVisibility;\r\n\r\n constructor() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Get the scale range visibility of the imagery tile tree.\r\n * @returns the scale range visibility of the imagery tile tree.\r\n */\r\n public getScaleRangeVisibility() {return this._scaleRangeVis;}\r\n\r\n /** Makes a deep copy of the current object.\r\n */\r\n public clone() {\r\n const clone = new ImageryTileTreeState();\r\n clone._scaleRangeVis = this._scaleRangeVis;\r\n return clone;\r\n }\r\n\r\n /** Reset the scale range visibility of imagery tile tree (i.e. unknown)\r\n */\r\n public reset() {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Unknown;\r\n }\r\n\r\n /** Sets the scale range visibility of the current imagery tile tree.\r\n * The state will be derived based on the previous visibility values:\r\n * Initial state: 'Unknown'\r\n * The first call will set the state to either: 'Visible' or 'Hidden'.\r\n * If subsequent visibility values are not consistent with the first visibility state, the state become 'Partial',\r\n * meaning the imagery tree currently contains a mixed of tiles being in range and out of range.\r\n */\r\n public setScaleRangeVisibility(visible: boolean) {\r\n if (this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Unknown) {\r\n this._scaleRangeVis = (visible ? MapTileTreeScaleRangeVisibility.Visible : MapTileTreeScaleRangeVisibility.Hidden);\r\n } else if ((visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Hidden) || (!visible && this._scaleRangeVis === MapTileTreeScaleRangeVisibility.Visible)) {\r\n this._scaleRangeVis = MapTileTreeScaleRangeVisibility.Partial;\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ImageryMapTileTree extends RealityTileTree {\r\n constructor(params: RealityTileTreeParams, private _imageryLoader: ImageryTileLoader) {\r\n super(params);\r\n const rootQuadId = new QuadId(_imageryLoader.imageryProvider.tilingScheme.rootLevel, 0, 0);\r\n this._rootTile = new ImageryMapTile(params.rootTile, this, rootQuadId, this.getTileRectangle(rootQuadId));\r\n }\r\n public get tilingScheme(): MapTilingScheme { return this._imageryLoader.imageryProvider.tilingScheme; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryLoader.addLogoCards(cards, vp);\r\n }\r\n\r\n public getTileRectangle(quadId: QuadId): MapCartoRectangle {\r\n return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level);\r\n }\r\n public get imageryLoader(): ImageryTileLoader { return this._imageryLoader; }\r\n public override get is3d(): boolean {\r\n assert(false);\r\n return false;\r\n }\r\n public override get viewFlagOverrides(): ViewFlagOverrides {\r\n assert(false);\r\n return {};\r\n }\r\n public override get isContentUnbounded(): boolean {\r\n assert(false);\r\n return true;\r\n }\r\n protected override _selectTiles(_args: TileDrawArgs): Tile[] {\r\n assert(false);\r\n return [];\r\n }\r\n public override draw(_args: TileDrawArgs): void { assert(false); }\r\n\r\n private static _scratchDrapeRectangle = MapCartoRectangle.createZero();\r\n private static _drapeIntersectionScale = 1.0 - 1.0E-5;\r\n\r\n public selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], tileToDrape: MapTile, args: TileDrawArgs): TileTreeLoadStatus {\r\n const drapeRectangle = tileToDrape.rectangle.clone(ImageryMapTileTree._scratchDrapeRectangle);\r\n // Base draping overlap on width rather than height so that tiling schemes with multiple root nodes overlay correctly.\r\n const drapePixelSize = 1.05 * tileToDrape.rectangle.xLength() / tileToDrape.maximumSize;\r\n drapeRectangle.scaleAboutCenterInPlace(ImageryMapTileTree._drapeIntersectionScale); // Contract slightly to avoid draping adjacent or slivers.\r\n return (this.rootTile as ImageryMapTile).selectCartoDrapeTiles(drapeTiles, highResolutionReplacementTiles, drapeRectangle, drapePixelSize, args);\r\n }\r\n public cartoRectangleFromQuadId(quadId: QuadId): MapCartoRectangle { return this.tilingScheme.tileXYToRectangle(quadId.column, quadId.row, quadId.level); }\r\n}\r\n\r\nclass ImageryTileLoader extends RealityTileLoader {\r\n constructor(private _imageryProvider: MapLayerImageryProvider, private _iModel: IModelConnection) {\r\n super();\r\n }\r\n public override computeTilePriority(tile: Tile): number {\r\n return 25 * (this._imageryProvider.usesCachedTiles ? 2 : 1) - tile.depth; // Always cached first then descending by depth (high resolution/front first)\r\n } // Prioritized fast, cached tiles first.\r\n\r\n public get maxDepth(): number { return this._imageryProvider.maximumZoomLevel; }\r\n public get minDepth(): number { return this._imageryProvider.minimumZoomLevel; }\r\n public get priority(): TileLoadPriority { return TileLoadPriority.Map; }\r\n public addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n this._imageryProvider.addLogoCards(cards, vp);\r\n }\r\n\r\n public get maximumScreenSize(): number { return this._imageryProvider.maximumScreenSize; }\r\n public get imageryProvider(): MapLayerImageryProvider { return this._imageryProvider; }\r\n public async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> { await this._imageryProvider.getToolTip(strings, quadId, carto, tree); }\r\n\r\n public async getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\r\n await this._imageryProvider.getFeatureInfo(featureInfos, quadId, carto, tree);\r\n }\r\n\r\n public generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void) { return this._imageryProvider.generateChildIds(tile, resolveChildren); }\r\n\r\n /** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */\r\n public async loadChildren(_tile: RealityTile): Promise<Tile[] | undefined> {\r\n assert(false);\r\n return undefined;\r\n }\r\n public async requestTileContent(tile: Tile, _isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n return this._imageryProvider.loadTile(quadId.row, quadId.column, quadId.level);\r\n }\r\n\r\n public getRequestChannel(_tile: Tile) {\r\n // ###TODO use hostname from url - but so many layers to go through to get that...\r\n return IModelApp.tileAdmin.channels.getForHttp(\"itwinjs-imagery\");\r\n }\r\n\r\n public override async loadTileContent(tile: Tile, data: TileRequest.ResponseData, system: RenderSystem): Promise<ImageryTileContent> {\r\n assert(data instanceof ImageSource);\r\n assert(tile instanceof ImageryMapTile);\r\n const content: ImageryTileContent = {};\r\n const texture = await this.loadTextureImage(data, system);\r\n if (undefined === texture)\r\n return content;\r\n\r\n content.imageryTexture = texture;\r\n return content;\r\n }\r\n\r\n private async loadTextureImage(source: ImageSource, system: RenderSystem): Promise<RenderTexture | undefined> {\r\n try {\r\n return await system.createTextureFromSource({\r\n type: RenderTexture.Type.FilteredTileSection,\r\n source,\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\ninterface ImageryMapLayerTreeId {\r\n settings: ImageMapLayerSettings;\r\n}\r\n\r\n/** Supplies a TileTree that can load and draw tiles based on our imagery provider.\r\n * The TileTree is uniquely identified by its imagery type.\r\n */\r\nclass ImageryMapLayerTreeSupplier implements TileTreeSupplier {\r\n /** Return a numeric value indicating how two tree IDs are ordered relative to one another.\r\n * This allows the ID to serve as a lookup key to find the corresponding TileTree.\r\n */\r\n public compareTileTreeIds(lhs: ImageryMapLayerTreeId, rhs: ImageryMapLayerTreeId): number {\r\n let cmp = compareStrings(lhs.settings.formatId, rhs.settings.formatId);\r\n if (0 === cmp) {\r\n cmp = compareStrings(lhs.settings.url, rhs.settings.url);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.userName, rhs.settings.userName);\r\n if (0 === cmp) {\r\n cmp = compareStringsOrUndefined(lhs.settings.password, rhs.settings.password);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.transparentBackground, rhs.settings.transparentBackground);\r\n if (0 === cmp) {\r\n cmp = compareNumbers(lhs.settings.subLayers.length, rhs.settings.subLayers.length);\r\n if (0 === cmp) {\r\n for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++) {\r\n cmp = compareStrings(lhs.settings.subLayers[i].name, rhs.settings.subLayers[i].name);\r\n if (0 === cmp) {\r\n cmp = compareBooleans(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n /** The first time a tree of a particular imagery type is requested, this function creates it. */\r\n public async createTileTree(id: ImageryMapLayerTreeId, iModel: IModelConnection): Promise<TileTree | undefined> {\r\n const imageryProvider = IModelApp.mapLayerFormatRegistry.createImageryProvider(id.settings);\r\n if (undefined === imageryProvider)\r\n return undefined;\r\n\r\n await imageryProvider.initialize();\r\n const modelId = iModel.transientIds.getNext();\r\n const tilingScheme = imageryProvider.tilingScheme;\r\n const rootLevel = (1 === tilingScheme.numberOfLevelZeroTilesX && 1 === tilingScheme.numberOfLevelZeroTilesY) ? 0 : -1;\r\n const rootTileId = new QuadId(rootLevel, 0, 0).contentId;\r\n const rootRange = Range3d.createXYZXYZ(-Angle.piRadians, -Angle.piOver2Radians, 0, Angle.piRadians, Angle.piOver2Radians, 0);\r\n const rootTileProps = { contentId: rootTileId, range: rootRange, maximumSize: 0 };\r\n const loader = new ImageryTileLoader(imageryProvider, iModel);\r\n const treeProps = { rootTile: rootTileProps, id: modelId, modelId, iModel, location: Transform.createIdentity(), priority: TileLoadPriority.Map, loader, gcsConverterAvailable: false };\r\n return new ImageryMapTileTree(treeProps, loader);\r\n }\r\n}\r\n\r\nconst imageryTreeSupplier = new ImageryMapLayerTreeSupplier();\r\n\r\n/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.\r\n * @internal\r\n */\r\nexport class ImageryMapLayerTreeReference extends MapLayerTileTreeReference {\r\n public constructor(layerSettings: MapLayerSettings, layerIndex: number, iModel: IModelConnection) {\r\n super(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n public override get castsShadows() { return false; }\r\n\r\n /** Return the owner of the TileTree to draw. */\r\n public get treeOwner(): TileTreeOwner {\r\n return this.iModel.tiles.getTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override resetTreeOwner() {\r\n return this.iModel.tiles.resetTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);\r\n }\r\n\r\n public override get imageryProvider(): MapLayerImageryProvider | undefined {\r\n const tree = this.treeOwner.load();\r\n if (!tree || !(tree instanceof ImageryMapTileTree))\r\n return undefined;\r\n\r\n return tree.imageryLoader.imageryProvider;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Tiles
|
|
3
|
+
*/
|
|
4
|
+
import { ImdlModel } from "./ImdlModel";
|
|
5
|
+
import { VertexIndices } from "../render/primitives/VertexIndices";
|
|
6
|
+
/** Parameters supplied to [[indexedEdgeParamsFromCompactEdges]].
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface CompactEdgeParams {
|
|
10
|
+
/** The number of always-visible edges.
|
|
11
|
+
* @note The number of silhouette edges is the same as the number of [[normalPairs]].
|
|
12
|
+
*/
|
|
13
|
+
numVisibleEdges: number;
|
|
14
|
+
/** 2 bit visibility of each edge to the next edge in the triangle, in the same order as the triangle indices in [[vertexIndices]]. */
|
|
15
|
+
visibility: Uint8Array;
|
|
16
|
+
/** The indices describing the topology of the triangle mesh. */
|
|
17
|
+
vertexIndices: VertexIndices;
|
|
18
|
+
/** If any silhouettes are present, the [OctEncodedNormalPair]($common)s associated with each. */
|
|
19
|
+
normalPairs?: Uint32Array;
|
|
20
|
+
/** The maximum width or height for the resultant [[EdgeTable]]. */
|
|
21
|
+
maxEdgeTableDimension: number;
|
|
22
|
+
}
|
|
23
|
+
/** Convert an [[ImdlCompactEdges]] to an [[IndexedEdgeParams]].
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function indexedEdgeParamsFromCompactEdges(compact: CompactEdgeParams): ImdlModel.IndexedEdgeParams | undefined;
|
|
27
|
+
//# sourceMappingURL=CompactEdges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactEdges.d.ts","sourceRoot":"","sources":["../../../../src/common/imdl/CompactEdges.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,sIAAsI;IACtI,UAAU,EAAE,UAAU,CAAC;IACvB,gEAAgE;IAChE,aAAa,EAAE,aAAa,CAAC;IAC7B,iGAAiG;IACjG,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,mEAAmE;IACnE,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AA+CD;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,GAAI,SAAS,CA6CtH"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Tiles
|
|
7
|
+
*/
|
|
8
|
+
import { assert } from "@itwin/core-bentley";
|
|
9
|
+
import { ImdlEdgeVisibility } from "./ImdlSchema";
|
|
10
|
+
import { calculateEdgeTableParams } from "../render/primitives/EdgeParams";
|
|
11
|
+
import { VertexIndices } from "../render/primitives/VertexIndices";
|
|
12
|
+
/** Iterate over the compact edges.
|
|
13
|
+
* @note The same object is returned on each iteration, mutated in place.
|
|
14
|
+
*/
|
|
15
|
+
function* compactEdgeIterator(visibilityFlags, vertexIndices, normalPairs) {
|
|
16
|
+
let bitIndex = 0;
|
|
17
|
+
let flagsIndex = 0;
|
|
18
|
+
let normalIndex = 0;
|
|
19
|
+
const output = { index0: 0, index1: 1 };
|
|
20
|
+
for (let i = 0; i < vertexIndices.length; i++) {
|
|
21
|
+
const visibility = (visibilityFlags[flagsIndex] >> bitIndex) & 3;
|
|
22
|
+
bitIndex += 2;
|
|
23
|
+
if (bitIndex === 8) {
|
|
24
|
+
bitIndex = 0;
|
|
25
|
+
flagsIndex++;
|
|
26
|
+
}
|
|
27
|
+
if (ImdlEdgeVisibility.Hidden === visibility)
|
|
28
|
+
continue;
|
|
29
|
+
output.index0 = vertexIndices.decodeIndex(i);
|
|
30
|
+
output.index1 = vertexIndices.decodeIndex(i % 3 === 2 ? i - 2 : i + 1);
|
|
31
|
+
if (ImdlEdgeVisibility.Silhouette === visibility) {
|
|
32
|
+
assert(undefined !== normalPairs);
|
|
33
|
+
output.normals = normalPairs[normalIndex++];
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
output.normals = undefined;
|
|
37
|
+
}
|
|
38
|
+
yield output;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function setUint24(edgeTable, byteIndex, value) {
|
|
42
|
+
edgeTable[byteIndex + 0] = value & 0x0000ff;
|
|
43
|
+
edgeTable[byteIndex + 1] = (value & 0x00ff00) >>> 8;
|
|
44
|
+
edgeTable[byteIndex + 2] = (value & 0xff0000) >>> 16;
|
|
45
|
+
}
|
|
46
|
+
/** Convert an [[ImdlCompactEdges]] to an [[IndexedEdgeParams]].
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export function indexedEdgeParamsFromCompactEdges(compact) {
|
|
50
|
+
const numSilhouettes = compact.normalPairs?.length ?? 0;
|
|
51
|
+
const numTotalEdges = compact.numVisibleEdges + numSilhouettes;
|
|
52
|
+
if (numTotalEdges <= 0)
|
|
53
|
+
return undefined;
|
|
54
|
+
// Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.
|
|
55
|
+
const indices = new VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));
|
|
56
|
+
for (let i = 0; i < numTotalEdges; i++)
|
|
57
|
+
for (let j = 0; j < 6; j++)
|
|
58
|
+
indices.setNthIndex(i * 6 + j, i);
|
|
59
|
+
const { width, height, silhouettePadding, silhouetteStartByteIndex } = calculateEdgeTableParams(compact.numVisibleEdges, numSilhouettes, compact.maxEdgeTableDimension);
|
|
60
|
+
const edgeTable = new Uint8Array(width * height * 4);
|
|
61
|
+
let curVisibleIndex = 0;
|
|
62
|
+
let curSilhouetteIndex = 0;
|
|
63
|
+
for (const edge of compactEdgeIterator(compact.visibility, compact.vertexIndices, compact.normalPairs)) {
|
|
64
|
+
if (undefined === edge.normals) {
|
|
65
|
+
const index = curVisibleIndex++;
|
|
66
|
+
const byteIndex = index * 6;
|
|
67
|
+
setUint24(edgeTable, byteIndex, edge.index0);
|
|
68
|
+
setUint24(edgeTable, byteIndex + 3, edge.index1);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const index = curSilhouetteIndex++;
|
|
72
|
+
const byteIndex = silhouetteStartByteIndex + silhouettePadding + index * 10;
|
|
73
|
+
setUint24(edgeTable, byteIndex, edge.index0);
|
|
74
|
+
setUint24(edgeTable, byteIndex + 3, edge.index1);
|
|
75
|
+
edgeTable[byteIndex + 6] = edge.normals & 0xff;
|
|
76
|
+
edgeTable[byteIndex + 7] = (edge.normals & 0xff00) >>> 8;
|
|
77
|
+
edgeTable[byteIndex + 8] = (edge.normals & 0xff0000) >>> 16;
|
|
78
|
+
edgeTable[byteIndex + 9] = (edge.normals & 0xff000000) >>> 24;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
indices: indices.data,
|
|
83
|
+
edges: {
|
|
84
|
+
data: edgeTable,
|
|
85
|
+
width,
|
|
86
|
+
height,
|
|
87
|
+
numSegments: compact.numVisibleEdges,
|
|
88
|
+
silhouettePadding,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=CompactEdges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactEdges.js","sourceRoot":"","sources":["../../../../src/common/imdl/CompactEdges.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AA0BnE;;GAEG;AACH,QAAS,CAAC,CAAC,mBAAmB,CAAC,eAA2B,EAAE,aAA4B,EAAE,WAAoC;IAC5H,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,WAAW,GAAG,CAAC,CAAC;IAEpB,MAAM,MAAM,GAAgB,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,UAAU,GAAG,CAAC,eAAe,CAA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kB,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,wBAAwB,GAAG,iBAAiB,GAAG,KAAK,GAAG,EAAE,CAAC;YAC5E,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7C,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACjD,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YAC/C,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;YAC5D,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;SAC/D;KACF;IAED,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,KAAK;YACL,MAAM;YACN,WAAW,EAAE,OAAO,CAAC,eAAe;YACpC,iBAAiB;SAClB;KACF,CAAC;AACJ,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 Tiles\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { ImdlEdgeVisibility } from \"./ImdlSchema\";\r\nimport { ImdlModel } from \"./ImdlModel\";\r\nimport { calculateEdgeTableParams } from \"../render/primitives/EdgeParams\";\r\nimport { VertexIndices } from \"../render/primitives/VertexIndices\";\r\n\r\n/** Parameters supplied to [[indexedEdgeParamsFromCompactEdges]].\r\n * @internal\r\n */\r\nexport interface CompactEdgeParams {\r\n /** The number of always-visible edges.\r\n * @note The number of silhouette edges is the same as the number of [[normalPairs]].\r\n */\r\n numVisibleEdges: number;\r\n /** 2 bit visibility of each edge to the next edge in the triangle, in the same order as the triangle indices in [[vertexIndices]]. */\r\n visibility: Uint8Array;\r\n /** The indices describing the topology of the triangle mesh. */\r\n vertexIndices: VertexIndices;\r\n /** If any silhouettes are present, the [OctEncodedNormalPair]($common)s associated with each. */\r\n normalPairs?: Uint32Array;\r\n /** The maximum width or height for the resultant [[EdgeTable]]. */\r\n maxEdgeTableDimension: number;\r\n}\r\n\r\ninterface CompactEdge {\r\n index0: number;\r\n index1: number;\r\n normals?: number;\r\n}\r\n\r\n/** Iterate over the compact edges.\r\n * @note The same object is returned on each iteration, mutated in place.\r\n */\r\nfunction * compactEdgeIterator(visibilityFlags: Uint8Array, vertexIndices: VertexIndices, normalPairs: Uint32Array | undefined): IterableIterator<CompactEdge> {\r\n let bitIndex = 0;\r\n let flagsIndex = 0;\r\n let normalIndex = 0;\r\n\r\n const output: CompactEdge = { index0: 0, index1: 1 };\r\n for (let i = 0; i < vertexIndices.length; i++) {\r\n const visibility = (visibilityFlags[flagsIndex] >> bitIndex) & 3;\r\n bitIndex += 2;\r\n if (bitIndex === 8) {\r\n bitIndex = 0;\r\n flagsIndex++;\r\n }\r\n\r\n if (ImdlEdgeVisibility.Hidden === visibility)\r\n continue;\r\n\r\n output.index0 = vertexIndices.decodeIndex(i);\r\n output.index1 = vertexIndices.decodeIndex(i % 3 === 2 ? i - 2 : i + 1);\r\n if (ImdlEdgeVisibility.Silhouette === visibility) {\r\n assert(undefined !== normalPairs);\r\n output.normals = normalPairs[normalIndex++];\r\n } else {\r\n output.normals = undefined;\r\n }\r\n\r\n yield output;\r\n }\r\n}\r\n\r\nfunction setUint24(edgeTable: Uint8Array, byteIndex: number, value: number): void {\r\n edgeTable[byteIndex + 0] = value & 0x0000ff;\r\n edgeTable[byteIndex + 1] = (value & 0x00ff00) >>> 8;\r\n edgeTable[byteIndex + 2] = (value & 0xff0000) >>> 16;\r\n}\r\n\r\n/** Convert an [[ImdlCompactEdges]] to an [[IndexedEdgeParams]].\r\n * @internal\r\n */\r\nexport function indexedEdgeParamsFromCompactEdges(compact: CompactEdgeParams): ImdlModel.IndexedEdgeParams | undefined {\r\n const numSilhouettes = compact.normalPairs?.length ?? 0;\r\n const numTotalEdges = compact.numVisibleEdges + numSilhouettes;\r\n if (numTotalEdges <= 0)\r\n return undefined;\r\n\r\n // Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.\r\n const indices = new VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));\r\n for (let i = 0; i < numTotalEdges; i++)\r\n for (let j = 0; j < 6; j++)\r\n indices.setNthIndex(i * 6 + j, i);\r\n\r\n const {width, height, silhouettePadding, silhouetteStartByteIndex} = calculateEdgeTableParams(compact.numVisibleEdges, numSilhouettes, compact.maxEdgeTableDimension);\r\n const edgeTable = new Uint8Array(width * height * 4);\r\n\r\n let curVisibleIndex = 0;\r\n let curSilhouetteIndex = 0;\r\n for (const edge of compactEdgeIterator(compact.visibility, compact.vertexIndices, compact.normalPairs)) {\r\n if (undefined === edge.normals) {\r\n const index = curVisibleIndex++;\r\n const byteIndex = index * 6;\r\n setUint24(edgeTable, byteIndex, edge.index0);\r\n setUint24(edgeTable, byteIndex + 3, edge.index1);\r\n } else {\r\n const index = curSilhouetteIndex++;\r\n const byteIndex = silhouetteStartByteIndex + silhouettePadding + index * 10;\r\n setUint24(edgeTable, byteIndex, edge.index0);\r\n setUint24(edgeTable, byteIndex + 3, edge.index1);\r\n edgeTable[byteIndex + 6] = edge.normals & 0xff;\r\n edgeTable[byteIndex + 7] = (edge.normals & 0xff00) >>> 8;\r\n edgeTable[byteIndex + 8] = (edge.normals & 0xff0000) >>> 16;\r\n edgeTable[byteIndex + 9] = (edge.normals & 0xff000000) >>> 24;\r\n }\r\n }\r\n\r\n return {\r\n indices: indices.data,\r\n edges: {\r\n data: edgeTable,\r\n width,\r\n height,\r\n numSegments: compact.numVisibleEdges,\r\n silhouettePadding,\r\n },\r\n };\r\n}\r\n"]}
|
|
@@ -210,20 +210,52 @@ export interface ImdlIndexedEdges {
|
|
|
210
210
|
/** The number of bytes inserted for alignment between the lower and upper partitions of the lookup table. @see [[IndexedEdgeParams.silhouettePadding]]. */
|
|
211
211
|
readonly silhouettePadding: number;
|
|
212
212
|
}
|
|
213
|
+
/** As part of [[ImdlCompactEdges]], describes the visibility of an edge of a triangle.
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
216
|
+
export declare enum ImdlEdgeVisibility {
|
|
217
|
+
/** The edge is never visible. */
|
|
218
|
+
Hidden = 0,
|
|
219
|
+
/** 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. */
|
|
220
|
+
Silhouette = 1,
|
|
221
|
+
/** The edge is always visible. */
|
|
222
|
+
Visible = 2
|
|
223
|
+
}
|
|
224
|
+
/** A more compact representation of [[ImdlIndexedEdges]]. For each vertex index in the mesh, it encodes 2 bits indicating the visibility of the edge between
|
|
225
|
+
* 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
|
|
226
|
+
* with [[ImdlEdgeVisibility.Silhouette]] in the visibility buffer.
|
|
227
|
+
* This information is used to construct the edge table that would otherwise be described more verbosely by [[ImdlIndexedEdges]].
|
|
228
|
+
* @see [[CompactEdgeParams]].
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
export interface ImdlCompactEdges {
|
|
232
|
+
/** Id of the [[ImdlBufferView]] containing the [[ImdlEdgeVisibility]] of each edge of each triangle in the mesh.
|
|
233
|
+
* The order of the edges in the buffer is the same as the order of the corresponding [[ImdlSurface.indices]].
|
|
234
|
+
* 2 bits are allocated per edge.
|
|
235
|
+
*/
|
|
236
|
+
readonly visibility: string;
|
|
237
|
+
/** Id of the [[ImdlBufferView]] containing the [OctEncodedNormalPair]($common)s of each silhouette edge in [[visibility]].
|
|
238
|
+
* Each pair is represented as a 32-bit unsigned integer - `normal1 | (normal2 << 16)`.
|
|
239
|
+
* If no silhouettes are present, this property will be `undefined`.
|
|
240
|
+
*/
|
|
241
|
+
readonly normalPairs?: string;
|
|
242
|
+
/** The number of edges with [[ImdlVisibility.Visible]].
|
|
243
|
+
* @note The number of edges with [[ImdlVisibility.Silhouette]] is implicit in the number of [[normalPairs]].
|
|
244
|
+
*/
|
|
245
|
+
readonly numVisible: number;
|
|
246
|
+
}
|
|
213
247
|
/** Describes the edges of an [[ImdlMeshPrimitive]].
|
|
214
248
|
* @internal
|
|
215
249
|
*/
|
|
216
250
|
export interface ImdlMeshEdges {
|
|
217
|
-
/** @see [[ImdlSegmentEdges]]. */
|
|
218
251
|
readonly segments?: ImdlSegmentEdges;
|
|
219
|
-
/** @see [[ImdlSilhouetteEdges]]. */
|
|
220
252
|
readonly silhouettes?: ImdlSilhouetteEdges;
|
|
221
253
|
/** Line strings with additional joint triangles inserted to produce wide edges with rounded corners.
|
|
222
254
|
* Typically only produced for 2d views.
|
|
223
255
|
*/
|
|
224
|
-
readonly polylines?: ImdlPolyline;
|
|
225
|
-
/** @see [[ImdlIndexedEdges]]. */
|
|
226
256
|
readonly indexed?: ImdlIndexedEdges;
|
|
257
|
+
readonly compact?: ImdlCompactEdges;
|
|
258
|
+
readonly polylines?: ImdlPolyline;
|
|
227
259
|
}
|
|
228
260
|
/** Describes a collection of line strings with additional joint triangles inserted to produce wide line strings with rounded corners.
|
|
229
261
|
* @see [[TesselatedPolyline]] and [[PolylineParams]].
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImdlSchema.d.ts","sourceRoot":"","sources":["../../../../src/common/imdl/ImdlSchema.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO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IAC9K,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,2GAA2G;IAC3G,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,MAAM,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,2EAA2E;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"}
|
|
@@ -5,5 +5,16 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Tiles
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/** As part of [[ImdlCompactEdges]], describes the visibility of an edge of a triangle.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export var ImdlEdgeVisibility;
|
|
12
|
+
(function (ImdlEdgeVisibility) {
|
|
13
|
+
/** The edge is never visible. */
|
|
14
|
+
ImdlEdgeVisibility[ImdlEdgeVisibility["Hidden"] = 0] = "Hidden";
|
|
15
|
+
/** 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. */
|
|
16
|
+
ImdlEdgeVisibility[ImdlEdgeVisibility["Silhouette"] = 1] = "Silhouette";
|
|
17
|
+
/** The edge is always visible. */
|
|
18
|
+
ImdlEdgeVisibility[ImdlEdgeVisibility["Visible"] = 2] = "Visible";
|
|
19
|
+
})(ImdlEdgeVisibility || (ImdlEdgeVisibility = {}));
|
|
9
20
|
//# sourceMappingURL=ImdlSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImdlSchema.js","sourceRoot":"","sources":["../../../../src/common/imdl/ImdlSchema.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 \"../render/primitives/AuxChannelTable\";\r\nimport { DisplayParams } from \"../render/primitives/DisplayParams\";\r\nimport { MeshPrimitiveType } from \"../render/primitives/MeshPrimitive\";\r\nimport { SurfaceType } from \"../render/primitives/SurfaceParams\";\r\n\r\n/* eslint-disable no-restricted-syntax */\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/** Describes the edges of an [[ImdlMeshPrimitive]].\r\n * @internal\r\n */\r\nexport interface ImdlMeshEdges {\r\n /** @see [[ImdlSegmentEdges]]. */\r\n readonly segments?: ImdlSegmentEdges;\r\n /** @see [[ImdlSilhouetteEdges]]. */\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 polylines?: ImdlPolyline;\r\n /** @see [[ImdlIndexedEdges]]. */\r\n readonly indexed?: ImdlIndexedEdges;\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 \"../render/primitives/AuxChannelTable\";\r\nimport { DisplayParams } from \"../render/primitives/DisplayParams\";\r\nimport { MeshPrimitiveType } from \"../render/primitives/MeshPrimitive\";\r\nimport { SurfaceType } from \"../render/primitives/SurfaceParams\";\r\n\r\n/* eslint-disable no-restricted-syntax */\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParseImdlDocument.d.ts","sourceRoot":"","sources":["../../../../src/common/imdl/ParseImdlDocument.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAsB,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AAE9F,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,iCAAiC,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,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,EAAsB,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AAE9F,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,iCAAiC,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,UAAU,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;CACpC;AAoDD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;AAuG7E,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,GAAG,WAAW,CAOjE;AAWD,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,UAAU,CAqBpE;AAs2BD,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,qBAAqB,GAAG,cAAc,CAkBhF;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,GAAG,kBAAkB,CAOrH;AAED,gBAAgB;AAChB,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc,CAyDhG"}
|
|
@@ -15,6 +15,7 @@ import { AuxChannelTable } from "../render/primitives/AuxChannelTable";
|
|
|
15
15
|
import { splitMeshParams, splitPointStringParams, splitPolylineParams } from "../render/primitives/VertexTableSplitter";
|
|
16
16
|
import { AnimationNodeId } from "../render/AnimationNodeId";
|
|
17
17
|
import { VertexIndices } from "../render/primitives/VertexIndices";
|
|
18
|
+
import { indexedEdgeParamsFromCompactEdges } from "./CompactEdges";
|
|
18
19
|
/** Header preceding "glTF" data in iMdl tile. */
|
|
19
20
|
class GltfHeader extends TileHeader {
|
|
20
21
|
get isValid() { return TileFormat.Gltf === this.format; }
|
|
@@ -517,13 +518,28 @@ class Parser {
|
|
|
517
518
|
},
|
|
518
519
|
};
|
|
519
520
|
}
|
|
520
|
-
|
|
521
|
+
parseCompactEdges(imdl, vertexIndices) {
|
|
522
|
+
const visibility = this.findBuffer(imdl.visibility);
|
|
523
|
+
if (!visibility)
|
|
524
|
+
return undefined;
|
|
525
|
+
const normals = undefined !== imdl.normalPairs ? this.findBuffer(imdl.normalPairs) : undefined;
|
|
526
|
+
return indexedEdgeParamsFromCompactEdges({
|
|
527
|
+
numVisibleEdges: imdl.numVisible,
|
|
528
|
+
visibility,
|
|
529
|
+
vertexIndices,
|
|
530
|
+
normalPairs: normals ? new Uint32Array(normals.buffer, normals.byteOffset, normals.byteLength / 4) : undefined,
|
|
531
|
+
maxEdgeTableDimension: this._options.maxVertexTableSize,
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
parseEdges(imdl, displayParams, indices) {
|
|
521
535
|
if (!imdl)
|
|
522
536
|
return undefined;
|
|
523
537
|
const segments = imdl.segments ? this.parseSegmentEdges(imdl.segments) : undefined;
|
|
524
538
|
const silhouettes = imdl.silhouettes ? this.parseSilhouetteEdges(imdl.silhouettes) : undefined;
|
|
525
|
-
const indexed = imdl.indexed ? this.parseIndexedEdges(imdl.indexed) : undefined;
|
|
526
539
|
const polylines = imdl.polylines ? this.parseTesselatedPolyline(imdl.polylines) : undefined;
|
|
540
|
+
let indexed = imdl.indexed ? this.parseIndexedEdges(imdl.indexed) : undefined;
|
|
541
|
+
if (!indexed && imdl.compact)
|
|
542
|
+
indexed = this.parseCompactEdges(imdl.compact, new VertexIndices(indices));
|
|
527
543
|
if (!segments && !silhouettes && !indexed && !polylines)
|
|
528
544
|
return undefined;
|
|
529
545
|
return {
|
|
@@ -610,7 +626,7 @@ class Parser {
|
|
|
610
626
|
surface,
|
|
611
627
|
isPlanar,
|
|
612
628
|
auxChannels: this.parseAuxChannelTable(docPrimitive),
|
|
613
|
-
edges: this.parseEdges(docPrimitive.edges, displayParams),
|
|
629
|
+
edges: this.parseEdges(docPrimitive.edges, displayParams, surface.indices),
|
|
614
630
|
},
|
|
615
631
|
};
|
|
616
632
|
}
|