@itwin/core-frontend 5.1.3 → 5.1.5

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 CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log - @itwin/core-frontend
2
2
 
3
- This log was last generated on Wed, 20 Aug 2025 13:57:10 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 04 Sep 2025 13:51:08 GMT and should not be manually modified.
4
+
5
+ ## 5.1.5
6
+ Thu, 04 Sep 2025 13:51:08 GMT
7
+
8
+ ### Updates
9
+
10
+ - Add DynamicsContext.addOverlay
11
+
12
+ ## 5.1.4
13
+ Fri, 22 Aug 2025 14:22:33 GMT
14
+
15
+ ### Updates
16
+
17
+ - A model drawn as only contour lines will only mask the background map where the contour lines draw.
4
18
 
5
19
  ## 5.1.3
6
20
  Wed, 20 Aug 2025 13:57:10 GMT
@@ -71,8 +71,17 @@ export declare class RenderContext {
71
71
  export declare class DynamicsContext extends RenderContext {
72
72
  private _foreground?;
73
73
  private _overlay?;
74
- /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */
74
+ /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].
75
+ * These graphics are drawn as [[GraphicType.Scene]].
76
+ * @see [[addOverlay]] to add a graphic to be drawn as an overlay instead.
77
+ */
75
78
  addGraphic(graphic: RenderGraphic): void;
79
+ /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].
80
+ * These graphics are drawn as part of the viewport's scene as described by [[GraphicType.Scene]], except
81
+ * that they always draw on top of other graphics as with [[GraphicType.WorldOverlay]].
82
+ * @see [[addGraphic]] to add an ordinary scene graphic instead.
83
+ */
84
+ addOverlay(graphic: RenderGraphic): void;
76
85
  /** @internal */
77
86
  add(graphic: RenderGraphic, isOverlay: boolean): void;
78
87
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"ViewContext.d.ts","sourceRoot":"","sources":["../../src/ViewContext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ACvE,gBAAgB;IAChB,IAAW,aAAa,oCAAuC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAAU,EAAE,uBAAuB,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;CAG3F"}
@@ -86,10 +86,21 @@ exports.RenderContext = RenderContext;
86
86
  class DynamicsContext extends RenderContext {
87
87
  _foreground;
88
88
  _overlay;
89
- /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */
89
+ /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].
90
+ * These graphics are drawn as [[GraphicType.Scene]].
91
+ * @see [[addOverlay]] to add a graphic to be drawn as an overlay instead.
92
+ */
90
93
  addGraphic(graphic) {
91
94
  this.add(graphic, false);
92
95
  }
96
+ /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].
97
+ * These graphics are drawn as part of the viewport's scene as described by [[GraphicType.Scene]], except
98
+ * that they always draw on top of other graphics as with [[GraphicType.WorldOverlay]].
99
+ * @see [[addGraphic]] to add an ordinary scene graphic instead.
100
+ */
101
+ addOverlay(graphic) {
102
+ this.add(graphic, true);
103
+ }
93
104
  /** @internal */
94
105
  add(graphic, isOverlay) {
95
106
  const key = isOverlay ? "_overlay" : "_foreground";
@@ -1 +1 @@
1
- {"version":3,"file":"ViewContext.js","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAKzD,oDAAuE;AACvE,yDAAwE;AACxE,2CAAwC;AAUxC,0CAAuC;AACvC,8CAA+H;AAE/H,yCAAqG;AAErG,6DAA0D;AAG1D;;;GAGG;AACH,MAAa,aAAa;IACxB,2DAA2D;IAC3C,SAAS,CAAY;IACpB,SAAS,CAAW;IACrC,yDAAyD;IACzC,OAAO,CAAU;IACjC,gEAAgE;IAChD,aAAa,CAAgB;IAE7C,YAAY,EAAY,EAAE,OAAiB;QACzC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC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AAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,eAAe,CAAC,IAAqB,EAAE,IAAgB;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,IAAI,EAAE,CAAC;QAEP,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,+DAA+D;IAC/D,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACvD,2EAA2E;IAC3E,IAAW,kBAAkB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,gFAAgF;IAChF,IAAW,eAAe,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,gBAAgB;IAChB,IAAW,iBAAiB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACvE,gBAAgB;IAChB,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAAmC,EAAE,OAAmB;QACjF,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF;AAxID,oCAwIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Matrix3d, Point2d,\r\n Point3d, Range1d, Transform, XAndY,\r\n} from \"@itwin/core-geometry\";\r\nimport { Frustum, FrustumPlanes, ViewFlags } from \"@itwin/core-common\";\r\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\r\nimport { GraphicBuilder, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\r\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"./internal/render/RenderPlanarClassifier\";\r\nimport { RenderSystem, } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewingSpace } from \"./ViewingSpace\";\r\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\r\nimport { ActiveSpatialClassifier } from \"./SpatialClassifiersState\";\r\nimport { GraphicType } from \"./common/render/GraphicType\";\r\nimport { RenderTextureDrape } from \"./internal/render/RenderTextureDrape\";\r\n\r\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class RenderContext {\r\n /** ViewFlags extracted from the context's [[Viewport]]. */\r\n public readonly viewFlags: ViewFlags;\r\n private readonly _viewport: Viewport;\r\n /** Frustum extracted from the context's [[Viewport]]. */\r\n public readonly frustum: Frustum;\r\n /** Frustum planes extracted from the context's [[Viewport]]. */\r\n public readonly frustumPlanes: FrustumPlanes;\r\n\r\n constructor(vp: Viewport, frustum?: Frustum) {\r\n this._viewport = vp;\r\n this.viewFlags = vp.viewFlags;\r\n this.frustum = frustum ? frustum : vp.getFrustum();\r\n this.frustumPlanes = FrustumPlanes.fromFrustum(this.frustum);\r\n }\r\n\r\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\r\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\r\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\r\n }\r\n\r\n /** The [[Viewport]] associated with this context. */\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n /** The [[RenderSystem]] being used to produce graphics for this context. */\r\n public get renderSystem(): RenderSystem {\r\n return this.target.renderSystem;\r\n }\r\n\r\n /** @internal */\r\n public get target(): RenderTarget { return this.viewport.target; }\r\n\r\n /** @internal */\r\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\r\n }\r\n\r\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n */\r\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\r\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\r\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\r\n }\r\n\r\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\r\n * @param branch Contains the group of graphics and the symbology overrides.\r\n * @param location the local-to-world transform applied to the grouped graphics.\r\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\r\n * @see [[RenderSystem.createBranch]]\r\n */\r\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\r\n\r\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\r\n * Used when computing LOD for graphics.\r\n * @internal\r\n */\r\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\r\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\r\n }\r\n}\r\n\r\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\r\n * @see [[InteractiveTool.onDynamicFrame]]\r\n * @public\r\n */\r\nexport class DynamicsContext extends RenderContext {\r\n private _foreground?: GraphicList;\r\n private _overlay?: GraphicList;\r\n\r\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */\r\n public addGraphic(graphic: RenderGraphic): void {\r\n this.add(graphic, false);\r\n }\r\n\r\n /** @internal */\r\n public add(graphic: RenderGraphic, isOverlay: boolean) {\r\n const key = isOverlay ? \"_overlay\" : \"_foreground\";\r\n const list = this[key] ?? (this[key] = []);\r\n list.push(graphic);\r\n }\r\n\r\n /** @internal */\r\n public changeDynamics(): void {\r\n this.viewport.changeDynamics(this._foreground, this._overlay);\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[DecorateContext.create]].\r\n * @public\r\n */\r\nexport interface DecorateContextCreateArgs {\r\n /** The viewport to be decorated. */\r\n viewport: ScreenViewport;\r\n /** The set of decoration graphics to be populated by the context. */\r\n output: Decorations;\r\n /** Optional cache. If omitted, one will be created.\r\n * @internal\r\n */\r\n cache?: DecorationsCache;\r\n}\r\n\r\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class DecorateContext extends RenderContext {\r\n private readonly _decorations: Decorations;\r\n private readonly _cache: DecorationsCache;\r\n private _curCacheableDecorator?: ViewportDecorator;\r\n\r\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\r\n public override get viewport(): ScreenViewport {\r\n return super.viewport as ScreenViewport;\r\n }\r\n\r\n /** @internal */\r\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\r\n super(vp);\r\n this._decorations = decorations;\r\n this._cache = cache;\r\n }\r\n\r\n /** Create a new DecorateContext.\r\n * @param args Describes the inputs to the context.\r\n * @note Typically the [[ScreenViewport]] takes care of creating the context for you.\r\n * @public\r\n */\r\n public static create(args: DecorateContextCreateArgs): DecorateContext {\r\n return new DecorateContext(args.viewport, args.output, args.cache ?? new DecorationsCache());\r\n }\r\n\r\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @param type The type of builder to create.\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[createGraphic]] for more options.\r\n */\r\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\r\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n\r\n /** @internal */\r\n public addFromDecorator(decorator: ViewportDecorator): void {\r\n assert(undefined === this._curCacheableDecorator);\r\n try {\r\n if (decorator.useCachedDecorations) {\r\n const cached = this._cache.get(decorator);\r\n if (cached) {\r\n this.restoreCache(cached);\r\n return;\r\n }\r\n\r\n this._curCacheableDecorator = decorator;\r\n }\r\n\r\n decorator.decorate(this);\r\n } finally {\r\n this._curCacheableDecorator = undefined;\r\n }\r\n }\r\n\r\n /** Restores decorations onto this context from the specified array of cached decorations. */\r\n private restoreCache(cachedDecorations: CachedDecoration[]) {\r\n cachedDecorations.forEach((cachedDecoration) => {\r\n switch (cachedDecoration.type) {\r\n case \"graphic\":\r\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\r\n break;\r\n case \"canvas\":\r\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\r\n break;\r\n case \"html\":\r\n this.addHtmlDecoration(cachedDecoration.htmlElement);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _appendToCache(decoration: CachedDecoration) {\r\n assert(undefined !== this._curCacheableDecorator);\r\n this._cache.add(this._curCacheableDecorator, decoration);\r\n }\r\n\r\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\r\n * [[Decorations]].\r\n * @param builder The builder from which to extract the graphic.\r\n * @note The builder should not be used after calling this method.\r\n */\r\n public addDecorationFromBuilder(builder: GraphicBuilder) {\r\n this.addDecoration(builder.type, builder.finish());\r\n }\r\n\r\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\r\n * @param The type of the graphic, which determines to which list of decorations it is added.\r\n * @param decoration The decoration graphic to add.\r\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\r\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\r\n */\r\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\r\n if (this._curCacheableDecorator) {\r\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\r\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\r\n decoration = graphicOwner;\r\n }\r\n\r\n switch (type) {\r\n case GraphicType.Scene:\r\n if (undefined === this._decorations.normal)\r\n this._decorations.normal = [];\r\n this._decorations.normal.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldDecoration:\r\n if (!this._decorations.world)\r\n this._decorations.world = [];\r\n this._decorations.world.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldOverlay:\r\n if (!this._decorations.worldOverlay)\r\n this._decorations.worldOverlay = [];\r\n this._decorations.worldOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewOverlay:\r\n if (!this._decorations.viewOverlay)\r\n this._decorations.viewOverlay = [];\r\n this._decorations.viewOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewBackground:\r\n this.setViewBackground(decoration);\r\n break;\r\n }\r\n }\r\n\r\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\r\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\r\n\r\n if (undefined === this._decorations.canvasDecorations)\r\n this._decorations.canvasDecorations = [];\r\n\r\n const list = this._decorations.canvasDecorations;\r\n if (0 === list.length || true === atFront)\r\n list.push(decoration);\r\n else\r\n list.unshift(decoration);\r\n }\r\n\r\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\r\n public addHtmlDecoration(decoration: HTMLElement) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"html\", htmlElement: decoration });\r\n\r\n // an element decoration being added might already be on the decorationDiv, just marked for removal\r\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\r\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\r\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\r\n this.viewport.decorationDiv.appendChild(decoration);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\r\n const vp = this.viewport;\r\n\r\n if (vp.viewingGlobe)\r\n return;\r\n\r\n const color = vp.getContrastToBackgroundColor();\r\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\r\n if (planarGrid) {\r\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\r\n }\r\n }\r\n\r\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\r\n * @see [[RenderSystem.createSkyBox]].\r\n */\r\n public setSkyBox(graphic: RenderGraphic) {\r\n this._decorations.skyBox = graphic;\r\n }\r\n\r\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\r\n public setViewBackground(graphic: RenderGraphic) {\r\n this._decorations.viewBackground = graphic;\r\n }\r\n}\r\n\r\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\r\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\r\n * should be displayed in the viewport but are not yet loaded.\r\n * @public\r\n */\r\nexport class SceneContext extends RenderContext {\r\n private _missingChildTiles = false;\r\n /** The graphics comprising the scene. */\r\n public readonly scene = new Scene();\r\n\r\n /** @internal */\r\n public readonly missingTiles = new Set<Tile>();\r\n\r\n /** @internal */\r\n public markChildrenLoading(): void {\r\n this._missingChildTiles = true;\r\n }\r\n\r\n /** @internal */\r\n public get hasMissingTiles(): boolean {\r\n return this._missingChildTiles || this.missingTiles.size > 0;\r\n }\r\n\r\n private _viewingSpace?: ViewingSpace;\r\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\r\n\r\n public constructor(vp: Viewport, frustum?: Frustum) {\r\n super(vp, frustum);\r\n }\r\n\r\n /** The viewed volume containing the scene. */\r\n public get viewingSpace(): ViewingSpace {\r\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\r\n }\r\n\r\n /** @internal */\r\n public get graphicType() { return this._graphicType; }\r\n\r\n /** Add the specified graphic to the scene. */\r\n public outputGraphic(graphic: RenderGraphic): void {\r\n switch (this._graphicType) {\r\n case TileGraphicType.BackgroundMap:\r\n this.backgroundGraphics.push(graphic);\r\n break;\r\n case TileGraphicType.Overlay:\r\n this.overlayGraphics.push(graphic);\r\n break;\r\n default:\r\n this.graphics.push(graphic);\r\n break;\r\n }\r\n }\r\n\r\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\r\n public insertMissingTile(tile: Tile): void {\r\n switch (tile.loadStatus) {\r\n case TileLoadStatus.NotLoaded:\r\n case TileLoadStatus.Queued:\r\n case TileLoadStatus.Loading:\r\n this.missingTiles.add(tile);\r\n break;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public requestMissingTiles(): void {\r\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\r\n }\r\n\r\n /** @internal */\r\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\r\n // Target may have the classifier from a previous frame; if not we must create one.\r\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\r\n if (undefined === classifier)\r\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\r\n\r\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\r\n if (undefined !== classifier) {\r\n this.planarClassifiers.set(classifiedModelId, classifier);\r\n classifier.setSource(classifierTree, planarClipMask);\r\n }\r\n\r\n return classifier;\r\n }\r\n\r\n /** @internal */\r\n public getPlanarClassifierForModel(modelId: Id64String) {\r\n return this.planarClassifiers.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\r\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\r\n if (undefined === drapedTree)\r\n return undefined;\r\n\r\n const id = drapedTree.modelId;\r\n let drape = this.getTextureDrapeForModel(id);\r\n if (undefined !== drape)\r\n return drape;\r\n\r\n drape = this.viewport.target.getTextureDrape(id);\r\n if (undefined === drape && this.viewport.backgroundDrapeMap)\r\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\r\n\r\n if (undefined !== drape)\r\n this.textureDrapes.set(id, drape);\r\n\r\n return drape;\r\n }\r\n\r\n /** @internal */\r\n public getTextureDrapeForModel(modelId: Id64String) {\r\n return this.textureDrapes.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public withGraphicType(type: TileGraphicType, func: () => void): void {\r\n const prevType = this._graphicType;\r\n this._graphicType = type;\r\n\r\n func();\r\n\r\n this._graphicType = prevType;\r\n }\r\n\r\n /** The graphics in the scene that will be drawn with depth. */\r\n public get graphics() { return this.scene.foreground; }\r\n /** The graphics that will be drawn behind everything else in the scene. */\r\n public get backgroundGraphics() { return this.scene.background; }\r\n /** The graphics that will be drawn in front of everything else in the scene. */\r\n public get overlayGraphics() { return this.scene.overlay; }\r\n /** @internal */\r\n public get planarClassifiers() { return this.scene.planarClassifiers; }\r\n /** @internal */\r\n public get textureDrapes() { return this.scene.textureDrapes; }\r\n\r\n /** @internal */\r\n public setVolumeClassifier(classifier: ActiveSpatialClassifier, modelId: Id64String): void {\r\n this.scene.volumeClassifier = { classifier, modelId };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewContext.js","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAKzD,oDAAuE;AACvE,yDAAwE;AACxE,2CAAwC;AAUxC,0CAAuC;AACvC,8CAA+H;AAE/H,yCAAqG;AAErG,6DAA0D;AAG1D;;;GAGG;AACH,MAAa,aAAa;IACxB,2DAA2D;IAC3C,SAAS,CAAY;IACpB,SAAS,CAA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C,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QAEtH,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IACT,uBAAuB,CAAC,OAAmB;QAChD,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,eAAe,CAAC,IAAqB,EAAE,IAAgB;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,IAAI,EAAE,CAAC;QAEP,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,+DAA+D;IAC/D,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACvD,2EAA2E;IAC3E,IAAW,kBAAkB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,gFAAgF;IAChF,IAAW,eAAe,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,gBAAgB;IAChB,IAAW,iBAAiB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACvE,gBAAgB;IAChB,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAAmC,EAAE,OAAmB;QACjF,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF;AAxID,oCAwIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Matrix3d, Point2d,\r\n Point3d, Range1d, Transform, XAndY,\r\n} from \"@itwin/core-geometry\";\r\nimport { Frustum, FrustumPlanes, ViewFlags } from \"@itwin/core-common\";\r\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\r\nimport { GraphicBuilder, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\r\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"./internal/render/RenderPlanarClassifier\";\r\nimport { RenderSystem, } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewingSpace } from \"./ViewingSpace\";\r\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\r\nimport { ActiveSpatialClassifier } from \"./SpatialClassifiersState\";\r\nimport { GraphicType } from \"./common/render/GraphicType\";\r\nimport { RenderTextureDrape } from \"./internal/render/RenderTextureDrape\";\r\n\r\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class RenderContext {\r\n /** ViewFlags extracted from the context's [[Viewport]]. */\r\n public readonly viewFlags: ViewFlags;\r\n private readonly _viewport: Viewport;\r\n /** Frustum extracted from the context's [[Viewport]]. */\r\n public readonly frustum: Frustum;\r\n /** Frustum planes extracted from the context's [[Viewport]]. */\r\n public readonly frustumPlanes: FrustumPlanes;\r\n\r\n constructor(vp: Viewport, frustum?: Frustum) {\r\n this._viewport = vp;\r\n this.viewFlags = vp.viewFlags;\r\n this.frustum = frustum ? frustum : vp.getFrustum();\r\n this.frustumPlanes = FrustumPlanes.fromFrustum(this.frustum);\r\n }\r\n\r\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\r\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\r\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\r\n }\r\n\r\n /** The [[Viewport]] associated with this context. */\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n /** The [[RenderSystem]] being used to produce graphics for this context. */\r\n public get renderSystem(): RenderSystem {\r\n return this.target.renderSystem;\r\n }\r\n\r\n /** @internal */\r\n public get target(): RenderTarget { return this.viewport.target; }\r\n\r\n /** @internal */\r\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\r\n }\r\n\r\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n */\r\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\r\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\r\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\r\n }\r\n\r\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\r\n * @param branch Contains the group of graphics and the symbology overrides.\r\n * @param location the local-to-world transform applied to the grouped graphics.\r\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\r\n * @see [[RenderSystem.createBranch]]\r\n */\r\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\r\n\r\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\r\n * Used when computing LOD for graphics.\r\n * @internal\r\n */\r\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\r\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\r\n }\r\n}\r\n\r\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\r\n * @see [[InteractiveTool.onDynamicFrame]]\r\n * @public\r\n */\r\nexport class DynamicsContext extends RenderContext {\r\n private _foreground?: GraphicList;\r\n private _overlay?: GraphicList;\r\n\r\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].\r\n * These graphics are drawn as [[GraphicType.Scene]].\r\n * @see [[addOverlay]] to add a graphic to be drawn as an overlay instead.\r\n */\r\n public addGraphic(graphic: RenderGraphic): void {\r\n this.add(graphic, false);\r\n }\r\n\r\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].\r\n * These graphics are drawn as part of the viewport's scene as described by [[GraphicType.Scene]], except\r\n * that they always draw on top of other graphics as with [[GraphicType.WorldOverlay]].\r\n * @see [[addGraphic]] to add an ordinary scene graphic instead.\r\n */\r\n public addOverlay(graphic: RenderGraphic): void {\r\n this.add(graphic, true);\r\n }\r\n\r\n /** @internal */\r\n public add(graphic: RenderGraphic, isOverlay: boolean) {\r\n const key = isOverlay ? \"_overlay\" : \"_foreground\";\r\n const list = this[key] ?? (this[key] = []);\r\n list.push(graphic);\r\n }\r\n\r\n /** @internal */\r\n public changeDynamics(): void {\r\n this.viewport.changeDynamics(this._foreground, this._overlay);\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[DecorateContext.create]].\r\n * @public\r\n */\r\nexport interface DecorateContextCreateArgs {\r\n /** The viewport to be decorated. */\r\n viewport: ScreenViewport;\r\n /** The set of decoration graphics to be populated by the context. */\r\n output: Decorations;\r\n /** Optional cache. If omitted, one will be created.\r\n * @internal\r\n */\r\n cache?: DecorationsCache;\r\n}\r\n\r\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class DecorateContext extends RenderContext {\r\n private readonly _decorations: Decorations;\r\n private readonly _cache: DecorationsCache;\r\n private _curCacheableDecorator?: ViewportDecorator;\r\n\r\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\r\n public override get viewport(): ScreenViewport {\r\n return super.viewport as ScreenViewport;\r\n }\r\n\r\n /** @internal */\r\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\r\n super(vp);\r\n this._decorations = decorations;\r\n this._cache = cache;\r\n }\r\n\r\n /** Create a new DecorateContext.\r\n * @param args Describes the inputs to the context.\r\n * @note Typically the [[ScreenViewport]] takes care of creating the context for you.\r\n * @public\r\n */\r\n public static create(args: DecorateContextCreateArgs): DecorateContext {\r\n return new DecorateContext(args.viewport, args.output, args.cache ?? new DecorationsCache());\r\n }\r\n\r\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @param type The type of builder to create.\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[createGraphic]] for more options.\r\n */\r\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\r\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n\r\n /** @internal */\r\n public addFromDecorator(decorator: ViewportDecorator): void {\r\n assert(undefined === this._curCacheableDecorator);\r\n try {\r\n if (decorator.useCachedDecorations) {\r\n const cached = this._cache.get(decorator);\r\n if (cached) {\r\n this.restoreCache(cached);\r\n return;\r\n }\r\n\r\n this._curCacheableDecorator = decorator;\r\n }\r\n\r\n decorator.decorate(this);\r\n } finally {\r\n this._curCacheableDecorator = undefined;\r\n }\r\n }\r\n\r\n /** Restores decorations onto this context from the specified array of cached decorations. */\r\n private restoreCache(cachedDecorations: CachedDecoration[]) {\r\n cachedDecorations.forEach((cachedDecoration) => {\r\n switch (cachedDecoration.type) {\r\n case \"graphic\":\r\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\r\n break;\r\n case \"canvas\":\r\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\r\n break;\r\n case \"html\":\r\n this.addHtmlDecoration(cachedDecoration.htmlElement);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _appendToCache(decoration: CachedDecoration) {\r\n assert(undefined !== this._curCacheableDecorator);\r\n this._cache.add(this._curCacheableDecorator, decoration);\r\n }\r\n\r\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\r\n * [[Decorations]].\r\n * @param builder The builder from which to extract the graphic.\r\n * @note The builder should not be used after calling this method.\r\n */\r\n public addDecorationFromBuilder(builder: GraphicBuilder) {\r\n this.addDecoration(builder.type, builder.finish());\r\n }\r\n\r\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\r\n * @param The type of the graphic, which determines to which list of decorations it is added.\r\n * @param decoration The decoration graphic to add.\r\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\r\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\r\n */\r\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\r\n if (this._curCacheableDecorator) {\r\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\r\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\r\n decoration = graphicOwner;\r\n }\r\n\r\n switch (type) {\r\n case GraphicType.Scene:\r\n if (undefined === this._decorations.normal)\r\n this._decorations.normal = [];\r\n this._decorations.normal.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldDecoration:\r\n if (!this._decorations.world)\r\n this._decorations.world = [];\r\n this._decorations.world.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldOverlay:\r\n if (!this._decorations.worldOverlay)\r\n this._decorations.worldOverlay = [];\r\n this._decorations.worldOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewOverlay:\r\n if (!this._decorations.viewOverlay)\r\n this._decorations.viewOverlay = [];\r\n this._decorations.viewOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewBackground:\r\n this.setViewBackground(decoration);\r\n break;\r\n }\r\n }\r\n\r\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\r\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\r\n\r\n if (undefined === this._decorations.canvasDecorations)\r\n this._decorations.canvasDecorations = [];\r\n\r\n const list = this._decorations.canvasDecorations;\r\n if (0 === list.length || true === atFront)\r\n list.push(decoration);\r\n else\r\n list.unshift(decoration);\r\n }\r\n\r\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\r\n public addHtmlDecoration(decoration: HTMLElement) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"html\", htmlElement: decoration });\r\n\r\n // an element decoration being added might already be on the decorationDiv, just marked for removal\r\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\r\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\r\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\r\n this.viewport.decorationDiv.appendChild(decoration);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\r\n const vp = this.viewport;\r\n\r\n if (vp.viewingGlobe)\r\n return;\r\n\r\n const color = vp.getContrastToBackgroundColor();\r\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\r\n if (planarGrid) {\r\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\r\n }\r\n }\r\n\r\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\r\n * @see [[RenderSystem.createSkyBox]].\r\n */\r\n public setSkyBox(graphic: RenderGraphic) {\r\n this._decorations.skyBox = graphic;\r\n }\r\n\r\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\r\n public setViewBackground(graphic: RenderGraphic) {\r\n this._decorations.viewBackground = graphic;\r\n }\r\n}\r\n\r\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\r\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\r\n * should be displayed in the viewport but are not yet loaded.\r\n * @public\r\n */\r\nexport class SceneContext extends RenderContext {\r\n private _missingChildTiles = false;\r\n /** The graphics comprising the scene. */\r\n public readonly scene = new Scene();\r\n\r\n /** @internal */\r\n public readonly missingTiles = new Set<Tile>();\r\n\r\n /** @internal */\r\n public markChildrenLoading(): void {\r\n this._missingChildTiles = true;\r\n }\r\n\r\n /** @internal */\r\n public get hasMissingTiles(): boolean {\r\n return this._missingChildTiles || this.missingTiles.size > 0;\r\n }\r\n\r\n private _viewingSpace?: ViewingSpace;\r\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\r\n\r\n public constructor(vp: Viewport, frustum?: Frustum) {\r\n super(vp, frustum);\r\n }\r\n\r\n /** The viewed volume containing the scene. */\r\n public get viewingSpace(): ViewingSpace {\r\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\r\n }\r\n\r\n /** @internal */\r\n public get graphicType() { return this._graphicType; }\r\n\r\n /** Add the specified graphic to the scene. */\r\n public outputGraphic(graphic: RenderGraphic): void {\r\n switch (this._graphicType) {\r\n case TileGraphicType.BackgroundMap:\r\n this.backgroundGraphics.push(graphic);\r\n break;\r\n case TileGraphicType.Overlay:\r\n this.overlayGraphics.push(graphic);\r\n break;\r\n default:\r\n this.graphics.push(graphic);\r\n break;\r\n }\r\n }\r\n\r\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\r\n public insertMissingTile(tile: Tile): void {\r\n switch (tile.loadStatus) {\r\n case TileLoadStatus.NotLoaded:\r\n case TileLoadStatus.Queued:\r\n case TileLoadStatus.Loading:\r\n this.missingTiles.add(tile);\r\n break;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public requestMissingTiles(): void {\r\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\r\n }\r\n\r\n /** @internal */\r\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\r\n // Target may have the classifier from a previous frame; if not we must create one.\r\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\r\n if (undefined === classifier)\r\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\r\n\r\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\r\n if (undefined !== classifier) {\r\n this.planarClassifiers.set(classifiedModelId, classifier);\r\n classifier.setSource(classifierTree, planarClipMask);\r\n }\r\n\r\n return classifier;\r\n }\r\n\r\n /** @internal */\r\n public getPlanarClassifierForModel(modelId: Id64String) {\r\n return this.planarClassifiers.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\r\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\r\n if (undefined === drapedTree)\r\n return undefined;\r\n\r\n const id = drapedTree.modelId;\r\n let drape = this.getTextureDrapeForModel(id);\r\n if (undefined !== drape)\r\n return drape;\r\n\r\n drape = this.viewport.target.getTextureDrape(id);\r\n if (undefined === drape && this.viewport.backgroundDrapeMap)\r\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\r\n\r\n if (undefined !== drape)\r\n this.textureDrapes.set(id, drape);\r\n\r\n return drape;\r\n }\r\n\r\n /** @internal */\r\n public getTextureDrapeForModel(modelId: Id64String) {\r\n return this.textureDrapes.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public withGraphicType(type: TileGraphicType, func: () => void): void {\r\n const prevType = this._graphicType;\r\n this._graphicType = type;\r\n\r\n func();\r\n\r\n this._graphicType = prevType;\r\n }\r\n\r\n /** The graphics in the scene that will be drawn with depth. */\r\n public get graphics() { return this.scene.foreground; }\r\n /** The graphics that will be drawn behind everything else in the scene. */\r\n public get backgroundGraphics() { return this.scene.background; }\r\n /** The graphics that will be drawn in front of everything else in the scene. */\r\n public get overlayGraphics() { return this.scene.overlay; }\r\n /** @internal */\r\n public get planarClassifiers() { return this.scene.planarClassifiers; }\r\n /** @internal */\r\n public get textureDrapes() { return this.scene.textureDrapes; }\r\n\r\n /** @internal */\r\n public setVolumeClassifier(classifier: ActiveSpatialClassifier, modelId: Id64String): void {\r\n this.scene.volumeClassifier = { classifier, modelId };\r\n }\r\n}\r\n"]}
@@ -119,7 +119,7 @@ class BackgroundMapDrape extends TextureDrape_1.TextureDrape {
119
119
  const prevPlan = target.plan;
120
120
  const drawingParams = PlanarTextureProjection_1.PlanarTextureProjection.getTextureDrawingParams(target);
121
121
  const stack = new BranchStack_1.BranchStack();
122
- stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline);
122
+ stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline, prevPlan.contours);
123
123
  stack.setSymbologyOverrides(this._symbologyOverrides);
124
124
  const batchState = new BatchState_1.BatchState(stack);
125
125
  System_1.System.instance.applyRenderState(drawingParams.state);
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundMapDrape.js","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/BackgroundMapDrape.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAAsD;AACtD,wDAA0G;AAC1G,oDAA0G;AAC1G,qDAA4G;AAG5G,uEAAoE;AAEpE,6CAA0C;AAC1C,+CAA4C;AAC5C,+CAA4C;AAC5C,6BAA0B;AAC1B,uEAAoE;AACpE,qDAAkD;AAElD,qCAAkC;AAElC,uCAAmD;AACnD,iDAA8C;AAE9C,gBAAgB;AAChB,MAAa,kBAAmB,SAAQ,2BAAY;IAC1C,IAAI,CAAe;IACV,SAAS,GAAoB,EAAE,CAAC;IACzC,QAAQ,CAAW;IACnB,MAAM,GAAG,CAAC,CAAC;IACX,OAAO,GAAG,CAAC,CAAC;IACZ,QAAQ,CAAuB;IAC/B,WAAW,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,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,mBAAmB;QACrF,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;IAChC,CAAC;;AA9JH,gDA+JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { assert, dispose } from \"@itwin/core-bentley\";\r\nimport { Matrix4d, Plane3dByOriginAndUnitNormal, Point3d, Range3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { ColorDef, Frustum, FrustumPlanes, RenderTexture, TextureTransparency } from \"@itwin/core-common\";\r\nimport { GraphicsCollectorDrawArgs, MapTileTreeReference, TileTreeReference } from \"../../../tile/internal\";\r\nimport { SceneContext } from \"../../../ViewContext\";\r\nimport { ViewState3d } from \"../../../ViewState\";\r\nimport { FeatureSymbology } from \"../../../render/FeatureSymbology\";\r\nimport { RenderGraphic } from \"../../../render/RenderGraphic\";\r\nimport { BatchState } from \"./BatchState\";\r\nimport { BranchStack } from \"./BranchStack\";\r\nimport { FrameBuffer } from \"./FrameBuffer\";\r\nimport { GL } from \"./GL\";\r\nimport { PlanarTextureProjection } from \"./PlanarTextureProjection\";\r\nimport { RenderCommands } from \"./RenderCommands\";\r\nimport { RenderPass } from \"./RenderFlags\";\r\nimport { System } from \"./System\";\r\nimport { Target } from \"./Target\";\r\nimport { Texture, TextureHandle } from \"./Texture\";\r\nimport { TextureDrape } from \"./TextureDrape\";\r\n\r\n/** @internal */\r\nexport class BackgroundMapDrape extends TextureDrape {\r\n private _fbo?: FrameBuffer;\r\n private readonly _graphics: RenderGraphic[] = [];\r\n private _frustum?: Frustum;\r\n private _width = 0;\r\n private _height = 0;\r\n private _mapTree: MapTileTreeReference;\r\n private _drapedTree: TileTreeReference;\r\n private static _postProjectionMatrix = Matrix4d.createRowValues(\r\n 0, 1, 0, 0,\r\n 0, 0, -1, 0,\r\n 1, 0, 0, 0,\r\n 0, 0, 0, 1);\r\n private _debugFrustum?: Frustum;\r\n private _debugFrustumGraphic?: RenderGraphic = undefined;\r\n private readonly _symbologyOverrides = new FeatureSymbology.Overrides();\r\n private readonly _bgColor = ColorDef.from(0, 0, 0, 255);\r\n private readonly _plane = Plane3dByOriginAndUnitNormal.create(Point3d.createZero(), Vector3d.create(0, 0, 1))!;\r\n\r\n private constructor(drapedTree: TileTreeReference, mapTree: MapTileTreeReference) {\r\n super();\r\n this._drapedTree = drapedTree;\r\n this._mapTree = mapTree;\r\n }\r\n\r\n public override get isDisposed(): boolean { return super.isDisposed && undefined === this._fbo; }\r\n\r\n public override[Symbol.dispose]() {\r\n super[Symbol.dispose]();\r\n this._fbo = dispose(this._fbo);\r\n }\r\n\r\n public addGraphic(graphic: RenderGraphic) {\r\n this._graphics.push(graphic);\r\n }\r\n\r\n public static create(draped: TileTreeReference, map: MapTileTreeReference): BackgroundMapDrape {\r\n return new BackgroundMapDrape(draped, map);\r\n }\r\n\r\n public collectGraphics(context: SceneContext) {\r\n this._graphics.length = 0;\r\n if (undefined === context.viewingSpace)\r\n return;\r\n\r\n const viewState = context.viewingSpace.view as ViewState3d;\r\n if (undefined === viewState)\r\n return;\r\n\r\n const tileTree = this._mapTree.treeOwner.load();\r\n if (undefined === tileTree || !this._mapTree.layerRefHandler.initializeLayers(context))\r\n return;\r\n\r\n const requiredWidth = 2 * Math.max(context.target.viewRect.width, context.target.viewRect.height); // TBD - Size to textured area.\r\n const requiredHeight = requiredWidth;\r\n\r\n if (requiredWidth !== this._width || requiredHeight !== this._height)\r\n this[Symbol.dispose]();\r\n\r\n this._width = requiredWidth;\r\n this._height = requiredHeight;\r\n\r\n const targetTree = this._drapedTree.treeOwner.tileTree;\r\n const args = this._drapedTree.createDrawArgs(context);\r\n if (!targetTree || !args)\r\n return;\r\n\r\n const targetTiles = targetTree.selectTiles(args);\r\n\r\n const projection = PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, { tiles: targetTiles, location: args.location }, [this._mapTree], viewState, this._width, this._height, Range3d.createNull());\r\n if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)\r\n return;\r\n\r\n this._frustum = projection.textureFrustum;\r\n this._debugFrustum = projection.debugFrustum;\r\n this._projectionMatrix = projection.projectionMatrix;\r\n\r\n const drawArgs = GraphicsCollectorDrawArgs.create(context, this, this._mapTree, FrustumPlanes.fromFrustum(this._frustum), projection.worldToViewMap);\r\n if (undefined !== drawArgs)\r\n tileTree.draw(drawArgs);\r\n\r\n if (context.target.debugControl && context.target.debugControl.displayDrapeFrustum) {\r\n this._debugFrustumGraphic = dispose(this._debugFrustumGraphic);\r\n const builder = context.createSceneGraphicBuilder();\r\n builder.setSymbology(ColorDef.green, ColorDef.green, 1);\r\n builder.addFrustum(context.viewingSpace.getFrustum());\r\n builder.setSymbology(ColorDef.red, ColorDef.red, 1);\r\n builder.addFrustum(this._debugFrustum!);\r\n builder.setSymbology(ColorDef.white, ColorDef.white, 1);\r\n builder.addFrustum(this._frustum);\r\n this._debugFrustumGraphic = builder.finish();\r\n }\r\n }\r\n\r\n public draw(target: Target) {\r\n if (undefined !== this._debugFrustumGraphic)\r\n target.graphics.foreground.push(this._debugFrustumGraphic);\r\n\r\n if (undefined === this._frustum || this._graphics.length === 0)\r\n return;\r\n\r\n if (undefined === this._fbo) {\r\n const colorTextureHandle = TextureHandle.createForAttachment(this._width, this._height, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\r\n if (undefined === colorTextureHandle) {\r\n assert(false, \"Failed to create planar texture\");\r\n return;\r\n }\r\n\r\n this._texture = new Texture({ ownership: \"external\", type: RenderTexture.Type.TileSection, handle: colorTextureHandle, transparency: TextureTransparency.Opaque });\r\n this._fbo = FrameBuffer.create([colorTextureHandle]);\r\n }\r\n if (undefined === this._fbo) {\r\n assert(false, \"unable to create frame buffer object\");\r\n return;\r\n }\r\n\r\n System.instance.glTimer.beginOperation(\"Terrain Projection\");\r\n\r\n const prevState = System.instance.currentRenderState.clone();\r\n System.instance.context.viewport(0, 0, this._width, this._height);\r\n\r\n const prevPlan = target.plan;\r\n const drawingParams = PlanarTextureProjection.getTextureDrawingParams(target);\r\n const stack = new BranchStack();\r\n stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline);\r\n stack.setSymbologyOverrides(this._symbologyOverrides);\r\n\r\n const batchState = new BatchState(stack);\r\n System.instance.applyRenderState(drawingParams.state);\r\n\r\n target.uniforms.style.changeBackgroundColor(this._bgColor); // Avoid white on white reversal. Will be reset below in changeRenderPlan().\r\n target.changeFrustum(this._frustum, this._frustum.getFraction(), true);\r\n\r\n const prevProjMatrix = target.uniforms.frustum.projectionMatrix;\r\n target.uniforms.frustum.changeProjectionMatrix(BackgroundMapDrape._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));\r\n\r\n target.uniforms.branch.pushState(stack.top);\r\n\r\n const renderCommands = new RenderCommands(target, stack, batchState);\r\n renderCommands.addGraphics(this._graphics, RenderPass.OpaqueGeneral);\r\n\r\n const system = System.instance;\r\n const gl = system.context;\r\n\r\n system.frameBufferStack.execute(this._fbo, true, false, () => {\r\n gl.clearColor(0, 0, 0, 0);\r\n gl.clear(GL.BufferBit.Color);\r\n target.techniques.execute(target, renderCommands.getCommands(RenderPass.OpaqueGeneral), RenderPass.PlanarClassification); // Draw these with RenderPass.PlanarClassification (rather than Opaque...) so that the pick ordering is avoided.\r\n });\r\n\r\n target.uniforms.branch.pop();\r\n\r\n batchState.reset(); // Reset the batch Ids...\r\n target.changeRenderPlan(prevPlan);\r\n\r\n system.applyRenderState(prevState);\r\n gl.viewport(0, 0, target.viewRect.width, target.viewRect.height); // Restore viewport\r\n system.glTimer.endOperation();\r\n }\r\n}\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,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE;YAC3D,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1B,EAAE,CAAC,KAAK,CAAC,OAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC7B,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,WAAW,kCAA0B,2CAAkC,CAAC,CAAI,gHAAgH;QAC/O,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAE7B,UAAU,CAAC,KAAK,EAAE,CAAC,CAAG,yBAAyB;QAC/C,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAElC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACnC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,mBAAmB;QACrF,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;IAChC,CAAC;;AA9JH,gDA+JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { assert, dispose } from \"@itwin/core-bentley\";\r\nimport { Matrix4d, Plane3dByOriginAndUnitNormal, Point3d, Range3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { ColorDef, Frustum, FrustumPlanes, RenderTexture, TextureTransparency } from \"@itwin/core-common\";\r\nimport { GraphicsCollectorDrawArgs, MapTileTreeReference, TileTreeReference } from \"../../../tile/internal\";\r\nimport { SceneContext } from \"../../../ViewContext\";\r\nimport { ViewState3d } from \"../../../ViewState\";\r\nimport { FeatureSymbology } from \"../../../render/FeatureSymbology\";\r\nimport { RenderGraphic } from \"../../../render/RenderGraphic\";\r\nimport { BatchState } from \"./BatchState\";\r\nimport { BranchStack } from \"./BranchStack\";\r\nimport { FrameBuffer } from \"./FrameBuffer\";\r\nimport { GL } from \"./GL\";\r\nimport { PlanarTextureProjection } from \"./PlanarTextureProjection\";\r\nimport { RenderCommands } from \"./RenderCommands\";\r\nimport { RenderPass } from \"./RenderFlags\";\r\nimport { System } from \"./System\";\r\nimport { Target } from \"./Target\";\r\nimport { Texture, TextureHandle } from \"./Texture\";\r\nimport { TextureDrape } from \"./TextureDrape\";\r\n\r\n/** @internal */\r\nexport class BackgroundMapDrape extends TextureDrape {\r\n private _fbo?: FrameBuffer;\r\n private readonly _graphics: RenderGraphic[] = [];\r\n private _frustum?: Frustum;\r\n private _width = 0;\r\n private _height = 0;\r\n private _mapTree: MapTileTreeReference;\r\n private _drapedTree: TileTreeReference;\r\n private static _postProjectionMatrix = Matrix4d.createRowValues(\r\n 0, 1, 0, 0,\r\n 0, 0, -1, 0,\r\n 1, 0, 0, 0,\r\n 0, 0, 0, 1);\r\n private _debugFrustum?: Frustum;\r\n private _debugFrustumGraphic?: RenderGraphic = undefined;\r\n private readonly _symbologyOverrides = new FeatureSymbology.Overrides();\r\n private readonly _bgColor = ColorDef.from(0, 0, 0, 255);\r\n private readonly _plane = Plane3dByOriginAndUnitNormal.create(Point3d.createZero(), Vector3d.create(0, 0, 1))!;\r\n\r\n private constructor(drapedTree: TileTreeReference, mapTree: MapTileTreeReference) {\r\n super();\r\n this._drapedTree = drapedTree;\r\n this._mapTree = mapTree;\r\n }\r\n\r\n public override get isDisposed(): boolean { return super.isDisposed && undefined === this._fbo; }\r\n\r\n public override[Symbol.dispose]() {\r\n super[Symbol.dispose]();\r\n this._fbo = dispose(this._fbo);\r\n }\r\n\r\n public addGraphic(graphic: RenderGraphic) {\r\n this._graphics.push(graphic);\r\n }\r\n\r\n public static create(draped: TileTreeReference, map: MapTileTreeReference): BackgroundMapDrape {\r\n return new BackgroundMapDrape(draped, map);\r\n }\r\n\r\n public collectGraphics(context: SceneContext) {\r\n this._graphics.length = 0;\r\n if (undefined === context.viewingSpace)\r\n return;\r\n\r\n const viewState = context.viewingSpace.view as ViewState3d;\r\n if (undefined === viewState)\r\n return;\r\n\r\n const tileTree = this._mapTree.treeOwner.load();\r\n if (undefined === tileTree || !this._mapTree.layerRefHandler.initializeLayers(context))\r\n return;\r\n\r\n const requiredWidth = 2 * Math.max(context.target.viewRect.width, context.target.viewRect.height); // TBD - Size to textured area.\r\n const requiredHeight = requiredWidth;\r\n\r\n if (requiredWidth !== this._width || requiredHeight !== this._height)\r\n this[Symbol.dispose]();\r\n\r\n this._width = requiredWidth;\r\n this._height = requiredHeight;\r\n\r\n const targetTree = this._drapedTree.treeOwner.tileTree;\r\n const args = this._drapedTree.createDrawArgs(context);\r\n if (!targetTree || !args)\r\n return;\r\n\r\n const targetTiles = targetTree.selectTiles(args);\r\n\r\n const projection = PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, { tiles: targetTiles, location: args.location }, [this._mapTree], viewState, this._width, this._height, Range3d.createNull());\r\n if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)\r\n return;\r\n\r\n this._frustum = projection.textureFrustum;\r\n this._debugFrustum = projection.debugFrustum;\r\n this._projectionMatrix = projection.projectionMatrix;\r\n\r\n const drawArgs = GraphicsCollectorDrawArgs.create(context, this, this._mapTree, FrustumPlanes.fromFrustum(this._frustum), projection.worldToViewMap);\r\n if (undefined !== drawArgs)\r\n tileTree.draw(drawArgs);\r\n\r\n if (context.target.debugControl && context.target.debugControl.displayDrapeFrustum) {\r\n this._debugFrustumGraphic = dispose(this._debugFrustumGraphic);\r\n const builder = context.createSceneGraphicBuilder();\r\n builder.setSymbology(ColorDef.green, ColorDef.green, 1);\r\n builder.addFrustum(context.viewingSpace.getFrustum());\r\n builder.setSymbology(ColorDef.red, ColorDef.red, 1);\r\n builder.addFrustum(this._debugFrustum!);\r\n builder.setSymbology(ColorDef.white, ColorDef.white, 1);\r\n builder.addFrustum(this._frustum);\r\n this._debugFrustumGraphic = builder.finish();\r\n }\r\n }\r\n\r\n public draw(target: Target) {\r\n if (undefined !== this._debugFrustumGraphic)\r\n target.graphics.foreground.push(this._debugFrustumGraphic);\r\n\r\n if (undefined === this._frustum || this._graphics.length === 0)\r\n return;\r\n\r\n if (undefined === this._fbo) {\r\n const colorTextureHandle = TextureHandle.createForAttachment(this._width, this._height, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\r\n if (undefined === colorTextureHandle) {\r\n assert(false, \"Failed to create planar texture\");\r\n return;\r\n }\r\n\r\n this._texture = new Texture({ ownership: \"external\", type: RenderTexture.Type.TileSection, handle: colorTextureHandle, transparency: TextureTransparency.Opaque });\r\n this._fbo = FrameBuffer.create([colorTextureHandle]);\r\n }\r\n if (undefined === this._fbo) {\r\n assert(false, \"unable to create frame buffer object\");\r\n return;\r\n }\r\n\r\n System.instance.glTimer.beginOperation(\"Terrain Projection\");\r\n\r\n const prevState = System.instance.currentRenderState.clone();\r\n System.instance.context.viewport(0, 0, this._width, this._height);\r\n\r\n const prevPlan = target.plan;\r\n const drawingParams = PlanarTextureProjection.getTextureDrawingParams(target);\r\n const stack = new BranchStack();\r\n stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline, prevPlan.contours);\r\n stack.setSymbologyOverrides(this._symbologyOverrides);\r\n\r\n const batchState = new BatchState(stack);\r\n System.instance.applyRenderState(drawingParams.state);\r\n\r\n target.uniforms.style.changeBackgroundColor(this._bgColor); // Avoid white on white reversal. Will be reset below in changeRenderPlan().\r\n target.changeFrustum(this._frustum, this._frustum.getFraction(), true);\r\n\r\n const prevProjMatrix = target.uniforms.frustum.projectionMatrix;\r\n target.uniforms.frustum.changeProjectionMatrix(BackgroundMapDrape._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));\r\n\r\n target.uniforms.branch.pushState(stack.top);\r\n\r\n const renderCommands = new RenderCommands(target, stack, batchState);\r\n renderCommands.addGraphics(this._graphics, RenderPass.OpaqueGeneral);\r\n\r\n const system = System.instance;\r\n const gl = system.context;\r\n\r\n system.frameBufferStack.execute(this._fbo, true, false, () => {\r\n gl.clearColor(0, 0, 0, 0);\r\n gl.clear(GL.BufferBit.Color);\r\n target.techniques.execute(target, renderCommands.getCommands(RenderPass.OpaqueGeneral), RenderPass.PlanarClassification); // Draw these with RenderPass.PlanarClassification (rather than Opaque...) so that the pick ordering is avoided.\r\n });\r\n\r\n target.uniforms.branch.pop();\r\n\r\n batchState.reset(); // Reset the batch Ids...\r\n target.changeRenderPlan(prevPlan);\r\n\r\n system.applyRenderState(prevState);\r\n gl.viewport(0, 0, target.viewRect.width, target.viewRect.height); // Restore viewport\r\n system.glTimer.endOperation();\r\n }\r\n}\r\n"]}
@@ -495,7 +495,7 @@ class PlanarClassifier extends RenderPlanarClassifier_1.RenderPlanarClassifier {
495
495
  this._anyTranslucent = false;
496
496
  const prevProjMatrix = target.uniforms.frustum.projectionMatrix;
497
497
  target.uniforms.frustum.changeProjectionMatrix(PlanarClassifier._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));
498
- target.uniforms.branch.changeRenderPlan(vf, target.plan.is3d, target.plan.hline);
498
+ target.uniforms.branch.changeRenderPlan(vf, target.plan.is3d, target.plan.hline, target.plan.contours);
499
499
  const addCmds = (oldCmds, newCmds) => {
500
500
  if (undefined === newCmds)
501
501
  return oldCmds;