UNPKG

@itwin/core-frontend

Version:
188 lines • 9.48 kB
/** @packageDocumentation * @module Tiles */ import { BeTimePoint } from "@itwin/core-bentley"; import { ClipVector, Map4d, Point3d, Range3d, Transform } from "@itwin/core-geometry"; import { FeatureAppearanceProvider, FrustumPlanes, HiddenLine, ViewFlagOverrides } from "@itwin/core-common"; import { FeatureSymbology } from "../render/FeatureSymbology"; import { GraphicBranch } from "../render/GraphicBranch"; import { RenderClipVolume } from "../render/RenderClipVolume"; import { RenderGraphic } from "../render/RenderGraphic"; import { RenderPlanarClassifier } from "../internal/render/RenderPlanarClassifier"; import { SceneContext } from "../ViewContext"; import { ViewingSpace } from "../ViewingSpace"; import { Tile, TileGraphicType, TileTree } from "./internal"; import { RenderTextureDrape } from "../internal/render/RenderTextureDrape"; /** Parameters used to construct [[TileDrawArgs]]. * @public * @extensions */ export interface TileDrawArgParams { /** Context for the scene into which the tiles are to be rendered. */ context: SceneContext; /** Transform to be applied when drawing the tiles. */ location: Transform; /** The tile tree from which to obtain tiles. */ tree: TileTree; /** The time at which these args were created. */ now: BeTimePoint; /** Overrides to apply to the view's [ViewFlags]($common) when drawing the tiles. */ viewFlagOverrides: ViewFlagOverrides; /** Clip volume used to clip the tiles. */ clipVolume?: RenderClipVolume; /** True if a tile and its child tiles should not be drawn simultaneously. */ parentsAndChildrenExclusive: boolean; /** Symbology overrides to apply to the tiles. */ symbologyOverrides: FeatureSymbology.Overrides | undefined; /** Optionally customizes the view's symbology overrides for the tiles. */ appearanceProvider?: FeatureAppearanceProvider; /** Optionally overrides the view's hidden line settings. */ hiddenLineSettings?: HiddenLine.Settings; /** If defined, tiles should be culled if they do not intersect this clip. */ intersectionClip?: ClipVector; /** If defined, the Id of a node in the scene's [RenderSchedule.Script]($common) that applies a transform to the graphics; * or "0xffffffff" for any node that does *not* apply a transform. * @internal */ animationTransformNodeId?: number; /** See [[GraphicBranch.groupNodeId]]. * @internal */ groupNodeId?: number; /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */ boundingRange?: Range3d; /** @alpha */ maximumScreenSpaceError?: number; /** @alpha */ transformFromIModel?: Transform; } /** * Provides context used when selecting and drawing [[Tile]]s. * @see [[TileTree.selectTiles]] * @see [[TileTree.draw]] * @public * @extensions */ export declare class TileDrawArgs { /** Transform to the location in iModel coordinates at which the tiles are to be drawn. */ readonly location: Transform; /** The tile tree being drawn. */ readonly tree: TileTree; /** Optional clip volume applied to the tiles. */ clipVolume: RenderClipVolume | undefined; /** The context in which the tiles will be drawn, exposing, e.g., the [[Viewport]] and accepting [[RenderGraphic]]s to be drawn. */ readonly context: SceneContext; /** Describes the viewed volume. */ viewingSpace: ViewingSpace; /** Holds the tile graphics to be drawn. */ readonly graphics: GraphicBranch; /** @internal */ readonly now: BeTimePoint; /** The planes of the viewing frustum, used for frustum culling. */ protected _frustumPlanes?: FrustumPlanes; /** @internal */ planarClassifier?: RenderPlanarClassifier; /** @internal */ drape?: RenderTextureDrape; /** Optional clip volume applied to all tiles in the view. */ readonly viewClip?: ClipVector; /** True if a tile and its child tiles should not be drawn simultaneously. */ parentsAndChildrenExclusive: boolean; /** @internal */ private _appearanceProvider?; /** Optional overrides for the view's hidden line settings. */ hiddenLineSettings?: HiddenLine.Settings; /** Tiles that we want to draw and that are ready to draw. May not actually be selected, e.g. if sibling tiles are not yet ready. */ readonly readyTiles: Set<Tile>; /** Tiles whose contents should be kept in memory regardless of whether or not they are selected for display. * @internal */ readonly touchedTiles: Set<Tile>; /** For perspective views, the view-Z of the near plane. */ private readonly _nearFrontCenter?; /** Overrides applied to the view's [ViewFlags]($common) when drawing the tiles. */ get viewFlagOverrides(): ViewFlagOverrides; /** If defined, replaces the view's own symbology overrides when drawing the tiles. */ get symbologyOverrides(): FeatureSymbology.Overrides | undefined; /** If defined, tiles will be culled if they do not intersect this clip. */ intersectionClip?: ClipVector; /** If defined, a bounding range in tile tree coordinates outside of which tiles should not be selected. */ boundingRange?: Range3d; /** @internal */ readonly pixelSizeScaleFactor: number; /** @internal */ readonly animationTransformNodeId?: number; /** @internal */ readonly groupNodeId?: number; /** @alpha */ maximumScreenSpaceError: number; /** @alpha */ transformFromIModel?: Transform; /** Compute the size in pixels of the specified tile at the point on its bounding sphere closest to the camera. */ getPixelSize(tile: Tile): number; /** If the tile provides corners (from an OBB) then this produces most accurate representation of the tile size */ private getPixelSizeFromProjection; /** Compute the size in meters of one pixel at the point on the tile's bounding sphere closest to the camera. */ getPixelSizeInMetersAtClosestPoint(tile: Tile): number; /** Compute the size in meters of one pixel at the point on a sphere closest to the camera. * Device scaling is not applied. */ computePixelSizeInMetersAtClosestPoint(center: Point3d, radius: number): number; /** Compute this size of a sphere on screen in pixels */ getRangePixelSize(range: Range3d): number; /** @internal */ getTileGraphics(tile: Tile): RenderGraphic | undefined; /** The planes of the viewing frustum, used for frustum culling. */ get frustumPlanes(): FrustumPlanes; /** Provides conversions between [[CoordSystem.World]] and [[CoordSystem.View]]. */ get worldToViewMap(): Map4d; private computePixelSizeScaleFactor; /** Constructor */ constructor(params: TileDrawArgParams); /** A multiplier applied to a [[Tile]]'s `maximumSize` property to adjust level of detail. * @see [[Viewport.tileSizeModifier]]. * @public */ get tileSizeModifier(): number; /** @internal */ getTileCenter(tile: Tile): Point3d; /** @internal */ getTileRadius(tile: Tile): number; /** @internal */ get clip(): ClipVector | undefined; /** Add a provider to supplement or override the symbology overrides for the view. * @note If a provider already exists, the new provider will be chained such that it sees the base overrides * after they have potentially been modified by the existing provider. * @public */ addAppearanceProvider(provider: FeatureAppearanceProvider): void; /** Optionally customizes aspects of the view's [[FeatureSymbology.Overrides]]. */ get appearanceProvider(): FeatureAppearanceProvider | undefined; /** @internal */ produceGraphics(): RenderGraphic | undefined; /** @internal */ get secondaryClassifiers(): Map<number, RenderPlanarClassifier> | undefined; /** @internal */ private _produceGraphicBranch; /** Output graphics for all accumulated tiles. */ drawGraphics(): void; /** Output graphics of the specified type for all accumulated tiles. */ drawGraphicsWithType(graphicType: TileGraphicType, graphics: GraphicBranch): void; /** Indicate that graphics for the specified tile are desired but not yet available. Subsequently a request will be enqueued to load the tile's graphics. */ insertMissing(tile: Tile): void; /** Indicate that some requested child tiles are not yet loaded. */ markChildrenLoading(): void; /** Indicate that the specified tile is being used for some purpose by the [[SceneContext]]'s [[Viewport]]. Typically "used" means "displayed", but the exact meaning is up to the [[TileTree]] - for example, "used" might also mean that the tile's children are being used. A tile that is "in use" by any [[Viewport]] will not be discarded. */ markUsed(tile: Tile): void; /** Indicate that the specified tile should be displayed and that its graphics are ready to be displayed. The number of "ready" tiles is used in conjunction with the number of "missing" tiles to convey to the user how complete the current view is. * @see [[insertMissing]] */ markReady(tile: Tile): void; /** Invoked by [[TileTree.selectTiles]]. This exists chiefly for [[SolarShadowMap]]. * @internal */ processSelectedTiles(_tiles: Tile[]): void; get maxRealityTreeSelectionCount(): number | undefined; get shouldCollectClassifierGraphics(): boolean; } //# sourceMappingURL=TileDrawArgs.d.ts.map