@itwin/core-frontend 4.7.4 → 4.7.6
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 +15 -1
- package/lib/cjs/PlanarClipMaskState.d.ts +3 -1
- package/lib/cjs/PlanarClipMaskState.d.ts.map +1 -1
- package/lib/cjs/PlanarClipMaskState.js +14 -7
- package/lib/cjs/PlanarClipMaskState.js.map +1 -1
- package/lib/cjs/SpatialViewState.d.ts +2 -1
- package/lib/cjs/SpatialViewState.d.ts.map +1 -1
- package/lib/cjs/SpatialViewState.js +3 -2
- package/lib/cjs/SpatialViewState.js.map +1 -1
- package/lib/cjs/render/GraphicBuilder.d.ts +4 -0
- package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBuilder.js +49 -0
- package/lib/cjs/render/GraphicBuilder.js.map +1 -1
- package/lib/cjs/render/RenderTarget.d.ts +1 -0
- package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
- package/lib/cjs/render/RenderTarget.js.map +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js +17 -9
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts +3 -3
- package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.js +53 -19
- package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/cjs/render/webgl/SolarShadowMap.js +2 -2
- package/lib/cjs/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/cjs/render/webgl/Target.d.ts +1 -0
- package/lib/cjs/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Target.js +1 -0
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.d.ts +2 -2
- package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.js +8 -3
- package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.d.ts +1 -0
- package/lib/cjs/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.js +5 -3
- package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.js +7 -2
- package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/PlanarClipMaskState.d.ts +3 -1
- package/lib/esm/PlanarClipMaskState.d.ts.map +1 -1
- package/lib/esm/PlanarClipMaskState.js +14 -7
- package/lib/esm/PlanarClipMaskState.js.map +1 -1
- package/lib/esm/SpatialViewState.d.ts +2 -1
- package/lib/esm/SpatialViewState.d.ts.map +1 -1
- package/lib/esm/SpatialViewState.js +3 -2
- package/lib/esm/SpatialViewState.js.map +1 -1
- package/lib/esm/render/GraphicBuilder.d.ts +4 -0
- package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/esm/render/GraphicBuilder.js +49 -0
- package/lib/esm/render/GraphicBuilder.js.map +1 -1
- package/lib/esm/render/RenderTarget.d.ts +1 -0
- package/lib/esm/render/RenderTarget.d.ts.map +1 -1
- package/lib/esm/render/RenderTarget.js.map +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js +2 -2
- package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js +18 -10
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.d.ts +3 -3
- package/lib/esm/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.js +54 -20
- package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/esm/render/webgl/SolarShadowMap.js +2 -2
- package/lib/esm/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/esm/render/webgl/Target.d.ts +1 -0
- package/lib/esm/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/render/webgl/Target.js +1 -0
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.d.ts +2 -2
- package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.js +8 -3
- package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.d.ts +1 -0
- package/lib/esm/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.js +5 -3
- package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.js +7 -2
- package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @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S,CAAC,CAAC,CAAC;IAEtF,oBAAoB,CAAC,OAAoE;QAC9F,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAEM,OAAO,KAAW,CAAC;IACnB,KAAK,KAAW,CAAC;IAMjB,wBAAwB,CAAC,IAAgC,IAAU,CAAC;IACpE,YAAY,CAAC,QAAmB,IAAU,CAAC;IAC3C,UAAU,CAAC,UAAsB,EAAE,UAAkB,IAAU,CAAC;IAChE,cAAc,CAAC,SAAmB,EAAE,mBAA8C,IAAU,CAAC;IAE7F,SAAS,KAAW,CAAC;IAI5B,8CAA8C;IACvC,SAAS,CAAC,KAAe,EAAE,WAAoB,EAAE,eAAwB,IAA6B,OAAO,SAAS,CAAC,CAAC,CAAC;IACzH,eAAe,CAAC,KAA2B,IAA6B,OAAO,SAAS,CAAC,CAAC,CAAC;IAC3F,iBAAiB,KAAwB,OAAO,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnF,iBAAiB,CAAC,MAA+B,IAAU,CAAC;IAEnE;;;OAGG;IACI,iBAAiB,CAAC,SAAkB,IAAmC,OAAO,SAAS,CAAC,CAAC,CAAC;IAEjG,IAAW,YAAY,KAA2C,OAAO,SAAS,CAAC,CAAC,CAAC;IAUrF;;OAEG;IACI,wBAAwB,CAAC,QAAkC,EAAE,OAAyB,EAAE,QAAsC;QACnI,QAAQ,CAAC,EAAE,CAAC,CAAC;IACf,CAAC;CACF;AAxFD,oCAwFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String, IDisposable } from \"@itwin/core-bentley\";\nimport { Frustum, ImageBuffer } from \"@itwin/core-common\";\nimport { Point2d, XAndY } from \"@itwin/core-geometry\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { HiliteSet } from \"../SelectionSet\";\nimport { SceneContext } from \"../ViewContext\";\nimport { ReadImageBufferArgs, Viewport } from \"../Viewport\";\nimport { ViewRect } from \"../common/ViewRect\";\nimport { CanvasDecoration } from \"./CanvasDecoration\";\nimport { Decorations } from \"./Decorations\";\nimport { FeatureSymbology } from \"./FeatureSymbology\";\nimport { FrameStatsCollector } from \"./FrameStats\";\nimport { AnimationBranchStates } from \"./GraphicBranch\";\nimport { CustomGraphicBuilderOptions, ViewportGraphicBuilderOptions } from \"./GraphicBuilder\";\nimport { Pixel } from \"./Pixel\";\nimport { GraphicList } from \"./RenderGraphic\";\nimport { RenderMemory } from \"./RenderMemory\";\nimport { RenderPlan } from \"./RenderPlan\";\nimport { RenderPlanarClassifier } from \"./RenderPlanarClassifier\";\nimport { RenderSystem, RenderTextureDrape } from \"./RenderSystem\";\nimport { Scene } from \"./Scene\";\nimport { QueryTileFeaturesOptions, QueryVisibleFeaturesCallback } from \"./VisibleFeature\";\nimport { ActiveSpatialClassifier } from \"../SpatialClassifiersState\";\n\n/** Used for debugging purposes, to toggle display of instanced or batched primitives.\n * @see [[RenderTargetDebugControl]].\n * @internal\n */\nexport enum PrimitiveVisibility {\n /** Draw all primitives. */\n All,\n /** Only draw instanced primitives. */\n Instanced,\n /** Only draw un-instanced primitives. */\n Uninstanced,\n}\n\n/** An interface optionally exposed by a RenderTarget that allows control of various debugging features.\n * @internal\n */\nexport interface RenderTargetDebugControl {\n /** If true, render to the screen as if rendering off-screen for readPixels(). */\n drawForReadPixels: boolean;\n primitiveVisibility: PrimitiveVisibility;\n vcSupportIntersectingVolumes: boolean;\n readonly shadowFrustum: Frustum | undefined;\n displayDrapeFrustum: boolean;\n /** Override device pixel ratio for on-screen targets only. This supersedes window.devicePixelRatio.\n * Undefined clears the override. Chiefly useful for tests.\n */\n devicePixelRatioOverride?: number;\n displayRealityTilePreload: boolean;\n displayRealityTileRanges: boolean;\n logRealityTiles: boolean;\n displayNormalMaps: boolean;\n freezeRealityTiles: boolean;\n /** Obtain a summary of the render commands required to draw the scene currently displayed.\n * Each entry specifies the type of command and the number of such commands required by the current scene.\n */\n getRenderCommands(): Array<{ name: string, count: number }>;\n}\n\n/** A RenderTarget connects a [[Viewport]] to a WebGLRenderingContext to enable the viewport's contents to be displayed on the screen.\n * Application code rarely interacts directly with a RenderTarget - instead, it interacts with a Viewport which forwards requests to the implementation\n * of the RenderTarget.\n * @internal\n */\nexport abstract class RenderTarget implements IDisposable, RenderMemory.Consumer {\n public pickOverlayDecoration(_pt: XAndY): CanvasDecoration | undefined { return undefined; }\n\n public abstract get renderSystem(): RenderSystem;\n\n /** NB: *Device pixels*, not CSS pixels! */\n public abstract get viewRect(): ViewRect;\n\n public get devicePixelRatio(): number { return 1; }\n public cssPixelsToDevicePixels(cssPixels: number, floor = true): number {\n const pix = cssPixels * this.devicePixelRatio;\n return floor ? Math.floor(pix) : pix;\n }\n\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`.\n * Used when computing LOD for graphics.\n */\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\n return this.renderSystem.dpiAwareLOD ? this.cssPixelsToDevicePixels(cssPixelSize, false) : cssPixelSize;\n }\n\n public abstract get wantInvertBlackBackground(): boolean;\n\n public abstract get analysisFraction(): number;\n public abstract set analysisFraction(fraction: number);\n\n public get animationBranches(): AnimationBranchStates | undefined { return undefined; }\n public set animationBranches(_transforms: AnimationBranchStates | undefined) { }\n\n public get antialiasSamples(): number { return 1; }\n public set antialiasSamples(_numSamples: number) { }\n\n public assignFrameStatsCollector(_collector: FrameStatsCollector) { }\n\n /** Update the solar shadow map. If a SceneContext is supplied, shadows are enabled; otherwise, shadows are disabled. */\n public updateSolarShadows(_context: SceneContext | undefined): void { }\n public getPlanarClassifier(_id: string): RenderPlanarClassifier | undefined { return undefined; }\n public createPlanarClassifier(_properties?: ActiveSpatialClassifier): RenderPlanarClassifier | undefined { return undefined; }\n public getTextureDrape(_id: Id64String): RenderTextureDrape | undefined { return undefined; }\n\n public createGraphicBuilder(options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions) {\n return this.renderSystem.createGraphic(options);\n }\n\n public dispose(): void { }\n public reset(): void { }\n public abstract changeScene(scene: Scene): void;\n public abstract changeDynamics(dynamics?: GraphicList): void;\n public abstract changeDecorations(decorations: Decorations): void;\n public abstract changeRenderPlan(plan: RenderPlan): void;\n public abstract drawFrame(sceneMilSecElapsed?: number): void;\n public overrideFeatureSymbology(_ovr: FeatureSymbology.Overrides): void { }\n public setHiliteSet(_hilited: HiliteSet): void { }\n public setFlashed(_elementId: Id64String, _intensity: number): void { }\n public onBeforeRender(_viewport: Viewport, _setSceneNeedRedraw: (redraw: boolean) => void): void { }\n public abstract setViewRect(_rect: ViewRect, _temporary: boolean): void;\n public onResized(): void { }\n public abstract updateViewRect(): boolean; // force a RenderTarget viewRect to resize if necessary since last draw\n /** `rect` is specified in *CSS* pixels. */\n public abstract readPixels(rect: ViewRect, selector: Pixel.Selector, receiver: Pixel.Receiver, excludeNonLocatable: boolean): void;\n /** @deprecated in 3.x. use readImageBuffer */\n public readImage(_rect: ViewRect, _targetSize: Point2d, _flipVertically: boolean): ImageBuffer | undefined { return undefined; }\n public readImageBuffer(_args?: ReadImageBufferArgs): ImageBuffer | undefined { return undefined; }\n public readImageToCanvas(): HTMLCanvasElement { return document.createElement(\"canvas\"); }\n public collectStatistics(_stats: RenderMemory.Statistics): void { }\n\n /** Specify whether webgl content should be rendered directly to the screen.\n * If rendering to screen becomes enabled, returns the canvas to which to render the webgl content.\n * Returns undefined if rendering to screen becomes disabled, or is not supported by this RenderTarget.\n */\n public setRenderToScreen(_toScreen: boolean): HTMLCanvasElement | undefined { return undefined; }\n\n public get debugControl(): RenderTargetDebugControl | undefined { return undefined; }\n\n /** An ordered list of names of screen-space post-processing effects to be applied to the image produced by this target.\n * The effects are applied in the order in which they appear in the list. Any names not corresponding to a registered effect are ignored.\n * This may have no effect if this target does not support screen-space effects.\n * @see [[RenderSystem.createScreenSpaceEffectBuilder]] to create and register new effects.\n */\n public abstract get screenSpaceEffects(): Iterable<string>;\n public abstract set screenSpaceEffects(_effectNames: Iterable<string>);\n\n /** Implementation for [[Viewport.queryVisibleFeatures]]. Not intended for direct usage. The returned iterable remains valid only for the duration of the\n * Viewport.queryVisibleFeatures call.\n */\n public queryVisibleTileFeatures(_options: QueryTileFeaturesOptions, _iModel: IModelConnection, callback: QueryVisibleFeaturesCallback): void {\n callback([]);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RenderTarget.js","sourceRoot":"","sources":["../../../src/render/RenderTarget.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA0BH;;;GAGG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,2BAA2B;IAC3B,2DAAG,CAAA;IACH,sCAAsC;IACtC,uEAAS,CAAA;IACT,yCAAyC;IACzC,2EAAW,CAAA;AACb,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AA4BD;;;;GAIG;AACH,MAAsB,YAAY;IACzB,qBAAqB,CAAC,GAAU,IAAkC,OAAO,SAAS,CAAC,CAAC,CAAC;IAO5F,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5C,uBAAuB,CAAC,SAAiB,EAAE,KAAK,GAAG,IAAI;QAC5D,MAAM,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC9C,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,qBAAqB,CAAC,YAAoB;QAC/C,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,YAA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AAC,CAAC,CAAC;IAEjG,IAAW,YAAY,KAA2C,OAAO,SAAS,CAAC,CAAC,CAAC;IAUrF;;OAEG;IACI,wBAAwB,CAAC,QAAkC,EAAE,OAAyB,EAAE,QAAsC;QACnI,QAAQ,CAAC,EAAE,CAAC,CAAC;IACf,CAAC;CACF;AAxFD,oCAwFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String, IDisposable } from \"@itwin/core-bentley\";\nimport { Frustum, ImageBuffer } from \"@itwin/core-common\";\nimport { Point2d, XAndY } from \"@itwin/core-geometry\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { HiliteSet } from \"../SelectionSet\";\nimport { SceneContext } from \"../ViewContext\";\nimport { ReadImageBufferArgs, Viewport } from \"../Viewport\";\nimport { ViewRect } from \"../common/ViewRect\";\nimport { CanvasDecoration } from \"./CanvasDecoration\";\nimport { Decorations } from \"./Decorations\";\nimport { FeatureSymbology } from \"./FeatureSymbology\";\nimport { FrameStatsCollector } from \"./FrameStats\";\nimport { AnimationBranchStates } from \"./GraphicBranch\";\nimport { CustomGraphicBuilderOptions, ViewportGraphicBuilderOptions } from \"./GraphicBuilder\";\nimport { Pixel } from \"./Pixel\";\nimport { GraphicList } from \"./RenderGraphic\";\nimport { RenderMemory } from \"./RenderMemory\";\nimport { RenderPlan } from \"./RenderPlan\";\nimport { RenderPlanarClassifier } from \"./RenderPlanarClassifier\";\nimport { RenderSystem, RenderTextureDrape } from \"./RenderSystem\";\nimport { Scene } from \"./Scene\";\nimport { QueryTileFeaturesOptions, QueryVisibleFeaturesCallback } from \"./VisibleFeature\";\nimport { ActiveSpatialClassifier } from \"../SpatialClassifiersState\";\n\n/** Used for debugging purposes, to toggle display of instanced or batched primitives.\n * @see [[RenderTargetDebugControl]].\n * @internal\n */\nexport enum PrimitiveVisibility {\n /** Draw all primitives. */\n All,\n /** Only draw instanced primitives. */\n Instanced,\n /** Only draw un-instanced primitives. */\n Uninstanced,\n}\n\n/** An interface optionally exposed by a RenderTarget that allows control of various debugging features.\n * @internal\n */\nexport interface RenderTargetDebugControl {\n /** If true, render to the screen as if rendering off-screen for readPixels(). */\n drawForReadPixels: boolean;\n primitiveVisibility: PrimitiveVisibility;\n vcSupportIntersectingVolumes: boolean;\n readonly shadowFrustum: Frustum | undefined;\n displayDrapeFrustum: boolean;\n displayMaskFrustum: boolean;\n /** Override device pixel ratio for on-screen targets only. This supersedes window.devicePixelRatio.\n * Undefined clears the override. Chiefly useful for tests.\n */\n devicePixelRatioOverride?: number;\n displayRealityTilePreload: boolean;\n displayRealityTileRanges: boolean;\n logRealityTiles: boolean;\n displayNormalMaps: boolean;\n freezeRealityTiles: boolean;\n /** Obtain a summary of the render commands required to draw the scene currently displayed.\n * Each entry specifies the type of command and the number of such commands required by the current scene.\n */\n getRenderCommands(): Array<{ name: string, count: number }>;\n}\n\n/** A RenderTarget connects a [[Viewport]] to a WebGLRenderingContext to enable the viewport's contents to be displayed on the screen.\n * Application code rarely interacts directly with a RenderTarget - instead, it interacts with a Viewport which forwards requests to the implementation\n * of the RenderTarget.\n * @internal\n */\nexport abstract class RenderTarget implements IDisposable, RenderMemory.Consumer {\n public pickOverlayDecoration(_pt: XAndY): CanvasDecoration | undefined { return undefined; }\n\n public abstract get renderSystem(): RenderSystem;\n\n /** NB: *Device pixels*, not CSS pixels! */\n public abstract get viewRect(): ViewRect;\n\n public get devicePixelRatio(): number { return 1; }\n public cssPixelsToDevicePixels(cssPixels: number, floor = true): number {\n const pix = cssPixels * this.devicePixelRatio;\n return floor ? Math.floor(pix) : pix;\n }\n\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`.\n * Used when computing LOD for graphics.\n */\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\n return this.renderSystem.dpiAwareLOD ? this.cssPixelsToDevicePixels(cssPixelSize, false) : cssPixelSize;\n }\n\n public abstract get wantInvertBlackBackground(): boolean;\n\n public abstract get analysisFraction(): number;\n public abstract set analysisFraction(fraction: number);\n\n public get animationBranches(): AnimationBranchStates | undefined { return undefined; }\n public set animationBranches(_transforms: AnimationBranchStates | undefined) { }\n\n public get antialiasSamples(): number { return 1; }\n public set antialiasSamples(_numSamples: number) { }\n\n public assignFrameStatsCollector(_collector: FrameStatsCollector) { }\n\n /** Update the solar shadow map. If a SceneContext is supplied, shadows are enabled; otherwise, shadows are disabled. */\n public updateSolarShadows(_context: SceneContext | undefined): void { }\n public getPlanarClassifier(_id: string): RenderPlanarClassifier | undefined { return undefined; }\n public createPlanarClassifier(_properties?: ActiveSpatialClassifier): RenderPlanarClassifier | undefined { return undefined; }\n public getTextureDrape(_id: Id64String): RenderTextureDrape | undefined { return undefined; }\n\n public createGraphicBuilder(options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions) {\n return this.renderSystem.createGraphic(options);\n }\n\n public dispose(): void { }\n public reset(): void { }\n public abstract changeScene(scene: Scene): void;\n public abstract changeDynamics(dynamics?: GraphicList): void;\n public abstract changeDecorations(decorations: Decorations): void;\n public abstract changeRenderPlan(plan: RenderPlan): void;\n public abstract drawFrame(sceneMilSecElapsed?: number): void;\n public overrideFeatureSymbology(_ovr: FeatureSymbology.Overrides): void { }\n public setHiliteSet(_hilited: HiliteSet): void { }\n public setFlashed(_elementId: Id64String, _intensity: number): void { }\n public onBeforeRender(_viewport: Viewport, _setSceneNeedRedraw: (redraw: boolean) => void): void { }\n public abstract setViewRect(_rect: ViewRect, _temporary: boolean): void;\n public onResized(): void { }\n public abstract updateViewRect(): boolean; // force a RenderTarget viewRect to resize if necessary since last draw\n /** `rect` is specified in *CSS* pixels. */\n public abstract readPixels(rect: ViewRect, selector: Pixel.Selector, receiver: Pixel.Receiver, excludeNonLocatable: boolean): void;\n /** @deprecated in 3.x. use readImageBuffer */\n public readImage(_rect: ViewRect, _targetSize: Point2d, _flipVertically: boolean): ImageBuffer | undefined { return undefined; }\n public readImageBuffer(_args?: ReadImageBufferArgs): ImageBuffer | undefined { return undefined; }\n public readImageToCanvas(): HTMLCanvasElement { return document.createElement(\"canvas\"); }\n public collectStatistics(_stats: RenderMemory.Statistics): void { }\n\n /** Specify whether webgl content should be rendered directly to the screen.\n * If rendering to screen becomes enabled, returns the canvas to which to render the webgl content.\n * Returns undefined if rendering to screen becomes disabled, or is not supported by this RenderTarget.\n */\n public setRenderToScreen(_toScreen: boolean): HTMLCanvasElement | undefined { return undefined; }\n\n public get debugControl(): RenderTargetDebugControl | undefined { return undefined; }\n\n /** An ordered list of names of screen-space post-processing effects to be applied to the image produced by this target.\n * The effects are applied in the order in which they appear in the list. Any names not corresponding to a registered effect are ignored.\n * This may have no effect if this target does not support screen-space effects.\n * @see [[RenderSystem.createScreenSpaceEffectBuilder]] to create and register new effects.\n */\n public abstract get screenSpaceEffects(): Iterable<string>;\n public abstract set screenSpaceEffects(_effectNames: Iterable<string>);\n\n /** Implementation for [[Viewport.queryVisibleFeatures]]. Not intended for direct usage. The returned iterable remains valid only for the duration of the\n * Viewport.queryVisibleFeatures call.\n */\n public queryVisibleTileFeatures(_options: QueryTileFeaturesOptions, _iModel: IModelConnection, callback: QueryVisibleFeaturesCallback): void {\n callback([]);\n }\n}\n"]}
|
|
@@ -68,7 +68,7 @@ class BackgroundMapDrape extends TextureDrape_1.TextureDrape {
|
|
|
68
68
|
if (!targetTree || !args)
|
|
69
69
|
return;
|
|
70
70
|
const targetTiles = targetTree.selectTiles(args);
|
|
71
|
-
const projection = PlanarTextureProjection_1.PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, { tiles: targetTiles, location: args.location }, [this._mapTree], viewState, this._width, this._height);
|
|
71
|
+
const projection = PlanarTextureProjection_1.PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, { tiles: targetTiles, location: args.location }, [this._mapTree], viewState, this._width, this._height, core_geometry_1.Range3d.createNull());
|
|
72
72
|
if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)
|
|
73
73
|
return;
|
|
74
74
|
this._frustum = projection.textureFrustum;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundMapDrape.js","sourceRoot":"","sources":["../../../../src/render/webgl/BackgroundMapDrape.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAAsD;AACtD,wDAAiG;AACjG,oDAA0G;AAC1G,kDAAyG;AAGzG,0DAAuD;AAEvD,6CAA0C;AAC1C,+CAA4C;AAC5C,+CAA4C;AAC5C,6BAA0B;AAC1B,uEAAoE;AACpE,qDAAkD;AAElD,qCAAkC;AAElC,uCAAmD;AACnD,iDAA8C;AAE9C,gBAAgB;AAChB,MAAa,kBAAmB,SAAQ,2BAAY;IAmBlD,YAAoB,UAA6B,EAAE,OAA6B;QAC9E,KAAK,EAAE,CAAC;QAlBO,cAAS,GAAoB,EAAE,CAAC;QAEzC,WAAM,GAAG,CAAC,CAAC;QACX,YAAO,GAAG,CAAC,CAAC;QASZ,yBAAoB,GAAmB,SAAS,CAAC;QACxC,wBAAmB,GAAG,IAAI,mCAAgB,CAAC,SAAS,EAAE,CAAC;QACvD,aAAQ,GAAG,sBAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACvC,WAAM,GAAG,4CAA4B,CAAC,MAAM,CAAC,uBAAO,CAAC,UAAU,EAAE,EAAE,wBAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAE,CAAC;QAI7G,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,IAAoB,UAAU,KAAc,OAAO,KAAK,CAAC,UAAU,IAAI,SAAS,KAAK,IAAI,CAAC,IAAI,CAA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AC/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;AAvJgB,wCAAqB,GAAG,wBAAQ,CAAC,eAAe,CAC7D,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EACX,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,AAJuB,CAItB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module WebGL\n */\n\nimport { assert, dispose } from \"@itwin/core-bentley\";\nimport { Matrix4d, Plane3dByOriginAndUnitNormal, Point3d, Vector3d } from \"@itwin/core-geometry\";\nimport { ColorDef, Frustum, FrustumPlanes, RenderTexture, TextureTransparency } from \"@itwin/core-common\";\nimport { GraphicsCollectorDrawArgs, MapTileTreeReference, TileTreeReference } from \"../../tile/internal\";\nimport { SceneContext } from \"../../ViewContext\";\nimport { ViewState3d } from \"../../ViewState\";\nimport { FeatureSymbology } from \"../FeatureSymbology\";\nimport { RenderGraphic } from \"../RenderGraphic\";\nimport { BatchState } from \"./BatchState\";\nimport { BranchStack } from \"./BranchStack\";\nimport { FrameBuffer } from \"./FrameBuffer\";\nimport { GL } from \"./GL\";\nimport { PlanarTextureProjection } from \"./PlanarTextureProjection\";\nimport { RenderCommands } from \"./RenderCommands\";\nimport { RenderPass } from \"./RenderFlags\";\nimport { System } from \"./System\";\nimport { Target } from \"./Target\";\nimport { Texture, TextureHandle } from \"./Texture\";\nimport { TextureDrape } from \"./TextureDrape\";\n\n/** @internal */\nexport class BackgroundMapDrape extends TextureDrape {\n private _fbo?: FrameBuffer;\n private readonly _graphics: RenderGraphic[] = [];\n private _frustum?: Frustum;\n private _width = 0;\n private _height = 0;\n private _mapTree: MapTileTreeReference;\n private _drapedTree: TileTreeReference;\n private static _postProjectionMatrix = Matrix4d.createRowValues(\n 0, 1, 0, 0,\n 0, 0, -1, 0,\n 1, 0, 0, 0,\n 0, 0, 0, 1);\n private _debugFrustum?: Frustum;\n private _debugFrustumGraphic?: RenderGraphic = undefined;\n private readonly _symbologyOverrides = new FeatureSymbology.Overrides();\n private readonly _bgColor = ColorDef.from(0, 0, 0, 255);\n private readonly _plane = Plane3dByOriginAndUnitNormal.create(Point3d.createZero(), Vector3d.create(0, 0, 1))!;\n\n private constructor(drapedTree: TileTreeReference, mapTree: MapTileTreeReference) {\n super();\n this._drapedTree = drapedTree;\n this._mapTree = mapTree;\n }\n\n public override get isDisposed(): boolean { return super.isDisposed && undefined === this._fbo; }\n\n public override dispose() {\n super.dispose();\n this._fbo = dispose(this._fbo);\n }\n\n public addGraphic(graphic: RenderGraphic) {\n this._graphics.push(graphic);\n }\n\n public static create(draped: TileTreeReference, map: MapTileTreeReference): BackgroundMapDrape {\n return new BackgroundMapDrape(draped, map);\n }\n\n public collectGraphics(context: SceneContext) {\n this._graphics.length = 0;\n if (undefined === context.viewingSpace)\n return;\n\n const viewState = context.viewingSpace.view as ViewState3d;\n if (undefined === viewState)\n return;\n\n const tileTree = this._mapTree.treeOwner.load();\n if (undefined === tileTree || !this._mapTree.initializeLayers(context))\n return;\n\n const requiredWidth = 2 * Math.max(context.target.viewRect.width, context.target.viewRect.height); // TBD - Size to textured area.\n const requiredHeight = requiredWidth;\n\n if (requiredWidth !== this._width || requiredHeight !== this._height)\n this.dispose();\n\n this._width = requiredWidth;\n this._height = requiredHeight;\n\n const targetTree = this._drapedTree.treeOwner.tileTree;\n const args = this._drapedTree.createDrawArgs(context);\n if (!targetTree || !args)\n return;\n\n const targetTiles = targetTree.selectTiles(args);\n\n const projection = PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, { tiles: targetTiles, location: args.location }, [this._mapTree], viewState, this._width, this._height);\n if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)\n return;\n\n this._frustum = projection.textureFrustum;\n this._debugFrustum = projection.debugFrustum;\n this._projectionMatrix = projection.projectionMatrix;\n\n const drawArgs = GraphicsCollectorDrawArgs.create(context, this, this._mapTree, FrustumPlanes.fromFrustum(this._frustum), projection.worldToViewMap);\n if (undefined !== drawArgs)\n tileTree.draw(drawArgs);\n\n if (context.target.debugControl && context.target.debugControl.displayDrapeFrustum) {\n this._debugFrustumGraphic = dispose(this._debugFrustumGraphic);\n const builder = context.createSceneGraphicBuilder();\n builder.setSymbology(ColorDef.green, ColorDef.green, 1);\n builder.addFrustum(context.viewingSpace.getFrustum());\n builder.setSymbology(ColorDef.red, ColorDef.red, 1);\n builder.addFrustum(this._debugFrustum!);\n builder.setSymbology(ColorDef.white, ColorDef.white, 1);\n builder.addFrustum(this._frustum);\n this._debugFrustumGraphic = builder.finish();\n }\n }\n\n public draw(target: Target) {\n if (undefined !== this._debugFrustumGraphic)\n target.graphics.foreground.push(this._debugFrustumGraphic);\n\n if (undefined === this._frustum || this._graphics.length === 0)\n return;\n\n if (undefined === this._fbo) {\n const colorTextureHandle = TextureHandle.createForAttachment(this._width, this._height, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\n if (undefined === colorTextureHandle) {\n assert(false, \"Failed to create planar texture\");\n return;\n }\n\n this._texture = new Texture({ ownership: \"external\", type: RenderTexture.Type.TileSection, handle: colorTextureHandle, transparency: TextureTransparency.Opaque });\n this._fbo = FrameBuffer.create([colorTextureHandle]);\n }\n if (undefined === this._fbo) {\n assert(false, \"unable to create frame buffer object\");\n return;\n }\n\n System.instance.glTimer.beginOperation(\"Terrain Projection\");\n\n const prevState = System.instance.currentRenderState.clone();\n System.instance.context.viewport(0, 0, this._width, this._height);\n\n const prevPlan = target.plan;\n const drawingParams = PlanarTextureProjection.getTextureDrawingParams(target);\n const stack = new BranchStack();\n stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline);\n stack.setSymbologyOverrides(this._symbologyOverrides);\n\n const batchState = new BatchState(stack);\n System.instance.applyRenderState(drawingParams.state);\n\n target.uniforms.style.changeBackgroundColor(this._bgColor); // Avoid white on white reversal. Will be reset below in changeRenderPlan().\n target.changeFrustum(this._frustum, this._frustum.getFraction(), true);\n\n const prevProjMatrix = target.uniforms.frustum.projectionMatrix;\n target.uniforms.frustum.changeProjectionMatrix(BackgroundMapDrape._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));\n\n target.uniforms.branch.pushState(stack.top);\n\n const renderCommands = new RenderCommands(target, stack, batchState);\n renderCommands.addGraphics(this._graphics, RenderPass.OpaqueGeneral);\n\n const system = System.instance;\n const gl = system.context;\n\n system.frameBufferStack.execute(this._fbo, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\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.\n });\n\n target.uniforms.branch.pop();\n\n batchState.reset(); // Reset the batch Ids...\n target.changeRenderPlan(prevPlan);\n\n system.applyRenderState(prevState);\n gl.viewport(0, 0, target.viewRect.width, target.viewRect.height); // Restore viewport\n system.glTimer.endOperation();\n }\n}\n"]}
|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AAC,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;AAvJgB,wCAAqB,GAAG,wBAAQ,CAAC,eAAe,CAC7D,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EACX,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,AAJuB,CAItB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module WebGL\n */\n\nimport { assert, dispose } from \"@itwin/core-bentley\";\nimport { Matrix4d, Plane3dByOriginAndUnitNormal, Point3d, Range3d, Vector3d } from \"@itwin/core-geometry\";\nimport { ColorDef, Frustum, FrustumPlanes, RenderTexture, TextureTransparency } from \"@itwin/core-common\";\nimport { GraphicsCollectorDrawArgs, MapTileTreeReference, TileTreeReference } from \"../../tile/internal\";\nimport { SceneContext } from \"../../ViewContext\";\nimport { ViewState3d } from \"../../ViewState\";\nimport { FeatureSymbology } from \"../FeatureSymbology\";\nimport { RenderGraphic } from \"../RenderGraphic\";\nimport { BatchState } from \"./BatchState\";\nimport { BranchStack } from \"./BranchStack\";\nimport { FrameBuffer } from \"./FrameBuffer\";\nimport { GL } from \"./GL\";\nimport { PlanarTextureProjection } from \"./PlanarTextureProjection\";\nimport { RenderCommands } from \"./RenderCommands\";\nimport { RenderPass } from \"./RenderFlags\";\nimport { System } from \"./System\";\nimport { Target } from \"./Target\";\nimport { Texture, TextureHandle } from \"./Texture\";\nimport { TextureDrape } from \"./TextureDrape\";\n\n/** @internal */\nexport class BackgroundMapDrape extends TextureDrape {\n private _fbo?: FrameBuffer;\n private readonly _graphics: RenderGraphic[] = [];\n private _frustum?: Frustum;\n private _width = 0;\n private _height = 0;\n private _mapTree: MapTileTreeReference;\n private _drapedTree: TileTreeReference;\n private static _postProjectionMatrix = Matrix4d.createRowValues(\n 0, 1, 0, 0,\n 0, 0, -1, 0,\n 1, 0, 0, 0,\n 0, 0, 0, 1);\n private _debugFrustum?: Frustum;\n private _debugFrustumGraphic?: RenderGraphic = undefined;\n private readonly _symbologyOverrides = new FeatureSymbology.Overrides();\n private readonly _bgColor = ColorDef.from(0, 0, 0, 255);\n private readonly _plane = Plane3dByOriginAndUnitNormal.create(Point3d.createZero(), Vector3d.create(0, 0, 1))!;\n\n private constructor(drapedTree: TileTreeReference, mapTree: MapTileTreeReference) {\n super();\n this._drapedTree = drapedTree;\n this._mapTree = mapTree;\n }\n\n public override get isDisposed(): boolean { return super.isDisposed && undefined === this._fbo; }\n\n public override dispose() {\n super.dispose();\n this._fbo = dispose(this._fbo);\n }\n\n public addGraphic(graphic: RenderGraphic) {\n this._graphics.push(graphic);\n }\n\n public static create(draped: TileTreeReference, map: MapTileTreeReference): BackgroundMapDrape {\n return new BackgroundMapDrape(draped, map);\n }\n\n public collectGraphics(context: SceneContext) {\n this._graphics.length = 0;\n if (undefined === context.viewingSpace)\n return;\n\n const viewState = context.viewingSpace.view as ViewState3d;\n if (undefined === viewState)\n return;\n\n const tileTree = this._mapTree.treeOwner.load();\n if (undefined === tileTree || !this._mapTree.initializeLayers(context))\n return;\n\n const requiredWidth = 2 * Math.max(context.target.viewRect.width, context.target.viewRect.height); // TBD - Size to textured area.\n const requiredHeight = requiredWidth;\n\n if (requiredWidth !== this._width || requiredHeight !== this._height)\n this.dispose();\n\n this._width = requiredWidth;\n this._height = requiredHeight;\n\n const targetTree = this._drapedTree.treeOwner.tileTree;\n const args = this._drapedTree.createDrawArgs(context);\n if (!targetTree || !args)\n return;\n\n const targetTiles = targetTree.selectTiles(args);\n\n const projection = PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, { tiles: targetTiles, location: args.location }, [this._mapTree], viewState, this._width, this._height, Range3d.createNull());\n if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)\n return;\n\n this._frustum = projection.textureFrustum;\n this._debugFrustum = projection.debugFrustum;\n this._projectionMatrix = projection.projectionMatrix;\n\n const drawArgs = GraphicsCollectorDrawArgs.create(context, this, this._mapTree, FrustumPlanes.fromFrustum(this._frustum), projection.worldToViewMap);\n if (undefined !== drawArgs)\n tileTree.draw(drawArgs);\n\n if (context.target.debugControl && context.target.debugControl.displayDrapeFrustum) {\n this._debugFrustumGraphic = dispose(this._debugFrustumGraphic);\n const builder = context.createSceneGraphicBuilder();\n builder.setSymbology(ColorDef.green, ColorDef.green, 1);\n builder.addFrustum(context.viewingSpace.getFrustum());\n builder.setSymbology(ColorDef.red, ColorDef.red, 1);\n builder.addFrustum(this._debugFrustum!);\n builder.setSymbology(ColorDef.white, ColorDef.white, 1);\n builder.addFrustum(this._frustum);\n this._debugFrustumGraphic = builder.finish();\n }\n }\n\n public draw(target: Target) {\n if (undefined !== this._debugFrustumGraphic)\n target.graphics.foreground.push(this._debugFrustumGraphic);\n\n if (undefined === this._frustum || this._graphics.length === 0)\n return;\n\n if (undefined === this._fbo) {\n const colorTextureHandle = TextureHandle.createForAttachment(this._width, this._height, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\n if (undefined === colorTextureHandle) {\n assert(false, \"Failed to create planar texture\");\n return;\n }\n\n this._texture = new Texture({ ownership: \"external\", type: RenderTexture.Type.TileSection, handle: colorTextureHandle, transparency: TextureTransparency.Opaque });\n this._fbo = FrameBuffer.create([colorTextureHandle]);\n }\n if (undefined === this._fbo) {\n assert(false, \"unable to create frame buffer object\");\n return;\n }\n\n System.instance.glTimer.beginOperation(\"Terrain Projection\");\n\n const prevState = System.instance.currentRenderState.clone();\n System.instance.context.viewport(0, 0, this._width, this._height);\n\n const prevPlan = target.plan;\n const drawingParams = PlanarTextureProjection.getTextureDrawingParams(target);\n const stack = new BranchStack();\n stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline);\n stack.setSymbologyOverrides(this._symbologyOverrides);\n\n const batchState = new BatchState(stack);\n System.instance.applyRenderState(drawingParams.state);\n\n target.uniforms.style.changeBackgroundColor(this._bgColor); // Avoid white on white reversal. Will be reset below in changeRenderPlan().\n target.changeFrustum(this._frustum, this._frustum.getFraction(), true);\n\n const prevProjMatrix = target.uniforms.frustum.projectionMatrix;\n target.uniforms.frustum.changeProjectionMatrix(BackgroundMapDrape._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));\n\n target.uniforms.branch.pushState(stack.top);\n\n const renderCommands = new RenderCommands(target, stack, batchState);\n renderCommands.addGraphics(this._graphics, RenderPass.OpaqueGeneral);\n\n const system = System.instance;\n const gl = system.context;\n\n system.frameBufferStack.execute(this._fbo, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\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.\n });\n\n target.uniforms.branch.pop();\n\n batchState.reset(); // Reset the batch Ids...\n target.changeRenderPlan(prevPlan);\n\n system.applyRenderState(prevState);\n gl.viewport(0, 0, target.viewRect.width, target.viewRect.height); // Restore viewport\n system.glTimer.endOperation();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarClassifier.d.ts","sourceRoot":"","sources":["../../../../src/render/webgl/PlanarClassifier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AAI,OAAO,GAAG,SAAS,CAAwG;IACvJ,IAAW,gBAAgB,IAAI,QAAQ,CAAmC;IAE1E,IAAW,WAAW,IAAI,MAAM,CAA8B;IAC9D,IAAW,UAAU,IAAI,OAAO,CAA6B;IAC7D,IAAW,SAAS,IAAI,OAAO,CAA4B;IAC3D,IAAW,cAAc,IAAI,OAAO,CAAiC;IACrE,IAAW,aAAa,IAAI,8BAA8B,CAAkG;IAC5J,IAAW,cAAc,IAAI,+BAA+B,CAAmG;IAC/J,IAAW,uBAAuB,IAAI,OAAO,CAAmD;IAEzF,UAAU,CAAC,OAAO,EAAE,aAAa;WAI1B,MAAM,CAAC,UAAU,EAAE,uBAAuB,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB;IAIhG,iBAAiB,CAAC,KAAK,EAAE,YAAY,CAAC,UAAU,GAAG,IAAI;IAc9D,IAAW,UAAU,IAAI,OAAO,CAAkD;IAE3E,OAAO;IAWd,IAAW,OAAO,IAAI,OAAO,GAAG,SAAS,CAWxC;IACM,4BAA4B,IAAI,OAAO,GAAG,SAAS;IAS1D,OAAO,CAAC,WAAW;IAUnB,IAAW,kBAAkB,uBAE5B;IAEM,cAAc,CAAC,UAAU,EAAE,UAAU;IAMrC,SAAS,CAAC,iBAAiB,CAAC,EAAE,kCAAkC,EAAE,cAAc,CAAC,EAAE,mBAAmB;IAMtG,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAuF5E,IAAI,CAAC,MAAM,EAAE,MAAM;CAkI3B"}
|
|
@@ -322,19 +322,22 @@ class PlanarClassifier extends RenderPlanarClassifier_1.RenderPlanarClassifier {
|
|
|
322
322
|
const viewState = context.viewingSpace.view;
|
|
323
323
|
if (!viewState.isSpatialView())
|
|
324
324
|
return;
|
|
325
|
-
|
|
326
|
-
const
|
|
325
|
+
this._doDebugFrustum = context.target.debugControl?.displayMaskFrustum ?? false;
|
|
326
|
+
const maxTextureSize = System_1.System.instance.maxTexSizeAllow;
|
|
327
|
+
const requiredHeight = maxTextureSize;
|
|
328
|
+
const requiredWidth = maxTextureSize;
|
|
327
329
|
if (requiredWidth !== this._width || requiredHeight !== this._height)
|
|
328
330
|
this.dispose();
|
|
329
331
|
this._width = requiredWidth;
|
|
330
332
|
this._height = requiredHeight;
|
|
331
|
-
const
|
|
333
|
+
const maskRange = core_geometry_1.Range3d.createNull();
|
|
334
|
+
const maskTrees = this._planarClipMask?.getTileTrees(viewState, target.modelId, maskRange);
|
|
332
335
|
if (!maskTrees && !this._classifierTreeRef)
|
|
333
336
|
return;
|
|
334
337
|
const allTrees = maskTrees ? maskTrees.slice() : new Array();
|
|
335
338
|
if (this._classifierTreeRef)
|
|
336
339
|
allTrees.push(this._classifierTreeRef);
|
|
337
|
-
const projection = PlanarTextureProjection_1.PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, target, allTrees, viewState, this._width, this._height);
|
|
340
|
+
const projection = PlanarTextureProjection_1.PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, target, allTrees, viewState, this._width, this._height, maskRange);
|
|
338
341
|
if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)
|
|
339
342
|
return;
|
|
340
343
|
this._projectionMatrix = projection.projectionMatrix;
|
|
@@ -368,13 +371,20 @@ class PlanarClassifier extends RenderPlanarClassifier_1.RenderPlanarClassifier {
|
|
|
368
371
|
if (this._doDebugFrustum) {
|
|
369
372
|
this._debugFrustumGraphic = (0, core_bentley_1.dispose)(this._debugFrustumGraphic);
|
|
370
373
|
const builder = context.createSceneGraphicBuilder();
|
|
371
|
-
builder.setSymbology(core_common_1.ColorDef.green, core_common_1.ColorDef.green,
|
|
374
|
+
builder.setSymbology(core_common_1.ColorDef.green, core_common_1.ColorDef.green, 2);
|
|
372
375
|
builder.addFrustum(context.viewingSpace.getFrustum());
|
|
373
|
-
builder.setSymbology(core_common_1.ColorDef.red, core_common_1.ColorDef.red,
|
|
376
|
+
builder.setSymbology(core_common_1.ColorDef.red, core_common_1.ColorDef.red, 2);
|
|
374
377
|
builder.addFrustum(this._debugFrustum);
|
|
375
|
-
builder.setSymbology(core_common_1.ColorDef.
|
|
378
|
+
builder.setSymbology(core_common_1.ColorDef.blue, core_common_1.ColorDef.blue, 2);
|
|
376
379
|
builder.addFrustum(this._frustum);
|
|
380
|
+
builder.setSymbology(core_common_1.ColorDef.from(0, 200, 0, 222), core_common_1.ColorDef.from(0, 200, 0, 222), 2);
|
|
381
|
+
builder.addFrustumSides(context.viewingSpace.getFrustum());
|
|
382
|
+
builder.setSymbology(core_common_1.ColorDef.from(200, 0, 0, 222), core_common_1.ColorDef.from(200, 0, 0, 222), 2);
|
|
383
|
+
builder.addFrustumSides(this._debugFrustum);
|
|
384
|
+
builder.setSymbology(core_common_1.ColorDef.from(0, 0, 200, 222), core_common_1.ColorDef.from(0, 0, 200, 222), 2);
|
|
385
|
+
builder.addFrustumSides(this._frustum);
|
|
377
386
|
this._debugFrustumGraphic = builder.finish();
|
|
387
|
+
context.outputGraphic(this._debugFrustumGraphic);
|
|
378
388
|
}
|
|
379
389
|
}
|
|
380
390
|
draw(target) {
|
|
@@ -425,8 +435,6 @@ class PlanarClassifier extends RenderPlanarClassifier_1.RenderPlanarClassifier {
|
|
|
425
435
|
this._contentMode = PlanarClassifierContent.ClassifierAndMask;
|
|
426
436
|
}
|
|
427
437
|
}
|
|
428
|
-
if (undefined !== this._debugFrustumGraphic)
|
|
429
|
-
target.graphics.foreground.push(this._debugFrustumGraphic);
|
|
430
438
|
// Temporarily override the Target's state.
|
|
431
439
|
const system = System_1.System.instance;
|
|
432
440
|
const maskViewFlags = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarClassifier.js","sourceRoot":"","sources":["../../../../src/render/webgl/PlanarClassifier.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA8C;AAC9C,oDAE4B;AAC5B,wDAAiG;AAEjG,kDAAu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EpC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAClC,MAAM,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAE/C,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/E,CAAC;;AA1WH,4CA2WC;AA/UgB,sCAAqB,GAAG,wBAAQ,CAAC,eAAe,CAC7D,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EACX,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,AAJuB,CAItB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module WebGL\n */\n\nimport { dispose } from \"@itwin/core-bentley\";\nimport {\n ColorDef, Frustum, FrustumPlanes, RenderMode, RenderTexture, SpatialClassifierInsideDisplay, SpatialClassifierOutsideDisplay, TextureTransparency,\n} from \"@itwin/core-common\";\nimport { Matrix4d, Plane3dByOriginAndUnitNormal, Point3d, Vector3d } from \"@itwin/core-geometry\";\nimport { PlanarClipMaskState } from \"../../PlanarClipMaskState\";\nimport { GraphicsCollectorDrawArgs, SpatialClassifierTileTreeReference, TileTreeReference } from \"../../tile/internal\";\nimport { SceneContext } from \"../../ViewContext\";\nimport { FeatureSymbology } from \"../FeatureSymbology\";\nimport { RenderGraphic } from \"../RenderGraphic\";\nimport { RenderMemory } from \"../RenderMemory\";\nimport { PlanarClassifierTarget, RenderPlanarClassifier } from \"../RenderPlanarClassifier\";\nimport { BatchState } from \"./BatchState\";\nimport { BranchStack } from \"./BranchStack\";\nimport { CachedGeometry, Combine3TexturesGeometry, CombineTexturesGeometry, ViewportQuadGeometry } from \"./CachedGeometry\";\nimport { WebGLDisposable } from \"./Disposable\";\nimport { DrawCommands } from \"./DrawCommand\";\nimport { FrameBuffer } from \"./FrameBuffer\";\nimport { GL } from \"./GL\";\nimport { Batch, Branch } from \"./Graphic\";\nimport { PlanarTextureProjection } from \"./PlanarTextureProjection\";\nimport { RenderCommands } from \"./RenderCommands\";\nimport { RenderPass } from \"./RenderFlags\";\nimport { RenderState } from \"./RenderState\";\nimport { getDrawParams } from \"./ScratchDrawParams\";\nimport { System } from \"./System\";\nimport { Target } from \"./Target\";\nimport { TechniqueId } from \"./TechniqueId\";\nimport { Texture, TextureHandle } from \"./Texture\";\nimport { ActiveSpatialClassifier } from \"../../SpatialClassifiersState\";\n\nexport enum PlanarClassifierContent { None = 0, MaskOnly = 1, ClassifierOnly = 2, ClassifierAndMask = 3 }\n\nfunction createTexture(handle: TextureHandle): Texture {\n return new Texture({\n handle,\n ownership: \"external\",\n type: RenderTexture.Type.TileSection,\n transparency: TextureTransparency.Opaque,\n });\n}\n\nfunction createTextureHandle(width: number, height: number, heightMult = 1.0) {\n return TextureHandle.createForAttachment(width, height * heightMult, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\n}\n\nclass ClassifierTextures implements WebGLDisposable {\n private constructor(public readonly color: Texture,\n public readonly feature: Texture,\n public readonly hilite: Texture) { }\n\n public get isDisposed(): boolean {\n return this.color.isDisposed\n && this.feature.isDisposed\n && this.hilite.isDisposed;\n }\n\n public dispose(): void {\n dispose(this.color);\n dispose(this.feature);\n dispose(this.hilite);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n stats.addPlanarClassifier(this.color.bytesUsed);\n stats.addPlanarClassifier(this.feature.bytesUsed);\n stats.addPlanarClassifier(this.hilite.bytesUsed);\n }\n\n public static create(width: number, height: number): ClassifierTextures | undefined {\n const hColor = createTextureHandle(width, height);\n const hFeature = createTextureHandle(width, height);\n const hHilite = createTextureHandle(width, height);\n if (!hColor || !hFeature || !hHilite)\n return undefined;\n\n const color = createTexture(hColor);\n const feature = createTexture(hFeature);\n const hilite = createTexture(hHilite);\n if (!color || !feature || !hilite)\n return undefined;\n\n return new ClassifierTextures(color, feature, hilite);\n }\n}\n\nclass ClassifierFrameBuffers implements WebGLDisposable {\n private constructor(\n public readonly textures: ClassifierTextures,\n private readonly _hilite: FrameBuffer,\n private readonly _fbo: FrameBuffer,\n private readonly _clearGeom: ViewportQuadGeometry) {\n }\n\n public get isDisposed(): boolean {\n return this.textures.isDisposed && this._hilite.isDisposed && this._fbo.isDisposed && this._clearGeom.isDisposed;\n }\n\n public dispose(): void {\n dispose(this._fbo);\n dispose(this._clearGeom);\n dispose(this.textures);\n dispose(this._hilite);\n }\n\n public draw(cmds: DrawCommands, target: Target): void {\n System.instance.frameBufferStack.execute(this._fbo, true, false, () => {\n target.techniques.draw(getDrawParams(target, this._clearGeom));\n target.techniques.execute(target, cmds, RenderPass.PlanarClassification);\n });\n }\n\n public drawHilite(cmds: DrawCommands, target: Target): void {\n const system = System.instance;\n const gl = system.context;\n system.frameBufferStack.execute(this._hilite, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\n target.techniques.execute(target, cmds, RenderPass.Hilite);\n });\n }\n\n public static create(width: number, height: number): ClassifierFrameBuffers | undefined {\n const textures = ClassifierTextures.create(width, height);\n if (undefined === textures)\n return undefined;\n\n const hiliteFbo = FrameBuffer.create([textures.hilite.texture]);\n if (undefined === hiliteFbo)\n return undefined;\n\n const fbo = FrameBuffer.create([textures.color.texture, textures.feature.texture]);\n if (undefined === fbo)\n return undefined;\n\n const geom = ViewportQuadGeometry.create(TechniqueId.ClearPickAndColor);\n return undefined !== geom ? new this(textures, hiliteFbo, fbo, geom) : undefined;\n }\n}\n\ninterface TextureAndFbo {\n texture: Texture;\n fbo: FrameBuffer;\n}\n\nabstract class SingleTextureFrameBuffer implements WebGLDisposable {\n public texture: Texture;\n protected fbo: FrameBuffer;\n public get isDisposed(): boolean { return this.texture.isDisposed && this.fbo.isDisposed; }\n public collectStatistics(stats: RenderMemory.Statistics): void { stats.addPlanarClassifier(this.texture.bytesUsed); }\n protected constructor(textureAndFbo: TextureAndFbo) {\n this.texture = textureAndFbo.texture;\n this.fbo = textureAndFbo.fbo;\n }\n public dispose(): void {\n dispose(this.texture);\n dispose(this.fbo);\n }\n public static createTextureAndFrameBuffer(width: number, height: number): TextureAndFbo | undefined {\n const hTexture = TextureHandle.createForAttachment(width, height, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\n if (!hTexture)\n return undefined;\n\n const texture = new Texture({ type: RenderTexture.Type.TileSection, ownership: \"external\", handle: hTexture, transparency: TextureTransparency.Opaque });\n if (!texture)\n return undefined;\n\n const fbo = FrameBuffer.create([texture.texture]);\n if (undefined === fbo)\n return undefined;\n\n return { texture, fbo };\n }\n}\nclass MaskFrameBuffer extends SingleTextureFrameBuffer {\n public static create(width: number, height: number): MaskFrameBuffer | undefined {\n const textureFbo = SingleTextureFrameBuffer.createTextureAndFrameBuffer(width, height);\n return undefined === textureFbo ? undefined : new MaskFrameBuffer(textureFbo);\n }\n public draw(cmds: DrawCommands, target: Target): void {\n const system = System.instance;\n const gl = system.context;\n\n system.frameBufferStack.execute(this.fbo, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\n target.techniques.execute(target, cmds, RenderPass.PlanarClassification);\n });\n }\n}\nabstract class CombineTexturesFrameBuffer extends SingleTextureFrameBuffer {\n constructor(textureAndFbo: TextureAndFbo, private _combineGeom: CachedGeometry, private _width: number, private _height: number, private _heightMult: number) { super(textureAndFbo); }\n public compose(target: Target): void {\n const system = System.instance;\n const gl = system.context;\n system.context.viewport(0, 0, this._width, this._heightMult * this._height);\n system.frameBufferStack.execute(this.fbo, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\n target.techniques.draw(getDrawParams(target, this._combineGeom));\n });\n }\n}\n\nclass ClassifierCombinationBuffer extends CombineTexturesFrameBuffer {\n public static create(width: number, height: number, classifierColor: Texture, classifierFeature: Texture): ClassifierAndMaskCombinationBuffer | undefined {\n const combineGeom = CombineTexturesGeometry.createGeometry(classifierColor.texture.getHandle()!, classifierFeature.texture.getHandle()!);\n if (undefined === combineGeom)\n return undefined;\n\n const textureFbo = SingleTextureFrameBuffer.createTextureAndFrameBuffer(width, 2 * height);\n return undefined === textureFbo ? undefined : new ClassifierCombinationBuffer(textureFbo, combineGeom, width, height, 2);\n }\n}\nclass ClassifierAndMaskCombinationBuffer extends CombineTexturesFrameBuffer {\n public static create(width: number, height: number, classifierColor: Texture, classifierFeature: Texture, mask: Texture): ClassifierAndMaskCombinationBuffer | undefined {\n const combineGeom = Combine3TexturesGeometry.createGeometry(classifierColor.texture.getHandle()!, classifierFeature.texture.getHandle()!, mask.texture.getHandle()!);\n if (undefined === combineGeom)\n return undefined;\n\n const textureFbo = SingleTextureFrameBuffer.createTextureAndFrameBuffer(width, 3 * height);\n return undefined === textureFbo ? undefined : new ClassifierAndMaskCombinationBuffer(textureFbo, combineGeom, width, height, 3);\n }\n}\n\nconst scratchPrevRenderState = new RenderState();\n\n/** @internal */\nexport class PlanarClassifier extends RenderPlanarClassifier implements RenderMemory.Consumer, WebGLDisposable {\n private _classifierBuffers?: ClassifierFrameBuffers;\n private _maskBuffer?: MaskFrameBuffer;\n private _classifierCombinedBuffer?: ClassifierCombinationBuffer;\n private _classifierAndMaskCombinedBuffer?: ClassifierAndMaskCombinationBuffer;\n private _projectionMatrix = Matrix4d.createIdentity();\n private _graphics?: RenderGraphic[];\n private readonly _classifierGraphics: RenderGraphic[] = [];\n private readonly _maskGraphics: RenderGraphic[] = [];\n private _frustum?: Frustum;\n private _width = 0;\n private _height = 0;\n private _baseBatchId = 0;\n private _anyHilited = false;\n private _anyOpaque = false;\n private _anyTranslucent = false;\n private _classifier?: ActiveSpatialClassifier;\n private readonly _plane = Plane3dByOriginAndUnitNormal.create(new Point3d(0, 0, 0), new Vector3d(0, 0, 1))!; // TBD -- Support other planes - default to X-Y for now.\n private readonly _renderState = new RenderState();\n private readonly _renderCommands: RenderCommands;\n private readonly _branchStack = new BranchStack();\n private readonly _batchState: BatchState;\n private _planarClipMask?: PlanarClipMaskState;\n private _classifierTreeRef?: SpatialClassifierTileTreeReference;\n private _planarClipMaskOverrides?: FeatureSymbology.Overrides;\n private _contentMode: PlanarClassifierContent = PlanarClassifierContent.None;\n private _removeMe?: () => void;\n\n private static _postProjectionMatrix = Matrix4d.createRowValues(\n 0, 1, 0, 0,\n 0, 0, -1, 0,\n 1, 0, 0, 0,\n 0, 0, 0, 1);\n private _debugFrustum?: Frustum;\n private _doDebugFrustum = false;\n private _debugFrustumGraphic?: RenderGraphic = undefined;\n private _isClassifyingPointCloud?: boolean; // we will detect this the first time we draw\n private readonly _bgColor = ColorDef.from(0, 0, 0, 255);\n\n private constructor(classifier: ActiveSpatialClassifier | undefined, target: Target) {\n super();\n this._classifier = classifier;\n\n const flags = this._renderState.flags;\n flags.depthMask = flags.blend = flags.depthTest = false;\n\n this._batchState = new BatchState(this._branchStack);\n this._renderCommands = new RenderCommands(target, this._branchStack, this._batchState);\n }\n public get textureImageCount(): number { return this._contentMode; }\n\n public getParams(params: Float32Array): void {\n params[0] = this.insideDisplay;\n params[1] = this.outsideDisplay;\n params[2] = this._contentMode;\n if (this._planarClipMask?.settings.invert) // If the mask sense is inverted, negate the contentMode to indicate this to the shader.\n params[2] = - params[2];\n\n params[3] = (this._planarClipMask?.settings.transparency === undefined) ? -1 : this._planarClipMask.settings.transparency;\n\n }\n\n public get hiliteTexture(): Texture | undefined { return undefined !== this._classifierBuffers ? this._classifierBuffers.textures.hilite : undefined; }\n public get projectionMatrix(): Matrix4d { return this._projectionMatrix; }\n // public get properties(): SpatialClassifier { return this._classifier; }\n public get baseBatchId(): number { return this._baseBatchId; }\n public get anyHilited(): boolean { return this._anyHilited; }\n public get anyOpaque(): boolean { return this._anyOpaque; }\n public get anyTranslucent(): boolean { return this._anyTranslucent; }\n public get insideDisplay(): SpatialClassifierInsideDisplay { return this._classifier ? this._classifier.flags.inside : SpatialClassifierInsideDisplay.Off; }\n public get outsideDisplay(): SpatialClassifierOutsideDisplay { return this._classifier ? this._classifier.flags.outside : SpatialClassifierOutsideDisplay.On; }\n public get isClassifyingPointCloud(): boolean { return true === this._isClassifyingPointCloud; }\n\n public addGraphic(graphic: RenderGraphic) {\n this._graphics!.push(graphic);\n }\n\n public static create(properties: ActiveSpatialClassifier | undefined, target: Target): PlanarClassifier {\n return new PlanarClassifier(properties, target);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n if (undefined !== this._classifierBuffers)\n this._classifierBuffers.textures.collectStatistics(stats);\n\n if (undefined !== this._maskBuffer)\n this._maskBuffer.collectStatistics(stats);\n\n if (undefined !== this._classifierCombinedBuffer)\n this._classifierCombinedBuffer.collectStatistics(stats);\n\n if (undefined !== this._classifierAndMaskCombinedBuffer)\n this._classifierAndMaskCombinedBuffer.collectStatistics(stats);\n }\n\n public get isDisposed(): boolean { return undefined === this._classifierBuffers; }\n\n public dispose() {\n this._classifierBuffers = dispose(this._classifierBuffers);\n this._maskBuffer = dispose(this._maskBuffer);\n this._classifierCombinedBuffer = dispose(this._classifierCombinedBuffer);\n this._classifierAndMaskCombinedBuffer = dispose(this._classifierAndMaskCombinedBuffer);\n if (this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n }\n }\n\n public get texture(): Texture | undefined {\n switch (this._contentMode) {\n case PlanarClassifierContent.None:\n return undefined;\n case PlanarClassifierContent.ClassifierOnly:\n return this._classifierCombinedBuffer?.texture;\n case PlanarClassifierContent.MaskOnly:\n return this._maskBuffer?.texture;\n case PlanarClassifierContent.ClassifierAndMask:\n return this._classifierAndMaskCombinedBuffer?.texture;\n }\n }\n public getOrCreateClassifierTexture(): Texture | undefined {\n if (undefined === this._classifierBuffers)\n this._classifierBuffers = ClassifierFrameBuffers.create(this._width, this._height);\n if (undefined !== this._classifierBuffers && undefined === this._classifierCombinedBuffer)\n this._classifierCombinedBuffer = ClassifierCombinationBuffer.create(this._width, this._height, this._classifierBuffers.textures.color, this._classifierBuffers.textures.feature);\n\n return this._classifierCombinedBuffer?.texture;\n }\n\n private pushBatches(batchState: BatchState, graphics: RenderGraphic[]) {\n graphics.forEach((graphic) => {\n if (graphic instanceof Batch) {\n batchState.push(graphic, true);\n batchState.pop();\n } else if (graphic instanceof Branch) {\n this.pushBatches(batchState, graphic.branch.entries);\n }\n });\n }\n public get sourceTransparency() {\n return this._classifierTreeRef?.transparency;\n }\n\n public pushBatchState(batchState: BatchState) {\n this._baseBatchId = batchState.nextBatchId - 1;\n if (undefined !== this._classifierGraphics)\n this.pushBatches(batchState, this._classifierGraphics);\n }\n\n public setSource(classifierTreeRef?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState) {\n this._classifierTreeRef = classifierTreeRef;\n this._classifier = classifierTreeRef?.activeClassifier;\n this._planarClipMask = planarClipMask;\n }\n\n public collectGraphics(context: SceneContext, target: PlanarClassifierTarget): void {\n this._classifierGraphics.length = this._maskGraphics.length = 0;\n if (undefined === context.viewingSpace)\n return;\n\n const viewState = context.viewingSpace.view;\n if (!viewState.isSpatialView())\n return;\n\n const requiredHeight = context.target.viewRect.height;\n const requiredWidth = context.target.viewRect.width;\n\n if (requiredWidth !== this._width || requiredHeight !== this._height)\n this.dispose();\n\n this._width = requiredWidth;\n this._height = requiredHeight;\n const maskTrees = this._planarClipMask?.getTileTrees(viewState, target.modelId);\n if (!maskTrees && !this._classifierTreeRef)\n return;\n\n const allTrees = maskTrees ? maskTrees.slice() : new Array<TileTreeReference>();\n if (this._classifierTreeRef)\n allTrees.push(this._classifierTreeRef);\n\n const projection = PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, target, allTrees, viewState, this._width, this._height);\n if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)\n return;\n\n this._projectionMatrix = projection.projectionMatrix;\n this._frustum = projection.textureFrustum;\n this._debugFrustum = projection.debugFrustum;\n this._planarClipMaskOverrides = this._planarClipMask?.getPlanarClipMaskSymbologyOverrides(viewState, context);\n if (!this._planarClipMask?.usingViewportOverrides && this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n } else if (this._planarClipMask?.usingViewportOverrides && !this._removeMe) {\n this._removeMe = context.viewport.onFeatureOverridesChanged.addListener(() => {\n this._planarClipMaskOverrides = this._planarClipMask?.getPlanarClipMaskSymbologyOverrides(viewState, context);\n context.viewport.requestRedraw();\n });\n }\n\n const drawTree = (treeRef: TileTreeReference, graphics: RenderGraphic[]) => {\n this._graphics = graphics;\n const frustumPlanes = this._frustum ? FrustumPlanes.fromFrustum(this._frustum) : FrustumPlanes.createEmpty();\n const drawArgs = GraphicsCollectorDrawArgs.create(context, this, treeRef, frustumPlanes, projection.worldToViewMap!);\n if (undefined !== drawArgs)\n treeRef.draw(drawArgs);\n\n this._graphics = undefined;\n };\n if (this._classifierTreeRef)\n drawTree(this._classifierTreeRef, this._classifierGraphics);\n\n if (maskTrees)\n maskTrees.forEach((maskTree) => drawTree(maskTree, this._maskGraphics));\n\n // Shader behaves slightly differently when classifying surfaces vs point clouds.\n this._isClassifyingPointCloud = target.isPointCloud;\n\n if (this._doDebugFrustum) {\n this._debugFrustumGraphic = dispose(this._debugFrustumGraphic);\n const builder = context.createSceneGraphicBuilder();\n\n builder.setSymbology(ColorDef.green, ColorDef.green, 1);\n builder.addFrustum(context.viewingSpace.getFrustum());\n builder.setSymbology(ColorDef.red, ColorDef.red, 1);\n builder.addFrustum(this._debugFrustum!);\n builder.setSymbology(ColorDef.white, ColorDef.white, 1);\n builder.addFrustum(this._frustum);\n this._debugFrustumGraphic = builder.finish();\n }\n }\n\n public draw(target: Target) {\n if (undefined === this._frustum)\n return;\n\n this._contentMode = PlanarClassifierContent.None;\n let combinationBuffer: ClassifierCombinationBuffer | undefined;\n if (this._classifierGraphics.length === 0) {\n if (this._maskGraphics.length === 0) {\n return;\n } else {\n if (undefined === this._maskBuffer) {\n this._maskBuffer = MaskFrameBuffer.create(this._width, this._height);\n if (undefined === this._maskBuffer)\n return;\n }\n this._contentMode = PlanarClassifierContent.MaskOnly;\n }\n } else {\n if (undefined === this._classifierBuffers) {\n this._classifierBuffers = ClassifierFrameBuffers.create(this._width, this._height);\n if (undefined === this._classifierBuffers)\n return;\n }\n if (this._maskGraphics.length === 0) {\n if (undefined === this._classifierCombinedBuffer) {\n combinationBuffer = this._classifierCombinedBuffer = ClassifierCombinationBuffer.create(this._width, this._height, this._classifierBuffers.textures.color, this._classifierBuffers.textures.feature);\n if (undefined === this._classifierCombinedBuffer)\n return;\n }\n this._contentMode = PlanarClassifierContent.ClassifierOnly;\n combinationBuffer = this._classifierCombinedBuffer;\n } else {\n if (undefined === this._maskBuffer) {\n this._maskBuffer = MaskFrameBuffer.create(this._width, this._height);\n if (undefined === this._maskBuffer)\n return;\n }\n if (undefined === this._classifierAndMaskCombinedBuffer) {\n combinationBuffer = this._classifierAndMaskCombinedBuffer = ClassifierAndMaskCombinationBuffer.create(this._width, this._height, this._classifierBuffers.textures.color, this._classifierBuffers.textures.feature, this._maskBuffer.texture);\n if (undefined === this._classifierAndMaskCombinedBuffer)\n return;\n }\n combinationBuffer = this._classifierAndMaskCombinedBuffer;\n this._contentMode = PlanarClassifierContent.ClassifierAndMask;\n }\n }\n\n if (undefined !== this._debugFrustumGraphic)\n target.graphics.foreground.push(this._debugFrustumGraphic);\n\n // Temporarily override the Target's state.\n const system = System.instance;\n const maskViewFlags = {\n renderMode: RenderMode.SmoothShade,\n wiremesh: false,\n transparency: !this.isClassifyingPointCloud, // point clouds don't support transparency.\n textures: false,\n lighting: false,\n shadows: false,\n monochrome: false,\n materials: false,\n ambientOcclusion: false,\n visibleEdges: false,\n hiddenEdges: false,\n };\n const prevState = system.currentRenderState.clone(scratchPrevRenderState);\n system.context.viewport(0, 0, this._width, this._height);\n const vf = target.currentViewFlags.copy(this._classifierTreeRef ? this._classifierTreeRef.viewFlags : maskViewFlags);\n\n system.applyRenderState(this._renderState);\n const prevPlan = target.plan;\n const prevOverrides = target.currentFeatureSymbologyOverrides;\n\n target.uniforms.style.changeBackgroundColor(this._bgColor); // Avoid white on white reversal. Will be reset in changeRenderPlan below.\n target.changeFrustum(this._frustum, this._frustum.getFraction(), true);\n this._anyTranslucent = false;\n\n const prevProjMatrix = target.uniforms.frustum.projectionMatrix;\n target.uniforms.frustum.changeProjectionMatrix(PlanarClassifier._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));\n target.uniforms.branch.changeRenderPlan(vf, target.plan.is3d, target.plan.hline);\n\n const renderCommands = this._renderCommands;\n const getDrawCommands = (graphics: RenderGraphic[]) => {\n this._batchState.reset();\n renderCommands.reset(target, this._branchStack, this._batchState);\n renderCommands.collectGraphicsForPlanarProjection(graphics);\n\n // Draw the classifiers into our attachments.\n // When using Display.ElementColor, the color and transparency come from the classifier geometry. Therefore we may need to draw the classified geometry\n // in a different pass - or both passes - depending on the transparency of the classifiers.\n // NB: \"Outside\" geometry by definition cannot take color/transparency from element...\n const cmds = renderCommands.getCommands(RenderPass.OpaquePlanar);\n\n // NB: We don't strictly require the classifier geometry to be planar, and sometimes (e.g., \"planar\" polyface/bspsurf) we do not detect planarity.\n cmds.push(...renderCommands.getCommands(RenderPass.OpaqueGeneral));\n cmds.push(...renderCommands.getCommands(RenderPass.OpaqueLinear));\n this._anyOpaque = cmds.length > 0;\n const transCmds = renderCommands.getCommands(RenderPass.Translucent);\n if (transCmds.length > 0) {\n cmds.push(...transCmds);\n this._anyTranslucent = true;\n }\n return cmds;\n };\n\n if (this._classifierGraphics.length > 0 && this._classifierBuffers) {\n this._classifierBuffers.draw(getDrawCommands(this._classifierGraphics), target);\n\n // Draw any hilited classifiers.\n const hiliteCommands = renderCommands.getCommands(RenderPass.Hilite);\n this._anyHilited = 0 !== hiliteCommands.length;\n if (this._anyHilited)\n this._classifierBuffers.drawHilite(hiliteCommands, target);\n }\n if (this._maskGraphics.length > 0 && this._maskBuffer) {\n if (this._planarClipMaskOverrides)\n target.overrideFeatureSymbology(this._planarClipMaskOverrides);\n if (this._planarClipMask && this._planarClipMask.settings.transparency !== undefined && this._planarClipMask.settings.transparency > 0.0)\n this._anyTranslucent = true;\n\n this._maskBuffer.draw(getDrawCommands(this._maskGraphics), target);\n\n }\n if (combinationBuffer)\n combinationBuffer.compose(target);\n\n this._batchState.reset();\n target.changeRenderPlan(prevPlan);\n target.overrideFeatureSymbology(prevOverrides);\n\n system.applyRenderState(prevState);\n system.context.viewport(0, 0, target.viewRect.width, target.viewRect.height);\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"PlanarClassifier.js","sourceRoot":"","sources":["../../../../src/render/webgl/PlanarClassifier.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA8C;AAC9C,oDAE4B;AAC5B,wDAA0G;AAE1G,kDAAuH;AAKvH,sEAA2F;AAC3F,6CAA0C;AAC1C,+CAA4C;AAC5C,qDAA2H;AAG3H,+CAA4C;AAC5C,6BAA0B;AAC1B,uCAA0C;AAC1C,uEAAoE;AACpE,qDAAkD;AAElD,+CAA4C;AAC5C,2DAAoD;AACpD,qCAAkC;AAGlC,uCAAmD;AAGnD,IAAY,uBAA6F;AAAzG,WAAY,uBAAuB;IAAG,qEAAQ,CAAA;IAAE,6EAAY,CAAA;IAAE,yFAAkB,CAAA;IAAE,+FAAqB,CAAA;AAAC,CAAC,EAA7F,uBAAuB,uCAAvB,uBAAuB,QAAsE;AAEzG,SAAS,aAAa,CAAC,MAAqB;IAC1C,OAAO,IAAI,iBAAO,CAAC;QACjB,MAAM;QACN,SAAS,EAAE,UAAU;QACrB,IAAI,EAAE,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CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YACjE,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,YAAY,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,YAAY,GAAG,GAAG;gBACtI,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAE9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC;QAErE,CAAC;QACD,IAAI,iBAAiB;YACnB,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEpC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAClC,MAAM,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAE/C,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/E,CAAC;;AAnXH,4CAoXC;AAxVgB,sCAAqB,GAAG,wBAAQ,CAAC,eAAe,CAC7D,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EACX,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,AAJuB,CAItB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module WebGL\n */\n\nimport { dispose } from \"@itwin/core-bentley\";\nimport {\n ColorDef, Frustum, FrustumPlanes, RenderMode, RenderTexture, SpatialClassifierInsideDisplay, SpatialClassifierOutsideDisplay, TextureTransparency,\n} from \"@itwin/core-common\";\nimport { Matrix4d, Plane3dByOriginAndUnitNormal, Point3d, Range3d, Vector3d } from \"@itwin/core-geometry\";\nimport { PlanarClipMaskState } from \"../../PlanarClipMaskState\";\nimport { GraphicsCollectorDrawArgs, SpatialClassifierTileTreeReference, TileTreeReference } from \"../../tile/internal\";\nimport { SceneContext } from \"../../ViewContext\";\nimport { FeatureSymbology } from \"../FeatureSymbology\";\nimport { RenderGraphic } from \"../RenderGraphic\";\nimport { RenderMemory } from \"../RenderMemory\";\nimport { PlanarClassifierTarget, RenderPlanarClassifier } from \"../RenderPlanarClassifier\";\nimport { BatchState } from \"./BatchState\";\nimport { BranchStack } from \"./BranchStack\";\nimport { CachedGeometry, Combine3TexturesGeometry, CombineTexturesGeometry, ViewportQuadGeometry } from \"./CachedGeometry\";\nimport { WebGLDisposable } from \"./Disposable\";\nimport { DrawCommands } from \"./DrawCommand\";\nimport { FrameBuffer } from \"./FrameBuffer\";\nimport { GL } from \"./GL\";\nimport { Batch, Branch } from \"./Graphic\";\nimport { PlanarTextureProjection } from \"./PlanarTextureProjection\";\nimport { RenderCommands } from \"./RenderCommands\";\nimport { RenderPass } from \"./RenderFlags\";\nimport { RenderState } from \"./RenderState\";\nimport { getDrawParams } from \"./ScratchDrawParams\";\nimport { System } from \"./System\";\nimport { Target } from \"./Target\";\nimport { TechniqueId } from \"./TechniqueId\";\nimport { Texture, TextureHandle } from \"./Texture\";\nimport { ActiveSpatialClassifier } from \"../../SpatialClassifiersState\";\n\nexport enum PlanarClassifierContent { None = 0, MaskOnly = 1, ClassifierOnly = 2, ClassifierAndMask = 3 }\n\nfunction createTexture(handle: TextureHandle): Texture {\n return new Texture({\n handle,\n ownership: \"external\",\n type: RenderTexture.Type.TileSection,\n transparency: TextureTransparency.Opaque,\n });\n}\n\nfunction createTextureHandle(width: number, height: number, heightMult = 1.0) {\n return TextureHandle.createForAttachment(width, height * heightMult, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\n}\n\nclass ClassifierTextures implements WebGLDisposable {\n private constructor(public readonly color: Texture,\n public readonly feature: Texture,\n public readonly hilite: Texture) { }\n\n public get isDisposed(): boolean {\n return this.color.isDisposed\n && this.feature.isDisposed\n && this.hilite.isDisposed;\n }\n\n public dispose(): void {\n dispose(this.color);\n dispose(this.feature);\n dispose(this.hilite);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n stats.addPlanarClassifier(this.color.bytesUsed);\n stats.addPlanarClassifier(this.feature.bytesUsed);\n stats.addPlanarClassifier(this.hilite.bytesUsed);\n }\n\n public static create(width: number, height: number): ClassifierTextures | undefined {\n const hColor = createTextureHandle(width, height);\n const hFeature = createTextureHandle(width, height);\n const hHilite = createTextureHandle(width, height);\n if (!hColor || !hFeature || !hHilite)\n return undefined;\n\n const color = createTexture(hColor);\n const feature = createTexture(hFeature);\n const hilite = createTexture(hHilite);\n if (!color || !feature || !hilite)\n return undefined;\n\n return new ClassifierTextures(color, feature, hilite);\n }\n}\n\nclass ClassifierFrameBuffers implements WebGLDisposable {\n private constructor(\n public readonly textures: ClassifierTextures,\n private readonly _hilite: FrameBuffer,\n private readonly _fbo: FrameBuffer,\n private readonly _clearGeom: ViewportQuadGeometry) {\n }\n\n public get isDisposed(): boolean {\n return this.textures.isDisposed && this._hilite.isDisposed && this._fbo.isDisposed && this._clearGeom.isDisposed;\n }\n\n public dispose(): void {\n dispose(this._fbo);\n dispose(this._clearGeom);\n dispose(this.textures);\n dispose(this._hilite);\n }\n\n public draw(cmds: DrawCommands, target: Target): void {\n System.instance.frameBufferStack.execute(this._fbo, true, false, () => {\n target.techniques.draw(getDrawParams(target, this._clearGeom));\n target.techniques.execute(target, cmds, RenderPass.PlanarClassification);\n });\n }\n\n public drawHilite(cmds: DrawCommands, target: Target): void {\n const system = System.instance;\n const gl = system.context;\n system.frameBufferStack.execute(this._hilite, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\n target.techniques.execute(target, cmds, RenderPass.Hilite);\n });\n }\n\n public static create(width: number, height: number): ClassifierFrameBuffers | undefined {\n const textures = ClassifierTextures.create(width, height);\n if (undefined === textures)\n return undefined;\n\n const hiliteFbo = FrameBuffer.create([textures.hilite.texture]);\n if (undefined === hiliteFbo)\n return undefined;\n\n const fbo = FrameBuffer.create([textures.color.texture, textures.feature.texture]);\n if (undefined === fbo)\n return undefined;\n\n const geom = ViewportQuadGeometry.create(TechniqueId.ClearPickAndColor);\n return undefined !== geom ? new this(textures, hiliteFbo, fbo, geom) : undefined;\n }\n}\n\ninterface TextureAndFbo {\n texture: Texture;\n fbo: FrameBuffer;\n}\n\nabstract class SingleTextureFrameBuffer implements WebGLDisposable {\n public texture: Texture;\n protected fbo: FrameBuffer;\n public get isDisposed(): boolean { return this.texture.isDisposed && this.fbo.isDisposed; }\n public collectStatistics(stats: RenderMemory.Statistics): void { stats.addPlanarClassifier(this.texture.bytesUsed); }\n protected constructor(textureAndFbo: TextureAndFbo) {\n this.texture = textureAndFbo.texture;\n this.fbo = textureAndFbo.fbo;\n }\n public dispose(): void {\n dispose(this.texture);\n dispose(this.fbo);\n }\n public static createTextureAndFrameBuffer(width: number, height: number): TextureAndFbo | undefined {\n const hTexture = TextureHandle.createForAttachment(width, height, GL.Texture.Format.Rgba, GL.Texture.DataType.UnsignedByte);\n if (!hTexture)\n return undefined;\n\n const texture = new Texture({ type: RenderTexture.Type.TileSection, ownership: \"external\", handle: hTexture, transparency: TextureTransparency.Opaque });\n if (!texture)\n return undefined;\n\n const fbo = FrameBuffer.create([texture.texture]);\n if (undefined === fbo)\n return undefined;\n\n return { texture, fbo };\n }\n}\nclass MaskFrameBuffer extends SingleTextureFrameBuffer {\n public static create(width: number, height: number): MaskFrameBuffer | undefined {\n const textureFbo = SingleTextureFrameBuffer.createTextureAndFrameBuffer(width, height);\n return undefined === textureFbo ? undefined : new MaskFrameBuffer(textureFbo);\n }\n public draw(cmds: DrawCommands, target: Target): void {\n const system = System.instance;\n const gl = system.context;\n\n system.frameBufferStack.execute(this.fbo, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\n target.techniques.execute(target, cmds, RenderPass.PlanarClassification);\n });\n }\n}\nabstract class CombineTexturesFrameBuffer extends SingleTextureFrameBuffer {\n constructor(textureAndFbo: TextureAndFbo, private _combineGeom: CachedGeometry, private _width: number, private _height: number, private _heightMult: number) { super(textureAndFbo); }\n public compose(target: Target): void {\n const system = System.instance;\n const gl = system.context;\n system.context.viewport(0, 0, this._width, this._heightMult * this._height);\n system.frameBufferStack.execute(this.fbo, true, false, () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(GL.BufferBit.Color);\n target.techniques.draw(getDrawParams(target, this._combineGeom));\n });\n }\n}\n\nclass ClassifierCombinationBuffer extends CombineTexturesFrameBuffer {\n public static create(width: number, height: number, classifierColor: Texture, classifierFeature: Texture): ClassifierAndMaskCombinationBuffer | undefined {\n const combineGeom = CombineTexturesGeometry.createGeometry(classifierColor.texture.getHandle()!, classifierFeature.texture.getHandle()!);\n if (undefined === combineGeom)\n return undefined;\n\n const textureFbo = SingleTextureFrameBuffer.createTextureAndFrameBuffer(width, 2 * height);\n return undefined === textureFbo ? undefined : new ClassifierCombinationBuffer(textureFbo, combineGeom, width, height, 2);\n }\n}\nclass ClassifierAndMaskCombinationBuffer extends CombineTexturesFrameBuffer {\n public static create(width: number, height: number, classifierColor: Texture, classifierFeature: Texture, mask: Texture): ClassifierAndMaskCombinationBuffer | undefined {\n const combineGeom = Combine3TexturesGeometry.createGeometry(classifierColor.texture.getHandle()!, classifierFeature.texture.getHandle()!, mask.texture.getHandle()!);\n if (undefined === combineGeom)\n return undefined;\n\n const textureFbo = SingleTextureFrameBuffer.createTextureAndFrameBuffer(width, 3 * height);\n return undefined === textureFbo ? undefined : new ClassifierAndMaskCombinationBuffer(textureFbo, combineGeom, width, height, 3);\n }\n}\n\nconst scratchPrevRenderState = new RenderState();\n\n/** @internal */\nexport class PlanarClassifier extends RenderPlanarClassifier implements RenderMemory.Consumer, WebGLDisposable {\n private _classifierBuffers?: ClassifierFrameBuffers;\n private _maskBuffer?: MaskFrameBuffer;\n private _classifierCombinedBuffer?: ClassifierCombinationBuffer;\n private _classifierAndMaskCombinedBuffer?: ClassifierAndMaskCombinationBuffer;\n private _projectionMatrix = Matrix4d.createIdentity();\n private _graphics?: RenderGraphic[];\n private readonly _classifierGraphics: RenderGraphic[] = [];\n private readonly _maskGraphics: RenderGraphic[] = [];\n private _frustum?: Frustum;\n private _width = 0;\n private _height = 0;\n private _baseBatchId = 0;\n private _anyHilited = false;\n private _anyOpaque = false;\n private _anyTranslucent = false;\n private _classifier?: ActiveSpatialClassifier;\n private readonly _plane = Plane3dByOriginAndUnitNormal.create(new Point3d(0, 0, 0), new Vector3d(0, 0, 1))!; // TBD -- Support other planes - default to X-Y for now.\n private readonly _renderState = new RenderState();\n private readonly _renderCommands: RenderCommands;\n private readonly _branchStack = new BranchStack();\n private readonly _batchState: BatchState;\n private _planarClipMask?: PlanarClipMaskState;\n private _classifierTreeRef?: SpatialClassifierTileTreeReference;\n private _planarClipMaskOverrides?: FeatureSymbology.Overrides;\n private _contentMode: PlanarClassifierContent = PlanarClassifierContent.None;\n private _removeMe?: () => void;\n\n private static _postProjectionMatrix = Matrix4d.createRowValues(\n 0, 1, 0, 0,\n 0, 0, -1, 0,\n 1, 0, 0, 0,\n 0, 0, 0, 1);\n private _debugFrustum?: Frustum;\n private _doDebugFrustum = false;\n private _debugFrustumGraphic?: RenderGraphic = undefined;\n private _isClassifyingPointCloud?: boolean; // we will detect this the first time we draw\n private readonly _bgColor = ColorDef.from(0, 0, 0, 255);\n\n private constructor(classifier: ActiveSpatialClassifier | undefined, target: Target) {\n super();\n this._classifier = classifier;\n\n const flags = this._renderState.flags;\n flags.depthMask = flags.blend = flags.depthTest = false;\n\n this._batchState = new BatchState(this._branchStack);\n this._renderCommands = new RenderCommands(target, this._branchStack, this._batchState);\n }\n public get textureImageCount(): number { return this._contentMode; }\n\n public getParams(params: Float32Array): void {\n params[0] = this.insideDisplay;\n params[1] = this.outsideDisplay;\n params[2] = this._contentMode;\n if (this._planarClipMask?.settings.invert) // If the mask sense is inverted, negate the contentMode to indicate this to the shader.\n params[2] = - params[2];\n\n params[3] = (this._planarClipMask?.settings.transparency === undefined) ? -1 : this._planarClipMask.settings.transparency;\n\n }\n\n public get hiliteTexture(): Texture | undefined { return undefined !== this._classifierBuffers ? this._classifierBuffers.textures.hilite : undefined; }\n public get projectionMatrix(): Matrix4d { return this._projectionMatrix; }\n // public get properties(): SpatialClassifier { return this._classifier; }\n public get baseBatchId(): number { return this._baseBatchId; }\n public get anyHilited(): boolean { return this._anyHilited; }\n public get anyOpaque(): boolean { return this._anyOpaque; }\n public get anyTranslucent(): boolean { return this._anyTranslucent; }\n public get insideDisplay(): SpatialClassifierInsideDisplay { return this._classifier ? this._classifier.flags.inside : SpatialClassifierInsideDisplay.Off; }\n public get outsideDisplay(): SpatialClassifierOutsideDisplay { return this._classifier ? this._classifier.flags.outside : SpatialClassifierOutsideDisplay.On; }\n public get isClassifyingPointCloud(): boolean { return true === this._isClassifyingPointCloud; }\n\n public addGraphic(graphic: RenderGraphic) {\n this._graphics!.push(graphic);\n }\n\n public static create(properties: ActiveSpatialClassifier | undefined, target: Target): PlanarClassifier {\n return new PlanarClassifier(properties, target);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n if (undefined !== this._classifierBuffers)\n this._classifierBuffers.textures.collectStatistics(stats);\n\n if (undefined !== this._maskBuffer)\n this._maskBuffer.collectStatistics(stats);\n\n if (undefined !== this._classifierCombinedBuffer)\n this._classifierCombinedBuffer.collectStatistics(stats);\n\n if (undefined !== this._classifierAndMaskCombinedBuffer)\n this._classifierAndMaskCombinedBuffer.collectStatistics(stats);\n }\n\n public get isDisposed(): boolean { return undefined === this._classifierBuffers; }\n\n public dispose() {\n this._classifierBuffers = dispose(this._classifierBuffers);\n this._maskBuffer = dispose(this._maskBuffer);\n this._classifierCombinedBuffer = dispose(this._classifierCombinedBuffer);\n this._classifierAndMaskCombinedBuffer = dispose(this._classifierAndMaskCombinedBuffer);\n if (this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n }\n }\n\n public get texture(): Texture | undefined {\n switch (this._contentMode) {\n case PlanarClassifierContent.None:\n return undefined;\n case PlanarClassifierContent.ClassifierOnly:\n return this._classifierCombinedBuffer?.texture;\n case PlanarClassifierContent.MaskOnly:\n return this._maskBuffer?.texture;\n case PlanarClassifierContent.ClassifierAndMask:\n return this._classifierAndMaskCombinedBuffer?.texture;\n }\n }\n public getOrCreateClassifierTexture(): Texture | undefined {\n if (undefined === this._classifierBuffers)\n this._classifierBuffers = ClassifierFrameBuffers.create(this._width, this._height);\n if (undefined !== this._classifierBuffers && undefined === this._classifierCombinedBuffer)\n this._classifierCombinedBuffer = ClassifierCombinationBuffer.create(this._width, this._height, this._classifierBuffers.textures.color, this._classifierBuffers.textures.feature);\n\n return this._classifierCombinedBuffer?.texture;\n }\n\n private pushBatches(batchState: BatchState, graphics: RenderGraphic[]) {\n graphics.forEach((graphic) => {\n if (graphic instanceof Batch) {\n batchState.push(graphic, true);\n batchState.pop();\n } else if (graphic instanceof Branch) {\n this.pushBatches(batchState, graphic.branch.entries);\n }\n });\n }\n public get sourceTransparency() {\n return this._classifierTreeRef?.transparency;\n }\n\n public pushBatchState(batchState: BatchState) {\n this._baseBatchId = batchState.nextBatchId - 1;\n if (undefined !== this._classifierGraphics)\n this.pushBatches(batchState, this._classifierGraphics);\n }\n\n public setSource(classifierTreeRef?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState) {\n this._classifierTreeRef = classifierTreeRef;\n this._classifier = classifierTreeRef?.activeClassifier;\n this._planarClipMask = planarClipMask;\n }\n\n public collectGraphics(context: SceneContext, target: PlanarClassifierTarget): void {\n this._classifierGraphics.length = this._maskGraphics.length = 0;\n if (undefined === context.viewingSpace)\n return;\n\n const viewState = context.viewingSpace.view;\n if (!viewState.isSpatialView())\n return;\n\n this._doDebugFrustum = context.target.debugControl?.displayMaskFrustum ?? false;\n\n const maxTextureSize = System.instance.maxTexSizeAllow;\n const requiredHeight = maxTextureSize;\n const requiredWidth = maxTextureSize;\n\n if (requiredWidth !== this._width || requiredHeight !== this._height)\n this.dispose();\n\n this._width = requiredWidth;\n this._height = requiredHeight;\n const maskRange = Range3d.createNull();\n const maskTrees = this._planarClipMask?.getTileTrees(viewState, target.modelId, maskRange);\n if (!maskTrees && !this._classifierTreeRef)\n return;\n\n const allTrees = maskTrees ? maskTrees.slice() : new Array<TileTreeReference>();\n if (this._classifierTreeRef)\n allTrees.push(this._classifierTreeRef);\n\n const projection = PlanarTextureProjection.computePlanarTextureProjection(this._plane, context, target, allTrees, viewState, this._width, this._height, maskRange);\n if (!projection.textureFrustum || !projection.projectionMatrix || !projection.worldToViewMap)\n return;\n\n this._projectionMatrix = projection.projectionMatrix;\n this._frustum = projection.textureFrustum;\n this._debugFrustum = projection.debugFrustum;\n this._planarClipMaskOverrides = this._planarClipMask?.getPlanarClipMaskSymbologyOverrides(viewState, context);\n if (!this._planarClipMask?.usingViewportOverrides && this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n } else if (this._planarClipMask?.usingViewportOverrides && !this._removeMe) {\n this._removeMe = context.viewport.onFeatureOverridesChanged.addListener(() => {\n this._planarClipMaskOverrides = this._planarClipMask?.getPlanarClipMaskSymbologyOverrides(viewState, context);\n context.viewport.requestRedraw();\n });\n }\n\n const drawTree = (treeRef: TileTreeReference, graphics: RenderGraphic[]) => {\n this._graphics = graphics;\n const frustumPlanes = this._frustum ? FrustumPlanes.fromFrustum(this._frustum) : FrustumPlanes.createEmpty();\n const drawArgs = GraphicsCollectorDrawArgs.create(context, this, treeRef, frustumPlanes, projection.worldToViewMap!);\n if (undefined !== drawArgs)\n treeRef.draw(drawArgs);\n\n this._graphics = undefined;\n };\n if (this._classifierTreeRef)\n drawTree(this._classifierTreeRef, this._classifierGraphics);\n\n if (maskTrees)\n maskTrees.forEach((maskTree) => drawTree(maskTree, this._maskGraphics));\n\n // Shader behaves slightly differently when classifying surfaces vs point clouds.\n this._isClassifyingPointCloud = target.isPointCloud;\n\n if (this._doDebugFrustum) {\n this._debugFrustumGraphic = dispose(this._debugFrustumGraphic);\n const builder = context.createSceneGraphicBuilder();\n\n builder.setSymbology(ColorDef.green, ColorDef.green, 2);\n builder.addFrustum(context.viewingSpace.getFrustum());\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n builder.addFrustum(this._debugFrustum!);\n builder.setSymbology(ColorDef.blue, ColorDef.blue, 2);\n builder.addFrustum(this._frustum);\n\n builder.setSymbology(ColorDef.from(0,200,0,222), ColorDef.from(0,200,0,222), 2);\n builder.addFrustumSides(context.viewingSpace.getFrustum());\n builder.setSymbology(ColorDef.from(200,0,0,222), ColorDef.from(200,0,0,222), 2);\n builder.addFrustumSides(this._debugFrustum!);\n builder.setSymbology(ColorDef.from(0,0,200,222), ColorDef.from(0,0,200,222), 2);\n builder.addFrustumSides(this._frustum);\n this._debugFrustumGraphic = builder.finish();\n context.outputGraphic(this._debugFrustumGraphic);\n }\n }\n\n public draw(target: Target) {\n if (undefined === this._frustum)\n return;\n\n this._contentMode = PlanarClassifierContent.None;\n let combinationBuffer: ClassifierCombinationBuffer | undefined;\n if (this._classifierGraphics.length === 0) {\n if (this._maskGraphics.length === 0) {\n return;\n } else {\n if (undefined === this._maskBuffer) {\n this._maskBuffer = MaskFrameBuffer.create(this._width, this._height);\n if (undefined === this._maskBuffer)\n return;\n }\n this._contentMode = PlanarClassifierContent.MaskOnly;\n }\n } else {\n if (undefined === this._classifierBuffers) {\n this._classifierBuffers = ClassifierFrameBuffers.create(this._width, this._height);\n if (undefined === this._classifierBuffers)\n return;\n }\n if (this._maskGraphics.length === 0) {\n if (undefined === this._classifierCombinedBuffer) {\n combinationBuffer = this._classifierCombinedBuffer = ClassifierCombinationBuffer.create(this._width, this._height, this._classifierBuffers.textures.color, this._classifierBuffers.textures.feature);\n if (undefined === this._classifierCombinedBuffer)\n return;\n }\n this._contentMode = PlanarClassifierContent.ClassifierOnly;\n combinationBuffer = this._classifierCombinedBuffer;\n } else {\n if (undefined === this._maskBuffer) {\n this._maskBuffer = MaskFrameBuffer.create(this._width, this._height);\n if (undefined === this._maskBuffer)\n return;\n }\n if (undefined === this._classifierAndMaskCombinedBuffer) {\n combinationBuffer = this._classifierAndMaskCombinedBuffer = ClassifierAndMaskCombinationBuffer.create(this._width, this._height, this._classifierBuffers.textures.color, this._classifierBuffers.textures.feature, this._maskBuffer.texture);\n if (undefined === this._classifierAndMaskCombinedBuffer)\n return;\n }\n combinationBuffer = this._classifierAndMaskCombinedBuffer;\n this._contentMode = PlanarClassifierContent.ClassifierAndMask;\n }\n }\n\n // Temporarily override the Target's state.\n const system = System.instance;\n const maskViewFlags = {\n renderMode: RenderMode.SmoothShade,\n wiremesh: false,\n transparency: !this.isClassifyingPointCloud, // point clouds don't support transparency.\n textures: false,\n lighting: false,\n shadows: false,\n monochrome: false,\n materials: false,\n ambientOcclusion: false,\n visibleEdges: false,\n hiddenEdges: false,\n };\n const prevState = system.currentRenderState.clone(scratchPrevRenderState);\n system.context.viewport(0, 0, this._width, this._height);\n const vf = target.currentViewFlags.copy(this._classifierTreeRef ? this._classifierTreeRef.viewFlags : maskViewFlags);\n\n system.applyRenderState(this._renderState);\n const prevPlan = target.plan;\n const prevOverrides = target.currentFeatureSymbologyOverrides;\n\n target.uniforms.style.changeBackgroundColor(this._bgColor); // Avoid white on white reversal. Will be reset in changeRenderPlan below.\n target.changeFrustum(this._frustum, this._frustum.getFraction(), true);\n this._anyTranslucent = false;\n\n const prevProjMatrix = target.uniforms.frustum.projectionMatrix;\n target.uniforms.frustum.changeProjectionMatrix(PlanarClassifier._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));\n target.uniforms.branch.changeRenderPlan(vf, target.plan.is3d, target.plan.hline);\n\n const renderCommands = this._renderCommands;\n const getDrawCommands = (graphics: RenderGraphic[]) => {\n this._batchState.reset();\n renderCommands.reset(target, this._branchStack, this._batchState);\n renderCommands.collectGraphicsForPlanarProjection(graphics);\n\n // Draw the classifiers into our attachments.\n // When using Display.ElementColor, the color and transparency come from the classifier geometry. Therefore we may need to draw the classified geometry\n // in a different pass - or both passes - depending on the transparency of the classifiers.\n // NB: \"Outside\" geometry by definition cannot take color/transparency from element...\n const cmds = renderCommands.getCommands(RenderPass.OpaquePlanar);\n\n // NB: We don't strictly require the classifier geometry to be planar, and sometimes (e.g., \"planar\" polyface/bspsurf) we do not detect planarity.\n cmds.push(...renderCommands.getCommands(RenderPass.OpaqueGeneral));\n cmds.push(...renderCommands.getCommands(RenderPass.OpaqueLinear));\n this._anyOpaque = cmds.length > 0;\n const transCmds = renderCommands.getCommands(RenderPass.Translucent);\n if (transCmds.length > 0) {\n cmds.push(...transCmds);\n this._anyTranslucent = true;\n }\n return cmds;\n };\n\n if (this._classifierGraphics.length > 0 && this._classifierBuffers) {\n this._classifierBuffers.draw(getDrawCommands(this._classifierGraphics), target);\n\n // Draw any hilited classifiers.\n const hiliteCommands = renderCommands.getCommands(RenderPass.Hilite);\n this._anyHilited = 0 !== hiliteCommands.length;\n if (this._anyHilited)\n this._classifierBuffers.drawHilite(hiliteCommands, target);\n }\n if (this._maskGraphics.length > 0 && this._maskBuffer) {\n if (this._planarClipMaskOverrides)\n target.overrideFeatureSymbology(this._planarClipMaskOverrides);\n if (this._planarClipMask && this._planarClipMask.settings.transparency !== undefined && this._planarClipMask.settings.transparency > 0.0)\n this._anyTranslucent = true;\n\n this._maskBuffer.draw(getDrawCommands(this._maskGraphics), target);\n\n }\n if (combinationBuffer)\n combinationBuffer.compose(target);\n\n this._batchState.reset();\n target.changeRenderPlan(prevPlan);\n target.overrideFeatureSymbology(prevOverrides);\n\n system.applyRenderState(prevState);\n system.context.viewport(0, 0, target.viewRect.width, target.viewRect.height);\n }\n}\n\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Rendering
|
|
3
3
|
*/
|
|
4
4
|
import { Frustum } from "@itwin/core-common";
|
|
5
|
-
import { Map4d, Matrix4d, Plane3dByOriginAndUnitNormal, Range1d, Transform } from "@itwin/core-geometry";
|
|
5
|
+
import { Map4d, Matrix4d, Plane3dByOriginAndUnitNormal, Range1d, Range3d, Transform } from "@itwin/core-geometry";
|
|
6
6
|
import { Tile, TileTreeReference } from "../../tile/internal";
|
|
7
7
|
import { SceneContext } from "../../ViewContext";
|
|
8
8
|
import { ViewState3d } from "../../ViewState";
|
|
@@ -10,15 +10,15 @@ import { RenderState } from "./RenderState";
|
|
|
10
10
|
import { Target } from "./Target";
|
|
11
11
|
export declare class PlanarTextureProjection {
|
|
12
12
|
private static _postProjectionMatrixNpc;
|
|
13
|
+
private static isTileRangeInBounds;
|
|
13
14
|
static computePlanarTextureProjection(texturePlane: Plane3dByOriginAndUnitNormal, sceneContext: SceneContext, target: {
|
|
14
15
|
tiles: Tile[];
|
|
15
16
|
location: Transform;
|
|
16
|
-
}, drapeRefs: TileTreeReference[], viewState: ViewState3d, textureWidth: number, textureHeight: number, _heightRange?: Range1d): {
|
|
17
|
+
}, drapeRefs: TileTreeReference[], viewState: ViewState3d, textureWidth: number, textureHeight: number, maskRange: Range3d, _heightRange?: Range1d): {
|
|
17
18
|
textureFrustum?: Frustum;
|
|
18
19
|
worldToViewMap?: Map4d;
|
|
19
20
|
projectionMatrix?: Matrix4d;
|
|
20
21
|
debugFrustum?: Frustum;
|
|
21
|
-
zValue?: number;
|
|
22
22
|
};
|
|
23
23
|
static getTextureDrawingParams(target: Target): {
|
|
24
24
|
state: RenderState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarTextureProjection.d.ts","sourceRoot":"","sources":["../../../../src/render/webgl/PlanarTextureProjection.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAkC,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EACgD,KAAK,EAAY,QAAQ,EAAE,4BAA4B,EAAW,OAAO,
|
|
1
|
+
{"version":3,"file":"PlanarTextureProjection.d.ts","sourceRoot":"","sources":["../../../../src/render/webgl/PlanarTextureProjection.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAkC,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EACgD,KAAK,EAAY,QAAQ,EAAE,4BAA4B,EAAW,OAAO,EAAW,OAAO,EACzI,SAAS,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAKlC,qBAAa,uBAAuB;IAClC,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAA4H;IAEnK,OAAO,CAAC,MAAM,CAAC,mBAAmB;WASpB,8BAA8B,CAC1C,YAAY,EAAE,4BAA4B,EAC1C,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE;QAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,EAC9C,SAAS,EAAE,iBAAiB,EAAE,EAC9B,SAAS,EAAE,WAAW,EACtB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,OAAO,EAClB,YAAY,CAAC,EAAE,OAAO,GAAG;QAAE,cAAc,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,KAAK,CAAC;QAAC,gBAAgB,CAAC,EAAE,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