@itwin/core-frontend 4.0.0-dev.86 → 4.0.0-dev.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- package/lib/cjs/IModeljs-css.d.ts +2 -2
- package/lib/cjs/IModeljs-css.d.ts.map +1 -1
- package/lib/cjs/IModeljs-css.js +3 -3
- package/lib/cjs/IModeljs-css.js.map +1 -1
- package/lib/cjs/render/RenderMaterial.d.ts +8 -0
- package/lib/cjs/render/RenderMaterial.d.ts.map +1 -1
- package/lib/cjs/render/RenderMaterial.js.map +1 -1
- package/lib/cjs/render/webgl/System.d.ts.map +1 -1
- package/lib/cjs/render/webgl/System.js +2 -0
- package/lib/cjs/render/webgl/System.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.d.ts +14 -0
- package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
- package/lib/cjs/tile/ImdlReader.js +23 -1
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/RealityTileTree.js +1 -1
- package/lib/cjs/tile/RealityTileTree.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +2 -2
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +4 -2
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.d.ts +4 -0
- package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.js +4 -0
- package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
- package/lib/cjs/tile/TileTree.js +1 -1
- package/lib/cjs/tile/TileTree.js.map +1 -1
- package/lib/esm/IModeljs-css.d.ts +2 -2
- package/lib/esm/IModeljs-css.d.ts.map +1 -1
- package/lib/esm/IModeljs-css.js +3 -3
- package/lib/esm/IModeljs-css.js.map +1 -1
- package/lib/esm/render/RenderMaterial.d.ts +8 -0
- package/lib/esm/render/RenderMaterial.d.ts.map +1 -1
- package/lib/esm/render/RenderMaterial.js.map +1 -1
- package/lib/esm/render/webgl/System.d.ts.map +1 -1
- package/lib/esm/render/webgl/System.js +2 -0
- package/lib/esm/render/webgl/System.js.map +1 -1
- package/lib/esm/tile/ImdlReader.d.ts +14 -0
- package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
- package/lib/esm/tile/ImdlReader.js +24 -2
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/RealityTileTree.js +1 -1
- package/lib/esm/tile/RealityTileTree.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +2 -2
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +4 -2
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/TileDrawArgs.d.ts +4 -0
- package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/esm/tile/TileDrawArgs.js +4 -0
- package/lib/esm/tile/TileDrawArgs.js.map +1 -1
- package/lib/esm/tile/TileTree.js +1 -1
- package/lib/esm/tile/TileTree.js.map +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileDrawArgs.js","sourceRoot":"","sources":["../../../src/tile/TileDrawArgs.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAc,QAAQ,EAAS,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAa,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtI,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAiC,MAAM,oBAAoB,CAAC;AAE7G,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAOxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,YAAY,GAAG,IAAI,OAAO,EAAE,CAAC;AACnC,MAAM,YAAY,GAAG,OAAO,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QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,SAAS,KAAK,MAAM;YACtB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,4JAA4J;IACrJ,aAAa,CAAC,IAAU;QAC7B,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,mEAAmE;IAC5D,mBAAmB;QACxB,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC;IACrC,CAAC;IAED,oVAAoV;IAC7U,QAAQ,CAAC,IAAU;QACxB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,IAAU;QACzB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,MAAc,IAAU,CAAC;IAErD,eAAe;IACf,IAAW,4BAA4B,KAAyB,OAAO,SAAS,CAAC,CAAC,CAAC;CACpF","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 { BeTimePoint } from \"@itwin/core-bentley\";\r\nimport { ClipVector, Geometry, Map4d, Matrix4d, Point3d, Point4d, Range1d, Range3d, Transform, Vector3d } from \"@itwin/core-geometry\";\r\nimport { FeatureAppearanceProvider, FrustumPlanes, HiddenLine, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\r\nimport { GraphicBranch } from \"../render/GraphicBranch\";\r\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\r\nimport { RenderGraphic } from \"../render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"../render/RenderPlanarClassifier\";\r\nimport { RenderTextureDrape } from \"../render/RenderSystem\";\r\nimport { SceneContext } from \"../ViewContext\";\r\nimport { ViewingSpace } from \"../ViewingSpace\";\r\nimport { CoordSystem } from \"../CoordSystem\";\r\nimport { Tile, TileGraphicType, TileTree } from \"./internal\";\r\n\r\nconst scratchRange = new Range3d();\r\nconst scratchPoint = Point3d.create();\r\nconst scratchPoint4d = Point4d.create();\r\nconst scratchXRange = Range1d.createNull();\r\nconst scratchYRange = Range1d.createNull();\r\nconst scratchMatrix4d = Matrix4d.createIdentity();\r\n\r\n/** Parameters used to construct [[TileDrawArgs]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TileDrawArgParams {\r\n /** Context for the scene into which the tiles are to be rendered. */\r\n context: SceneContext;\r\n /** Transform to be applied when drawing the tiles. */\r\n location: Transform;\r\n /** The tile tree from which to obtain tiles. */\r\n tree: TileTree;\r\n /** The time at which these args were created. */\r\n now: BeTimePoint;\r\n /** Overrides to apply to the view's [ViewFlags]($common) when drawing the tiles. */\r\n viewFlagOverrides: ViewFlagOverrides;\r\n /** Clip volume used to clip the tiles. */\r\n clipVolume?: RenderClipVolume;\r\n /** True if a tile and its child tiles should not be drawn simultaneously. */\r\n parentsAndChildrenExclusive: boolean;\r\n /** Symbology overrides to apply to the tiles. */\r\n symbologyOverrides: FeatureSymbology.Overrides | undefined;\r\n /** Optionally customizes the view's symbology overrides for the tiles. */\r\n appearanceProvider?: FeatureAppearanceProvider;\r\n /** Optionally overrides the view's hidden line settings. */\r\n hiddenLineSettings?: HiddenLine.Settings;\r\n /** If defined, tiles should be culled if they do not intersect this clip. */\r\n intersectionClip?: ClipVector;\r\n /** If defined, the Id of a node in the scene's [RenderSchedule.Script]($common) that applies a transform to the graphics;\r\n * or \"0xffffffff\" for any node that does *not* apply a transform.\r\n * @internal\r\n */\r\n animationTransformNodeId?: number;\r\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\r\n boundingRange?: Range3d;\r\n /** @alpha */\r\n maximumScreenSpaceError?: number;\r\n}\r\n\r\n/**\r\n * Provides context used when selecting and drawing [[Tile]]s.\r\n * @see [[TileTree.selectTiles]]\r\n * @see [[TileTree.draw]]\r\n * @public\r\n * @extensions\r\n */\r\nexport class TileDrawArgs {\r\n /** Transform to the location in iModel coordinates at which the tiles are to be drawn. */\r\n public readonly location: Transform;\r\n /** The tile tree being drawn. */\r\n public readonly tree: TileTree;\r\n /** Optional clip volume applied to the tiles. */\r\n public clipVolume: RenderClipVolume | undefined;\r\n /** The context in which the tiles will be drawn, exposing, e.g., the [[Viewport]] and accepting [[RenderGraphic]]s to be drawn. */\r\n public readonly context: SceneContext;\r\n /** Describes the viewed volume. */\r\n public viewingSpace: ViewingSpace;\r\n /** Holds the tile graphics to be drawn. */\r\n public readonly graphics: GraphicBranch = new GraphicBranch();\r\n /** @internal */\r\n public readonly now: BeTimePoint;\r\n /** The planes of the viewing frustum, used for frustum culling. */\r\n protected _frustumPlanes?: FrustumPlanes;\r\n /** @internal */\r\n public planarClassifier?: RenderPlanarClassifier;\r\n /** @internal */\r\n public drape?: RenderTextureDrape;\r\n /** Optional clip volume applied to all tiles in the view. */\r\n public readonly viewClip?: ClipVector;\r\n /** True if a tile and its child tiles should not be drawn simultaneously. */\r\n public parentsAndChildrenExclusive: boolean;\r\n /** @internal */\r\n private _appearanceProvider?: FeatureAppearanceProvider;\r\n /** Optional overrides for the view's hidden line settings. */\r\n public hiddenLineSettings?: HiddenLine.Settings;\r\n /** Tiles that we want to draw and that are ready to draw. May not actually be selected, e.g. if sibling tiles are not yet ready. */\r\n public readonly readyTiles = new Set<Tile>();\r\n /** For perspective views, the view-Z of the near plane. */\r\n private readonly _nearFrontCenter?: Point3d;\r\n /** Overrides applied to the view's [ViewFlags]($common) when drawing the tiles. */\r\n public get viewFlagOverrides(): ViewFlagOverrides { return this.graphics.viewFlagOverrides; }\r\n /** If defined, replaces the view's own symbology overrides when drawing the tiles. */\r\n public get symbologyOverrides(): FeatureSymbology.Overrides | undefined { return this.graphics.symbologyOverrides; }\r\n /** If defined, tiles will be culled if they do not intersect this clip. */\r\n public intersectionClip?: ClipVector;\r\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\r\n public boundingRange?: Range3d;\r\n /** @internal */\r\n public readonly pixelSizeScaleFactor;\r\n /** @internal */\r\n public readonly animationTransformNodeId?: number;\r\n /** @alpha */\r\n public maximumScreenSpaceError;\r\n\r\n /** Compute the size in pixels of the specified tile at the point on its bounding sphere closest to the camera. */\r\n public getPixelSize(tile: Tile): number {\r\n const sizeFromProjection = this.getPixelSizeFromProjection(tile);\r\n if (undefined !== sizeFromProjection)\r\n return sizeFromProjection;\r\n\r\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\r\n const center = this.getTileCenter(tile);\r\n\r\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\r\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(radius / pixelSizeAtPt) : 1.0e-3;\r\n }\r\n\r\n /** If the tile provides corners (from an OBB) then this produces most accurate representation of the tile size */\r\n private getPixelSizeFromProjection(tile: Tile): number | undefined {\r\n const sizeProjectionCorners = tile.getSizeProjectionCorners();\r\n if (!sizeProjectionCorners)\r\n return undefined;\r\n\r\n /* For maps or global reality models we use the projected screen rectangle rather than sphere to calculate pixel size to avoid excessive tiles at horizon. */\r\n const tileToView = this.worldToViewMap.transform0.multiplyMatrixMatrix(Matrix4d.createTransform(this.location, scratchMatrix4d), scratchMatrix4d);\r\n scratchXRange.setNull();\r\n scratchYRange.setNull();\r\n\r\n let behindEye = false;\r\n for (const corner of sizeProjectionCorners) {\r\n const viewCorner = tileToView.multiplyPoint3d(corner, 1, scratchPoint4d);\r\n if (viewCorner.w < 0.0) {\r\n behindEye = true;\r\n break;\r\n }\r\n\r\n scratchXRange.extendX(viewCorner.x / viewCorner.w);\r\n scratchYRange.extendX(viewCorner.y / viewCorner.w);\r\n }\r\n if (behindEye)\r\n return undefined;\r\n\r\n return scratchXRange.isNull ? 1.0E-3 : this.context.adjustPixelSizeForLOD(Math.sqrt(scratchXRange.length() * scratchYRange.length()));\r\n }\r\n\r\n /** Compute the size in meters of one pixel at the point on the tile's bounding sphere closest to the camera. */\r\n public getPixelSizeInMetersAtClosestPoint(tile: Tile): number {\r\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\r\n const center = this.getTileCenter(tile);\r\n\r\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\r\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(pixelSizeAtPt) : 1.0e-3;\r\n }\r\n\r\n /** Compute the size in meters of one pixel at the point on a sphere closest to the camera.\r\n * Device scaling is not applied.\r\n */\r\n public computePixelSizeInMetersAtClosestPoint(center: Point3d, radius: number): number {\r\n if (this.context.viewport.view.is3d() && this.context.viewport.isCameraOn && this._nearFrontCenter) {\r\n const toFront = Vector3d.createStartEnd(center, this._nearFrontCenter);\r\n const viewZ = this.context.viewport.rotation.rowZ();\r\n // If the sphere overlaps the near front plane just use near front point. This also handles behind eye conditions.\r\n if (viewZ.dotProduct(toFront) < radius) {\r\n center = this._nearFrontCenter;\r\n } else {\r\n // Find point on sphere closest to eye.\r\n const toEye = center.unitVectorTo(this.context.viewport.view.camera.eye);\r\n\r\n if (toEye) { // Only if tile is not already behind the eye.\r\n toEye.scaleInPlace(radius);\r\n center.addInPlace(toEye);\r\n }\r\n }\r\n }\r\n\r\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\r\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\r\n return this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\r\n }\r\n\r\n /** Compute this size of a sphere on screen in pixels */\r\n public getRangePixelSize(range: Range3d): number {\r\n const transformedRange = this.location.multiplyRange(range, scratchRange);\r\n const center = transformedRange.localXYZToWorld(.5, .5, .5, scratchPoint)!;\r\n const radius = transformedRange.diagonal().magnitude();\r\n\r\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\r\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\r\n const pixelSizeAtPt = this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\r\n return 0 !== pixelSizeAtPt ? radius / pixelSizeAtPt : 1.0e-3;\r\n }\r\n\r\n /** @internal */\r\n public getTileGraphics(tile: Tile) {\r\n return tile.produceGraphics();\r\n }\r\n\r\n /** The planes of the viewing frustum, used for frustum culling. */\r\n public get frustumPlanes(): FrustumPlanes {\r\n return this._frustumPlanes !== undefined ? this._frustumPlanes : this.context.frustumPlanes;\r\n }\r\n\r\n /** Provides conversions between [[CoordSystem.World]] and [[CoordSystem.View]]. */\r\n public get worldToViewMap(): Map4d {\r\n return this.viewingSpace.worldToViewMap;\r\n }\r\n\r\n private computePixelSizeScaleFactor(): number {\r\n // Check to see if a model display transform with non-uniform scaling is being used.\r\n const mat = this.context.viewport.view.modelDisplayTransformProvider?.getModelDisplayTransform(this.tree.modelId)?.matrix;\r\n if (!mat)\r\n return 1;\r\n\r\n const scale = [0, 1, 2].map((x) => mat.getColumn(x).magnitude());\r\n if (Math.abs(scale[0] - scale[1]) <= Geometry.smallMetricDistance && Math.abs(scale[0] - scale[2]) <= Geometry.smallMetricDistance)\r\n return 1;\r\n\r\n // If the component with the largest scale is not the same as the component with the largest tile range use it to adjust the pixel size.\r\n const rangeDiag = this.tree.range.diagonal();\r\n let maxS = 0;\r\n let maxR = 0;\r\n if (scale[0] > scale[1])\r\n maxS = (scale[0] > scale[2] ? 0 : 2);\r\n else\r\n maxS = (scale[1] > scale[2] ? 1 : 2);\r\n\r\n if (rangeDiag.x > rangeDiag.y)\r\n maxR = (rangeDiag.x > rangeDiag.z ? 0 : 2);\r\n else\r\n maxR = (rangeDiag.y > rangeDiag.z ? 1 : 2);\r\n\r\n return maxS !== maxR ? scale[maxS] : 1;\r\n }\r\n\r\n /** Constructor */\r\n public constructor(params: TileDrawArgParams) {\r\n const { location, tree, context, now, viewFlagOverrides, clipVolume, parentsAndChildrenExclusive, symbologyOverrides } = params;\r\n this.location = location;\r\n this.tree = tree;\r\n this.context = context;\r\n this.now = now;\r\n this._appearanceProvider = params.appearanceProvider;\r\n this.hiddenLineSettings = params.hiddenLineSettings;\r\n this.animationTransformNodeId = params.animationTransformNodeId;\r\n this.boundingRange = params.boundingRange;\r\n this.maximumScreenSpaceError = params.maximumScreenSpaceError ?? 16; // 16 is Cesium's default.\r\n\r\n // Do not cull tiles based on clip volume if tiles outside clip are supposed to be drawn but in a different color.\r\n if (undefined !== clipVolume && !context.viewport.view.displayStyle.settings.clipStyle.outsideColor)\r\n this.clipVolume = clipVolume;\r\n\r\n this.graphics.setViewFlagOverrides(viewFlagOverrides);\r\n this.graphics.symbologyOverrides = symbologyOverrides;\r\n this.graphics.animationId = tree.modelId;\r\n\r\n this.viewingSpace = context.viewingSpace;\r\n this._frustumPlanes = FrustumPlanes.fromFrustum(this.viewingSpace.getFrustum());\r\n\r\n this.planarClassifier = context.getPlanarClassifierForModel(tree.modelId);\r\n this.drape = context.getTextureDrapeForModel(tree.modelId);\r\n\r\n // NB: If the tile tree has its own clip, do not also apply the view's clip.\r\n if (context.viewFlags.clipVolume && false !== viewFlagOverrides.clipVolume && undefined === clipVolume) {\r\n const outsideClipColor = context.viewport.displayStyle.settings.clipStyle.outsideColor;\r\n this.viewClip = undefined === outsideClipColor ? context.viewport.view.getViewClip() : undefined;\r\n }\r\n\r\n this.parentsAndChildrenExclusive = parentsAndChildrenExclusive;\r\n if (context.viewport.isCameraOn)\r\n this._nearFrontCenter = context.viewport.getFrustum(CoordSystem.World).frontCenter;\r\n\r\n this.pixelSizeScaleFactor = this.computePixelSizeScaleFactor();\r\n }\r\n\r\n /** A multiplier applied to a [[Tile]]'s `maximumSize` property to adjust level of detail.\r\n * @see [[Viewport.tileSizeModifier]].\r\n * @public\r\n */\r\n public get tileSizeModifier(): number { return this.context.viewport.tileSizeModifier; }\r\n\r\n /** @internal */\r\n public getTileCenter(tile: Tile): Point3d { return this.location.multiplyPoint3d(tile.center); }\r\n\r\n /** @internal */\r\n public getTileRadius(tile: Tile): number {\r\n let range: Range3d = tile.range.clone(scratchRange);\r\n if (tile.tree.is2d) {\r\n // 2d tiles have a fixed Z range of [-1, 1]. Sometimes (e.g., hypermodeling) we draw them within a 3d view. Prevent Z from artificially expanding the radius.\r\n range.low.z = range.high.z = 0;\r\n }\r\n\r\n range = this.location.multiplyRange(range, range);\r\n return 0.5 * range.low.distance(range.high);\r\n }\r\n\r\n /** @internal */\r\n public get clip(): ClipVector | undefined {\r\n return undefined !== this.clipVolume ? this.clipVolume.clipVector : undefined;\r\n }\r\n\r\n /** Add a provider to supplement or override the symbology overrides for the view.\r\n * @note If a provider already exists, the new provider will be chained such that it sees the base overrides\r\n * after they have potentially been modified by the existing provider.\r\n * @public\r\n */\r\n public addAppearanceProvider(provider: FeatureAppearanceProvider): void {\r\n this._appearanceProvider = this._appearanceProvider ? FeatureAppearanceProvider.chain(this._appearanceProvider, provider) : provider;\r\n }\r\n\r\n /** Optionally customizes aspects of the view's [[FeatureSymbology.Overrides]]. */\r\n public get appearanceProvider(): FeatureAppearanceProvider | undefined {\r\n return this._appearanceProvider;\r\n }\r\n\r\n /** @internal */\r\n public produceGraphics(): RenderGraphic | undefined {\r\n return this._produceGraphicBranch(this.graphics);\r\n }\r\n /** @internal */\r\n public get secondaryClassifiers(): Map<number, RenderPlanarClassifier>| undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n private _produceGraphicBranch(graphics: GraphicBranch): RenderGraphic | undefined {\r\n if (graphics.isEmpty)\r\n return undefined;\r\n\r\n const opts = {\r\n iModel: this.tree.iModel,\r\n clipVolume: this.clipVolume,\r\n classifierOrDrape: this.planarClassifier ?? this.drape,\r\n appearanceProvider: this.appearanceProvider,\r\n hline: this.hiddenLineSettings,\r\n secondaryClassifiers: this.secondaryClassifiers,\r\n };\r\n\r\n let graphic = this.context.createGraphicBranch(graphics, this.location, opts);\r\n if (undefined !== this.animationTransformNodeId)\r\n graphic = this.context.renderSystem.createAnimationTransformNode(graphic, this.animationTransformNodeId);\r\n\r\n return graphic;\r\n }\r\n\r\n /** Output graphics for all accumulated tiles. */\r\n public drawGraphics(): void {\r\n const graphics = this.produceGraphics();\r\n if (undefined !== graphics)\r\n this.context.outputGraphic(graphics);\r\n }\r\n\r\n /** Output graphics of the specified type for all accumulated tiles. */\r\n public drawGraphicsWithType(graphicType: TileGraphicType, graphics: GraphicBranch): void {\r\n const branch = this._produceGraphicBranch(graphics);\r\n if (undefined !== branch)\r\n this.context.withGraphicType(graphicType, () => this.context.outputGraphic(branch));\r\n }\r\n\r\n /** Indicate that graphics for the specified tile are desired but not yet available. Subsequently a request will be enqueued to load the tile's graphics. */\r\n public insertMissing(tile: Tile): void {\r\n this.context.insertMissingTile(tile);\r\n }\r\n\r\n /** Indicate that some requested child tiles are not yet loaded. */\r\n public markChildrenLoading(): void {\r\n this.context.markChildrenLoading();\r\n }\r\n\r\n /** Indicate that the specified tile is being used for some purpose by the [[SceneContext]]'s [[Viewport]]. Typically \"used\" means \"displayed\", but the exact meaning is up to the [[TileTree]] - for example, \"used\" might also mean that the tile's children are being used. A tile that is \"in use\" by any [[Viewport]] will not be discarded. */\r\n public markUsed(tile: Tile): void {\r\n tile.usageMarker.mark(this.context.viewport, this.now);\r\n }\r\n\r\n /** Indicate that the specified tile should be displayed and that its graphics are ready to be displayed. The number of \"ready\" tiles is used in conjunction with the number of \"missing\" tiles to convey to the user how complete the current view is.\r\n * @see [[insertMissing]]\r\n */\r\n public markReady(tile: Tile): void {\r\n this.readyTiles.add(tile);\r\n }\r\n\r\n /** Invoked by [[TileTree.selectTiles]]. This exists chiefly for [[SolarShadowMap]].\r\n * @internal\r\n */\r\n public processSelectedTiles(_tiles: Tile[]): void { }\r\n\r\n /* @internal */\r\n public get maxRealityTreeSelectionCount(): number | undefined { return undefined; }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TileDrawArgs.js","sourceRoot":"","sources":["../../../src/tile/TileDrawArgs.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAc,QAAQ,EAAS,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAa,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtI,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAiC,MAAM,oBAAoB,CAAC;AAE7G,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAOxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,YAAY,GAAG,IAAI,OAAO,EAAE,CAAC;AACnC,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AACtC,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AACxC,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;AAC3C,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;AAC3C,MAAM,eAAe,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;AAwClD;;;;;;GAMG;AACH,MAAM,OAAO,YAAY;IAqCvB,mFAAmF;IACnF,IAAW,iBAAiB,KAAwB,OAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC7F,sFAAsF;IACt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vC,CAAC;IAED,mEAAmE;IAC5D,mBAAmB;QACxB,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC;IACrC,CAAC;IAED,oVAAoV;IAC7U,QAAQ,CAAC,IAAU;QACxB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,IAAU;QACzB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,MAAc,IAAU,CAAC;IAErD,eAAe;IACf,IAAW,4BAA4B,KAAyB,OAAO,SAAS,CAAC,CAAC,CAAC;CACpF","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 { BeTimePoint } from \"@itwin/core-bentley\";\r\nimport { ClipVector, Geometry, Map4d, Matrix4d, Point3d, Point4d, Range1d, Range3d, Transform, Vector3d } from \"@itwin/core-geometry\";\r\nimport { FeatureAppearanceProvider, FrustumPlanes, HiddenLine, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\r\nimport { GraphicBranch } from \"../render/GraphicBranch\";\r\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\r\nimport { RenderGraphic } from \"../render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"../render/RenderPlanarClassifier\";\r\nimport { RenderTextureDrape } from \"../render/RenderSystem\";\r\nimport { SceneContext } from \"../ViewContext\";\r\nimport { ViewingSpace } from \"../ViewingSpace\";\r\nimport { CoordSystem } from \"../CoordSystem\";\r\nimport { Tile, TileGraphicType, TileTree } from \"./internal\";\r\n\r\nconst scratchRange = new Range3d();\r\nconst scratchPoint = Point3d.create();\r\nconst scratchPoint4d = Point4d.create();\r\nconst scratchXRange = Range1d.createNull();\r\nconst scratchYRange = Range1d.createNull();\r\nconst scratchMatrix4d = Matrix4d.createIdentity();\r\n\r\n/** Parameters used to construct [[TileDrawArgs]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TileDrawArgParams {\r\n /** Context for the scene into which the tiles are to be rendered. */\r\n context: SceneContext;\r\n /** Transform to be applied when drawing the tiles. */\r\n location: Transform;\r\n /** The tile tree from which to obtain tiles. */\r\n tree: TileTree;\r\n /** The time at which these args were created. */\r\n now: BeTimePoint;\r\n /** Overrides to apply to the view's [ViewFlags]($common) when drawing the tiles. */\r\n viewFlagOverrides: ViewFlagOverrides;\r\n /** Clip volume used to clip the tiles. */\r\n clipVolume?: RenderClipVolume;\r\n /** True if a tile and its child tiles should not be drawn simultaneously. */\r\n parentsAndChildrenExclusive: boolean;\r\n /** Symbology overrides to apply to the tiles. */\r\n symbologyOverrides: FeatureSymbology.Overrides | undefined;\r\n /** Optionally customizes the view's symbology overrides for the tiles. */\r\n appearanceProvider?: FeatureAppearanceProvider;\r\n /** Optionally overrides the view's hidden line settings. */\r\n hiddenLineSettings?: HiddenLine.Settings;\r\n /** If defined, tiles should be culled if they do not intersect this clip. */\r\n intersectionClip?: ClipVector;\r\n /** If defined, the Id of a node in the scene's [RenderSchedule.Script]($common) that applies a transform to the graphics;\r\n * or \"0xffffffff\" for any node that does *not* apply a transform.\r\n * @internal\r\n */\r\n animationTransformNodeId?: number;\r\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\r\n boundingRange?: Range3d;\r\n /** @alpha */\r\n maximumScreenSpaceError?: number;\r\n}\r\n\r\n/**\r\n * Provides context used when selecting and drawing [[Tile]]s.\r\n * @see [[TileTree.selectTiles]]\r\n * @see [[TileTree.draw]]\r\n * @public\r\n * @extensions\r\n */\r\nexport class TileDrawArgs {\r\n /** Transform to the location in iModel coordinates at which the tiles are to be drawn. */\r\n public readonly location: Transform;\r\n /** The tile tree being drawn. */\r\n public readonly tree: TileTree;\r\n /** Optional clip volume applied to the tiles. */\r\n public clipVolume: RenderClipVolume | undefined;\r\n /** The context in which the tiles will be drawn, exposing, e.g., the [[Viewport]] and accepting [[RenderGraphic]]s to be drawn. */\r\n public readonly context: SceneContext;\r\n /** Describes the viewed volume. */\r\n public viewingSpace: ViewingSpace;\r\n /** Holds the tile graphics to be drawn. */\r\n public readonly graphics: GraphicBranch = new GraphicBranch();\r\n /** @internal */\r\n public readonly now: BeTimePoint;\r\n /** The planes of the viewing frustum, used for frustum culling. */\r\n protected _frustumPlanes?: FrustumPlanes;\r\n /** @internal */\r\n public planarClassifier?: RenderPlanarClassifier;\r\n /** @internal */\r\n public drape?: RenderTextureDrape;\r\n /** Optional clip volume applied to all tiles in the view. */\r\n public readonly viewClip?: ClipVector;\r\n /** True if a tile and its child tiles should not be drawn simultaneously. */\r\n public parentsAndChildrenExclusive: boolean;\r\n /** @internal */\r\n private _appearanceProvider?: FeatureAppearanceProvider;\r\n /** Optional overrides for the view's hidden line settings. */\r\n public hiddenLineSettings?: HiddenLine.Settings;\r\n /** Tiles that we want to draw and that are ready to draw. May not actually be selected, e.g. if sibling tiles are not yet ready. */\r\n public readonly readyTiles = new Set<Tile>();\r\n /** Tiles whose contents should be kept in memory regardless of whether or not they are selected for display.\r\n * @internal\r\n */\r\n public readonly touchedTiles = new Set<Tile>();\r\n /** For perspective views, the view-Z of the near plane. */\r\n private readonly _nearFrontCenter?: Point3d;\r\n /** Overrides applied to the view's [ViewFlags]($common) when drawing the tiles. */\r\n public get viewFlagOverrides(): ViewFlagOverrides { return this.graphics.viewFlagOverrides; }\r\n /** If defined, replaces the view's own symbology overrides when drawing the tiles. */\r\n public get symbologyOverrides(): FeatureSymbology.Overrides | undefined { return this.graphics.symbologyOverrides; }\r\n /** If defined, tiles will be culled if they do not intersect this clip. */\r\n public intersectionClip?: ClipVector;\r\n /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */\r\n public boundingRange?: Range3d;\r\n /** @internal */\r\n public readonly pixelSizeScaleFactor;\r\n /** @internal */\r\n public readonly animationTransformNodeId?: number;\r\n /** @alpha */\r\n public maximumScreenSpaceError;\r\n\r\n /** Compute the size in pixels of the specified tile at the point on its bounding sphere closest to the camera. */\r\n public getPixelSize(tile: Tile): number {\r\n const sizeFromProjection = this.getPixelSizeFromProjection(tile);\r\n if (undefined !== sizeFromProjection)\r\n return sizeFromProjection;\r\n\r\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\r\n const center = this.getTileCenter(tile);\r\n\r\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\r\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(radius / pixelSizeAtPt) : 1.0e-3;\r\n }\r\n\r\n /** If the tile provides corners (from an OBB) then this produces most accurate representation of the tile size */\r\n private getPixelSizeFromProjection(tile: Tile): number | undefined {\r\n const sizeProjectionCorners = tile.getSizeProjectionCorners();\r\n if (!sizeProjectionCorners)\r\n return undefined;\r\n\r\n /* For maps or global reality models we use the projected screen rectangle rather than sphere to calculate pixel size to avoid excessive tiles at horizon. */\r\n const tileToView = this.worldToViewMap.transform0.multiplyMatrixMatrix(Matrix4d.createTransform(this.location, scratchMatrix4d), scratchMatrix4d);\r\n scratchXRange.setNull();\r\n scratchYRange.setNull();\r\n\r\n let behindEye = false;\r\n for (const corner of sizeProjectionCorners) {\r\n const viewCorner = tileToView.multiplyPoint3d(corner, 1, scratchPoint4d);\r\n if (viewCorner.w < 0.0) {\r\n behindEye = true;\r\n break;\r\n }\r\n\r\n scratchXRange.extendX(viewCorner.x / viewCorner.w);\r\n scratchYRange.extendX(viewCorner.y / viewCorner.w);\r\n }\r\n if (behindEye)\r\n return undefined;\r\n\r\n return scratchXRange.isNull ? 1.0E-3 : this.context.adjustPixelSizeForLOD(Math.sqrt(scratchXRange.length() * scratchYRange.length()));\r\n }\r\n\r\n /** Compute the size in meters of one pixel at the point on the tile's bounding sphere closest to the camera. */\r\n public getPixelSizeInMetersAtClosestPoint(tile: Tile): number {\r\n const radius = this.getTileRadius(tile); // use a sphere to test pixel size. We don't know the orientation of the image within the bounding box.\r\n const center = this.getTileCenter(tile);\r\n\r\n const pixelSizeAtPt = this.computePixelSizeInMetersAtClosestPoint(center, radius);\r\n return 0 !== pixelSizeAtPt ? this.context.adjustPixelSizeForLOD(pixelSizeAtPt) : 1.0e-3;\r\n }\r\n\r\n /** Compute the size in meters of one pixel at the point on a sphere closest to the camera.\r\n * Device scaling is not applied.\r\n */\r\n public computePixelSizeInMetersAtClosestPoint(center: Point3d, radius: number): number {\r\n if (this.context.viewport.view.is3d() && this.context.viewport.isCameraOn && this._nearFrontCenter) {\r\n const toFront = Vector3d.createStartEnd(center, this._nearFrontCenter);\r\n const viewZ = this.context.viewport.rotation.rowZ();\r\n // If the sphere overlaps the near front plane just use near front point. This also handles behind eye conditions.\r\n if (viewZ.dotProduct(toFront) < radius) {\r\n center = this._nearFrontCenter;\r\n } else {\r\n // Find point on sphere closest to eye.\r\n const toEye = center.unitVectorTo(this.context.viewport.view.camera.eye);\r\n\r\n if (toEye) { // Only if tile is not already behind the eye.\r\n toEye.scaleInPlace(radius);\r\n center.addInPlace(toEye);\r\n }\r\n }\r\n }\r\n\r\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\r\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\r\n return this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\r\n }\r\n\r\n /** Compute this size of a sphere on screen in pixels */\r\n public getRangePixelSize(range: Range3d): number {\r\n const transformedRange = this.location.multiplyRange(range, scratchRange);\r\n const center = transformedRange.localXYZToWorld(.5, .5, .5, scratchPoint)!;\r\n const radius = transformedRange.diagonal().magnitude();\r\n\r\n const viewPt = this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(center);\r\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\r\n const pixelSizeAtPt = this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt).distance(this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(viewPt2));\r\n return 0 !== pixelSizeAtPt ? radius / pixelSizeAtPt : 1.0e-3;\r\n }\r\n\r\n /** @internal */\r\n public getTileGraphics(tile: Tile) {\r\n return tile.produceGraphics();\r\n }\r\n\r\n /** The planes of the viewing frustum, used for frustum culling. */\r\n public get frustumPlanes(): FrustumPlanes {\r\n return this._frustumPlanes !== undefined ? this._frustumPlanes : this.context.frustumPlanes;\r\n }\r\n\r\n /** Provides conversions between [[CoordSystem.World]] and [[CoordSystem.View]]. */\r\n public get worldToViewMap(): Map4d {\r\n return this.viewingSpace.worldToViewMap;\r\n }\r\n\r\n private computePixelSizeScaleFactor(): number {\r\n // Check to see if a model display transform with non-uniform scaling is being used.\r\n const mat = this.context.viewport.view.modelDisplayTransformProvider?.getModelDisplayTransform(this.tree.modelId)?.matrix;\r\n if (!mat)\r\n return 1;\r\n\r\n const scale = [0, 1, 2].map((x) => mat.getColumn(x).magnitude());\r\n if (Math.abs(scale[0] - scale[1]) <= Geometry.smallMetricDistance && Math.abs(scale[0] - scale[2]) <= Geometry.smallMetricDistance)\r\n return 1;\r\n\r\n // If the component with the largest scale is not the same as the component with the largest tile range use it to adjust the pixel size.\r\n const rangeDiag = this.tree.range.diagonal();\r\n let maxS = 0;\r\n let maxR = 0;\r\n if (scale[0] > scale[1])\r\n maxS = (scale[0] > scale[2] ? 0 : 2);\r\n else\r\n maxS = (scale[1] > scale[2] ? 1 : 2);\r\n\r\n if (rangeDiag.x > rangeDiag.y)\r\n maxR = (rangeDiag.x > rangeDiag.z ? 0 : 2);\r\n else\r\n maxR = (rangeDiag.y > rangeDiag.z ? 1 : 2);\r\n\r\n return maxS !== maxR ? scale[maxS] : 1;\r\n }\r\n\r\n /** Constructor */\r\n public constructor(params: TileDrawArgParams) {\r\n const { location, tree, context, now, viewFlagOverrides, clipVolume, parentsAndChildrenExclusive, symbologyOverrides } = params;\r\n this.location = location;\r\n this.tree = tree;\r\n this.context = context;\r\n this.now = now;\r\n this._appearanceProvider = params.appearanceProvider;\r\n this.hiddenLineSettings = params.hiddenLineSettings;\r\n this.animationTransformNodeId = params.animationTransformNodeId;\r\n this.boundingRange = params.boundingRange;\r\n this.maximumScreenSpaceError = params.maximumScreenSpaceError ?? 16; // 16 is Cesium's default.\r\n\r\n // Do not cull tiles based on clip volume if tiles outside clip are supposed to be drawn but in a different color.\r\n if (undefined !== clipVolume && !context.viewport.view.displayStyle.settings.clipStyle.outsideColor)\r\n this.clipVolume = clipVolume;\r\n\r\n this.graphics.setViewFlagOverrides(viewFlagOverrides);\r\n this.graphics.symbologyOverrides = symbologyOverrides;\r\n this.graphics.animationId = tree.modelId;\r\n\r\n this.viewingSpace = context.viewingSpace;\r\n this._frustumPlanes = FrustumPlanes.fromFrustum(this.viewingSpace.getFrustum());\r\n\r\n this.planarClassifier = context.getPlanarClassifierForModel(tree.modelId);\r\n this.drape = context.getTextureDrapeForModel(tree.modelId);\r\n\r\n // NB: If the tile tree has its own clip, do not also apply the view's clip.\r\n if (context.viewFlags.clipVolume && false !== viewFlagOverrides.clipVolume && undefined === clipVolume) {\r\n const outsideClipColor = context.viewport.displayStyle.settings.clipStyle.outsideColor;\r\n this.viewClip = undefined === outsideClipColor ? context.viewport.view.getViewClip() : undefined;\r\n }\r\n\r\n this.parentsAndChildrenExclusive = parentsAndChildrenExclusive;\r\n if (context.viewport.isCameraOn)\r\n this._nearFrontCenter = context.viewport.getFrustum(CoordSystem.World).frontCenter;\r\n\r\n this.pixelSizeScaleFactor = this.computePixelSizeScaleFactor();\r\n }\r\n\r\n /** A multiplier applied to a [[Tile]]'s `maximumSize` property to adjust level of detail.\r\n * @see [[Viewport.tileSizeModifier]].\r\n * @public\r\n */\r\n public get tileSizeModifier(): number { return this.context.viewport.tileSizeModifier; }\r\n\r\n /** @internal */\r\n public getTileCenter(tile: Tile): Point3d { return this.location.multiplyPoint3d(tile.center); }\r\n\r\n /** @internal */\r\n public getTileRadius(tile: Tile): number {\r\n let range: Range3d = tile.range.clone(scratchRange);\r\n if (tile.tree.is2d) {\r\n // 2d tiles have a fixed Z range of [-1, 1]. Sometimes (e.g., hypermodeling) we draw them within a 3d view. Prevent Z from artificially expanding the radius.\r\n range.low.z = range.high.z = 0;\r\n }\r\n\r\n range = this.location.multiplyRange(range, range);\r\n return 0.5 * range.low.distance(range.high);\r\n }\r\n\r\n /** @internal */\r\n public get clip(): ClipVector | undefined {\r\n return undefined !== this.clipVolume ? this.clipVolume.clipVector : undefined;\r\n }\r\n\r\n /** Add a provider to supplement or override the symbology overrides for the view.\r\n * @note If a provider already exists, the new provider will be chained such that it sees the base overrides\r\n * after they have potentially been modified by the existing provider.\r\n * @public\r\n */\r\n public addAppearanceProvider(provider: FeatureAppearanceProvider): void {\r\n this._appearanceProvider = this._appearanceProvider ? FeatureAppearanceProvider.chain(this._appearanceProvider, provider) : provider;\r\n }\r\n\r\n /** Optionally customizes aspects of the view's [[FeatureSymbology.Overrides]]. */\r\n public get appearanceProvider(): FeatureAppearanceProvider | undefined {\r\n return this._appearanceProvider;\r\n }\r\n\r\n /** @internal */\r\n public produceGraphics(): RenderGraphic | undefined {\r\n return this._produceGraphicBranch(this.graphics);\r\n }\r\n /** @internal */\r\n public get secondaryClassifiers(): Map<number, RenderPlanarClassifier>| undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n private _produceGraphicBranch(graphics: GraphicBranch): RenderGraphic | undefined {\r\n if (graphics.isEmpty)\r\n return undefined;\r\n\r\n const opts = {\r\n iModel: this.tree.iModel,\r\n clipVolume: this.clipVolume,\r\n classifierOrDrape: this.planarClassifier ?? this.drape,\r\n appearanceProvider: this.appearanceProvider,\r\n hline: this.hiddenLineSettings,\r\n secondaryClassifiers: this.secondaryClassifiers,\r\n };\r\n\r\n let graphic = this.context.createGraphicBranch(graphics, this.location, opts);\r\n if (undefined !== this.animationTransformNodeId)\r\n graphic = this.context.renderSystem.createAnimationTransformNode(graphic, this.animationTransformNodeId);\r\n\r\n return graphic;\r\n }\r\n\r\n /** Output graphics for all accumulated tiles. */\r\n public drawGraphics(): void {\r\n const graphics = this.produceGraphics();\r\n if (undefined !== graphics)\r\n this.context.outputGraphic(graphics);\r\n }\r\n\r\n /** Output graphics of the specified type for all accumulated tiles. */\r\n public drawGraphicsWithType(graphicType: TileGraphicType, graphics: GraphicBranch): void {\r\n const branch = this._produceGraphicBranch(graphics);\r\n if (undefined !== branch)\r\n this.context.withGraphicType(graphicType, () => this.context.outputGraphic(branch));\r\n }\r\n\r\n /** Indicate that graphics for the specified tile are desired but not yet available. Subsequently a request will be enqueued to load the tile's graphics. */\r\n public insertMissing(tile: Tile): void {\r\n this.context.insertMissingTile(tile);\r\n }\r\n\r\n /** Indicate that some requested child tiles are not yet loaded. */\r\n public markChildrenLoading(): void {\r\n this.context.markChildrenLoading();\r\n }\r\n\r\n /** Indicate that the specified tile is being used for some purpose by the [[SceneContext]]'s [[Viewport]]. Typically \"used\" means \"displayed\", but the exact meaning is up to the [[TileTree]] - for example, \"used\" might also mean that the tile's children are being used. A tile that is \"in use\" by any [[Viewport]] will not be discarded. */\r\n public markUsed(tile: Tile): void {\r\n tile.usageMarker.mark(this.context.viewport, this.now);\r\n }\r\n\r\n /** Indicate that the specified tile should be displayed and that its graphics are ready to be displayed. The number of \"ready\" tiles is used in conjunction with the number of \"missing\" tiles to convey to the user how complete the current view is.\r\n * @see [[insertMissing]]\r\n */\r\n public markReady(tile: Tile): void {\r\n this.readyTiles.add(tile);\r\n }\r\n\r\n /** Invoked by [[TileTree.selectTiles]]. This exists chiefly for [[SolarShadowMap]].\r\n * @internal\r\n */\r\n public processSelectedTiles(_tiles: Tile[]): void { }\r\n\r\n /* @internal */\r\n public get maxRealityTreeSelectionCount(): number | undefined { return undefined; }\r\n}\r\n"]}
|
package/lib/esm/tile/TileTree.js
CHANGED
|
@@ -83,7 +83,7 @@ export class TileTree {
|
|
|
83
83
|
selectTiles(args) {
|
|
84
84
|
this._lastSelected = BeTimePoint.now();
|
|
85
85
|
const tiles = this._selectTiles(args);
|
|
86
|
-
IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles);
|
|
86
|
+
IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);
|
|
87
87
|
args.processSelectedTiles(tiles);
|
|
88
88
|
return tiles;
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,WAAW,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAGnF,OAAO,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,0DAA0D;IAC1D,qEAAS,CAAA;IACT,uDAAuD;IACvD,iEAAO,CAAA;IACP,kDAAkD;IAClD,+DAAM,CAAA;IACN,+CAA+C;IAC/C,mEAAQ,CAAA;AACV,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAgB,QAAQ;IAkB5B,gBAAgB;IAChB,IAAW,YAAY,KAAuB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAe1E,kGAAkG;IAClG,IAAW,kBAAkB;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAWD,mDAAmD;IACnD,IAAW,IAAI,KAAc,OAAO,CAAC,IAAI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M,GAAG,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACrD,MAAM,QAAQ,GAAG,MAAM,oCAAoC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACjF,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC;SAChC;QACD,IAAI,CAAC,QAAQ;YACX,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;QAErD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAAiC;IAC5D,CAAC;CACF","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 { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\r\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { ElementAlignedBox3d, FrustumPlanes, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\r\nimport { RenderMemory } from \"../render/RenderMemory\";\r\nimport { Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\r\n\r\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\r\n * @see [[TileTreeOwner]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum TileTreeLoadStatus {\r\n /** No attempt to load the tile tree has yet been made. */\r\n NotLoaded,\r\n /** The tile tree is in the process of being loaded. */\r\n Loading,\r\n /** The tile tree has been successfully loaded. */\r\n Loaded,\r\n /** An attempt to load the tile tree failed. */\r\n NotFound,\r\n}\r\n\r\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\r\n * Tile trees originate from a variety of sources:\r\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\r\n * - A [[DisplayStyleState]]'s map settings or reality models;\r\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\r\n * - [[TiledGraphicsProvider]]s associated with a viewport.\r\n *\r\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\r\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\r\n *\r\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\r\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\r\n * that it calls.\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class TileTree {\r\n private _isDisposed = false;\r\n /** @internal */\r\n protected _lastSelected = BeTimePoint.now();\r\n /** @internal */\r\n protected _clipVolume?: RenderClipVolume;\r\n public readonly iModel: IModelConnection;\r\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\r\n public readonly iModelTransform: Transform;\r\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\r\n public readonly id: string;\r\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\r\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\r\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\r\n */\r\n public readonly modelId: Id64String;\r\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\r\n public readonly expirationTime: BeDuration;\r\n /** @internal */\r\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\r\n private readonly _loadPriority: TileLoadPriority;\r\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\r\n public readonly contentRange?: ElementAlignedBox3d;\r\n\r\n /** The lowest-resolution tile in this tree. */\r\n public abstract get rootTile(): Tile;\r\n /** True if this tile tree contains 3d graphics. */\r\n public abstract get is3d(): boolean;\r\n /** Returns the maximum depth of this tree, if any. */\r\n public abstract get maxDepth(): number | undefined;\r\n\r\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\r\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\r\n\r\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\r\n public get isContentUnbounded(): boolean {\r\n return false;\r\n }\r\n\r\n /** Implement this method to select tiles of appropriate resolution. */\r\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\r\n\r\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\r\n public abstract draw(args: TileDrawArgs): void;\r\n\r\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\r\n public abstract prune(): void;\r\n\r\n /** True if this tile tree contains 2d graphics. */\r\n public get is2d(): boolean { return !this.is3d; }\r\n /** @internal */\r\n public get isPointCloud(): boolean { return false; }\r\n /** @internal */\r\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\r\n\r\n /** The volume of space occupied by this tile tree. */\r\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\r\n /** The most recent time at which tiles [[selectTiles]] was called. */\r\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\r\n /** True if a tile and its child tiles should not be drawn simultaneously.\r\n * Default: true.\r\n */\r\n public get parentsAndChildrenExclusive(): boolean { return true; }\r\n\r\n /** Constructor */\r\n protected constructor(params: TileTreeParams) {\r\n this._lastSelected = BeTimePoint.now();\r\n this.iModel = params.iModel;\r\n this.iModelTransform = params.location;\r\n this._clipVolume = params.clipVolume;\r\n this.modelId = params.modelId;\r\n this.id = params.id;\r\n this.contentRange = params.contentRange;\r\n\r\n const admin = IModelApp.tileAdmin;\r\n this._loadPriority = params.priority;\r\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\r\n }\r\n\r\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\r\n * @note Do **not** override this method. Implement [[_selectTiles]].\r\n */\r\n public selectTiles(args: TileDrawArgs): Tile[] {\r\n this._lastSelected = BeTimePoint.now();\r\n const tiles = this._selectTiles(args);\r\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles);\r\n args.processSelectedTiles(tiles);\r\n return tiles;\r\n }\r\n\r\n /** True if [[dispose]] has been called on this tile tree. */\r\n public get isDisposed(): boolean { return this._isDisposed; }\r\n\r\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\r\n public dispose(): void {\r\n if (this.isDisposed)\r\n return;\r\n\r\n this._isDisposed = true;\r\n dispose(this.rootTile);\r\n }\r\n\r\n /** @internal */\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n this.rootTile.collectStatistics(stats);\r\n }\r\n\r\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\r\n public countTiles(): number {\r\n return 1 + this.rootTile.countDescendants();\r\n }\r\n\r\n /** @internal */\r\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\r\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\r\n }\r\n\r\n /**\r\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\r\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\r\n * @beta\r\n */\r\n public async getEcefTransform(): Promise<Transform | undefined> {\r\n if (!this.iModel.ecefLocation)\r\n return undefined;\r\n\r\n let dbToEcef: Transform | undefined;\r\n const range = this.contentRange ? this.contentRange : this.range;\r\n const center = range.localXYZToWorld(.5, .5, .5);\r\n if (center) {\r\n this.iModelTransform.multiplyPoint3d(center, center);\r\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\r\n dbToEcef = ecefToDb?.inverse();\r\n }\r\n if (!dbToEcef)\r\n dbToEcef = this.iModel.ecefLocation.getTransform();\r\n\r\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\r\n }\r\n\r\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\r\n * The base implementation does nothing.\r\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\r\n * @beta\r\n */\r\n public collectTileGeometry(_collector: TileGeometryCollector): void {\r\n }\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,WAAW,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAGnF,OAAO,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,0DAA0D;IAC1D,qEAAS,CAAA;IACT,uDAAuD;IACvD,iEAAO,CAAA;IACP,kDAAkD;IAClD,+DAAM,CAAA;IACN,+CAA+C;IAC/C,mEAAQ,CAAA;AACV,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAgB,QAAQ;IAkB5B,gBAAgB;IAChB,IAAW,YAAY,KAAuB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAe1E,kGAAkG;IAClG,IAAW,kBAAkB;QAC3B,OAAO,KAA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AAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;QACjE,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACrD,MAAM,QAAQ,GAAG,MAAM,oCAAoC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACjF,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC;SAChC;QACD,IAAI,CAAC,QAAQ;YACX,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;QAErD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAAiC;IAC5D,CAAC;CACF","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 { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\r\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { ElementAlignedBox3d, FrustumPlanes, ViewFlagOverrides } from \"@itwin/core-common\";\r\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\r\nimport { RenderMemory } from \"../render/RenderMemory\";\r\nimport { Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\r\n\r\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\r\n * @see [[TileTreeOwner]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum TileTreeLoadStatus {\r\n /** No attempt to load the tile tree has yet been made. */\r\n NotLoaded,\r\n /** The tile tree is in the process of being loaded. */\r\n Loading,\r\n /** The tile tree has been successfully loaded. */\r\n Loaded,\r\n /** An attempt to load the tile tree failed. */\r\n NotFound,\r\n}\r\n\r\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\r\n * Tile trees originate from a variety of sources:\r\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\r\n * - A [[DisplayStyleState]]'s map settings or reality models;\r\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\r\n * - [[TiledGraphicsProvider]]s associated with a viewport.\r\n *\r\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\r\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\r\n *\r\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\r\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\r\n * that it calls.\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class TileTree {\r\n private _isDisposed = false;\r\n /** @internal */\r\n protected _lastSelected = BeTimePoint.now();\r\n /** @internal */\r\n protected _clipVolume?: RenderClipVolume;\r\n public readonly iModel: IModelConnection;\r\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\r\n public readonly iModelTransform: Transform;\r\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\r\n public readonly id: string;\r\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\r\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\r\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\r\n */\r\n public readonly modelId: Id64String;\r\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\r\n public readonly expirationTime: BeDuration;\r\n /** @internal */\r\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\r\n private readonly _loadPriority: TileLoadPriority;\r\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\r\n public readonly contentRange?: ElementAlignedBox3d;\r\n\r\n /** The lowest-resolution tile in this tree. */\r\n public abstract get rootTile(): Tile;\r\n /** True if this tile tree contains 3d graphics. */\r\n public abstract get is3d(): boolean;\r\n /** Returns the maximum depth of this tree, if any. */\r\n public abstract get maxDepth(): number | undefined;\r\n\r\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\r\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\r\n\r\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\r\n public get isContentUnbounded(): boolean {\r\n return false;\r\n }\r\n\r\n /** Implement this method to select tiles of appropriate resolution. */\r\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\r\n\r\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\r\n public abstract draw(args: TileDrawArgs): void;\r\n\r\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\r\n public abstract prune(): void;\r\n\r\n /** True if this tile tree contains 2d graphics. */\r\n public get is2d(): boolean { return !this.is3d; }\r\n /** @internal */\r\n public get isPointCloud(): boolean { return false; }\r\n /** @internal */\r\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\r\n\r\n /** The volume of space occupied by this tile tree. */\r\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\r\n /** The most recent time at which tiles [[selectTiles]] was called. */\r\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\r\n /** True if a tile and its child tiles should not be drawn simultaneously.\r\n * Default: true.\r\n */\r\n public get parentsAndChildrenExclusive(): boolean { return true; }\r\n\r\n /** Constructor */\r\n protected constructor(params: TileTreeParams) {\r\n this._lastSelected = BeTimePoint.now();\r\n this.iModel = params.iModel;\r\n this.iModelTransform = params.location;\r\n this._clipVolume = params.clipVolume;\r\n this.modelId = params.modelId;\r\n this.id = params.id;\r\n this.contentRange = params.contentRange;\r\n\r\n const admin = IModelApp.tileAdmin;\r\n this._loadPriority = params.priority;\r\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\r\n }\r\n\r\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\r\n * @note Do **not** override this method. Implement [[_selectTiles]].\r\n */\r\n public selectTiles(args: TileDrawArgs): Tile[] {\r\n this._lastSelected = BeTimePoint.now();\r\n const tiles = this._selectTiles(args);\r\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);\r\n args.processSelectedTiles(tiles);\r\n return tiles;\r\n }\r\n\r\n /** True if [[dispose]] has been called on this tile tree. */\r\n public get isDisposed(): boolean { return this._isDisposed; }\r\n\r\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\r\n public dispose(): void {\r\n if (this.isDisposed)\r\n return;\r\n\r\n this._isDisposed = true;\r\n dispose(this.rootTile);\r\n }\r\n\r\n /** @internal */\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n this.rootTile.collectStatistics(stats);\r\n }\r\n\r\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\r\n public countTiles(): number {\r\n return 1 + this.rootTile.countDescendants();\r\n }\r\n\r\n /** @internal */\r\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\r\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\r\n }\r\n\r\n /**\r\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\r\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\r\n * @beta\r\n */\r\n public async getEcefTransform(): Promise<Transform | undefined> {\r\n if (!this.iModel.ecefLocation)\r\n return undefined;\r\n\r\n let dbToEcef: Transform | undefined;\r\n const range = this.contentRange ? this.contentRange : this.range;\r\n const center = range.localXYZToWorld(.5, .5, .5);\r\n if (center) {\r\n this.iModelTransform.multiplyPoint3d(center, center);\r\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\r\n dbToEcef = ecefToDb?.inverse();\r\n }\r\n if (!dbToEcef)\r\n dbToEcef = this.iModel.ecefLocation.getTransform();\r\n\r\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\r\n }\r\n\r\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\r\n * The base implementation does nothing.\r\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\r\n * @beta\r\n */\r\n public collectTileGeometry(_collector: TileGeometryCollector): void {\r\n }\r\n}\r\n\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-frontend",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.89",
|
|
4
4
|
"description": "iTwin.js frontend components",
|
|
5
5
|
"main": "lib/cjs/core-frontend.js",
|
|
6
6
|
"module": "lib/esm/core-frontend.js",
|
|
@@ -23,26 +23,26 @@
|
|
|
23
23
|
"url": "http://www.bentley.com"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@itwin/appui-abstract": "^4.0.0-dev.
|
|
27
|
-
"@itwin/core-bentley": "^4.0.0-dev.
|
|
28
|
-
"@itwin/core-common": "^4.0.0-dev.
|
|
29
|
-
"@itwin/core-geometry": "^4.0.0-dev.
|
|
30
|
-
"@itwin/core-orbitgt": "^4.0.0-dev.
|
|
31
|
-
"@itwin/core-quantity": "^4.0.0-dev.
|
|
26
|
+
"@itwin/appui-abstract": "^4.0.0-dev.89",
|
|
27
|
+
"@itwin/core-bentley": "^4.0.0-dev.89",
|
|
28
|
+
"@itwin/core-common": "^4.0.0-dev.89",
|
|
29
|
+
"@itwin/core-geometry": "^4.0.0-dev.89",
|
|
30
|
+
"@itwin/core-orbitgt": "^4.0.0-dev.89",
|
|
31
|
+
"@itwin/core-quantity": "^4.0.0-dev.89"
|
|
32
32
|
},
|
|
33
33
|
"//devDependencies": [
|
|
34
34
|
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
|
|
35
35
|
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@itwin/appui-abstract": "4.0.0-dev.
|
|
39
|
-
"@itwin/build-tools": "4.0.0-dev.
|
|
40
|
-
"@itwin/core-bentley": "4.0.0-dev.
|
|
41
|
-
"@itwin/core-common": "4.0.0-dev.
|
|
42
|
-
"@itwin/core-geometry": "4.0.0-dev.
|
|
43
|
-
"@itwin/core-orbitgt": "4.0.0-dev.
|
|
44
|
-
"@itwin/core-quantity": "4.0.0-dev.
|
|
45
|
-
"@itwin/certa": "4.0.0-dev.
|
|
38
|
+
"@itwin/appui-abstract": "4.0.0-dev.89",
|
|
39
|
+
"@itwin/build-tools": "4.0.0-dev.89",
|
|
40
|
+
"@itwin/core-bentley": "4.0.0-dev.89",
|
|
41
|
+
"@itwin/core-common": "4.0.0-dev.89",
|
|
42
|
+
"@itwin/core-geometry": "4.0.0-dev.89",
|
|
43
|
+
"@itwin/core-orbitgt": "4.0.0-dev.89",
|
|
44
|
+
"@itwin/core-quantity": "4.0.0-dev.89",
|
|
45
|
+
"@itwin/certa": "4.0.0-dev.89",
|
|
46
46
|
"@itwin/eslint-plugin": "^4.0.0-dev.33",
|
|
47
47
|
"@types/chai": "4.3.1",
|
|
48
48
|
"@types/chai-as-promised": "^7",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"@itwin/object-storage-azure": "^1.5.0",
|
|
73
73
|
"@itwin/cloud-agnostic-core": "^1.5.0",
|
|
74
74
|
"@itwin/object-storage-core": "^1.5.0",
|
|
75
|
-
"@itwin/core-i18n": "4.0.0-dev.
|
|
76
|
-
"@itwin/core-telemetry": "4.0.0-dev.
|
|
77
|
-
"@itwin/webgl-compatibility": "4.0.0-dev.
|
|
75
|
+
"@itwin/core-i18n": "4.0.0-dev.89",
|
|
76
|
+
"@itwin/core-telemetry": "4.0.0-dev.89",
|
|
77
|
+
"@itwin/webgl-compatibility": "4.0.0-dev.89",
|
|
78
78
|
"@loaders.gl/core": "^3.1.6",
|
|
79
79
|
"@loaders.gl/draco": "^3.1.6",
|
|
80
80
|
"fuse.js": "^3.3.0",
|