UNPKG

@itwin/core-frontend

Version:
141 lines • 5.16 kB
/** @packageDocumentation * @module WebGL */ import { Id64String } from "@itwin/core-bentley"; import { BranchState } from "./BranchState"; import { CachedGeometry } from "./CachedGeometry"; import { ClipVolume } from "./ClipVolume"; import { Batch, Branch } from "./Graphic"; import { UniformHandle } from "./UniformHandle"; import { Primitive } from "./Primitive"; import { Pass, RenderOrder, RenderPass } from "./RenderFlags"; import { ShaderProgramExecutor } from "./ShaderProgram"; import { Hilites, Target } from "./Target"; /** @internal */ export declare class ShaderProgramParams { private _target?; private _renderPass; get target(): Target; get renderPass(): RenderPass; get projectionMatrix(): import("./Matrix").Matrix4; bindProjectionMatrix(uniform: UniformHandle): void; get isViewCoords(): boolean; get isOverlayPass(): boolean; get context(): WebGL2RenderingContext; init(target: Target, pass?: RenderPass): void; } /** @internal */ export declare class DrawParams { private _programParams?; private _geometry?; get geometry(): CachedGeometry; get programParams(): ShaderProgramParams; get target(): Target; get renderPass(): RenderPass; get projectionMatrix(): import("./Matrix").Matrix4; get isViewCoords(): boolean; get isOverlayPass(): boolean; get context(): WebGL2RenderingContext; init(programParams: ShaderProgramParams, geometry: CachedGeometry): void; } /** Defines operation associated with pushing or popping a branch * @internal */ export declare const enum PushOrPop { Push = 0, Pop = 1 } /** Represents a command to be executed within a RenderPass. The most common command is * to draw a primitive; others involve state changes such as pushing/popping transforms * and symbology overrides, which require that commands be executed in order. * @internal */ export declare enum DrawOpCode { Primitive = "drawPrimitive",// eslint-disable-line @typescript-eslint/no-shadow PushBranch = "pushBranch", PopBranch = "popBranch", PushBatch = "pushBatch", PopBatch = "popBatch", PushState = "pushState", PushClip = "pushClip", PopClip = "popClip" } /** @internal */ export declare class PopBatchCommand { readonly opcode = "popBatch"; private constructor(); static instance: PopBatchCommand; execute(exec: ShaderProgramExecutor): void; } /** @internal */ export declare class PushBatchCommand { readonly batch: Batch; readonly opcode = "pushBatch"; constructor(batch: Batch); execute(exec: ShaderProgramExecutor): void; } /** @internal */ export declare class PushStateCommand { readonly state: BranchState; readonly opcode = "pushState"; constructor(state: BranchState); execute(exec: ShaderProgramExecutor): void; } /** @internal */ export declare class PushBranchCommand { readonly branch: Branch; readonly opcode = "pushBranch"; constructor(branch: Branch); execute(exec: ShaderProgramExecutor): void; } /** @internal */ export declare class PopBranchCommand { readonly opcode = "popBranch"; private constructor(); static instance: PopBranchCommand; execute(exec: ShaderProgramExecutor): void; } /** @internal */ export declare class PushClipCommand { readonly clip: ClipVolume; readonly opcode = "pushClip"; constructor(clip: ClipVolume); execute(exec: ShaderProgramExecutor): void; } /** @internal */ export declare class PopClipCommand { readonly opcode = "popClip"; private constructor(); static instance: PopClipCommand; execute(exec: ShaderProgramExecutor): void; } /** @internal */ export declare class PrimitiveCommand { readonly primitive: Primitive; readonly opcode = "drawPrimitive"; constructor(primitive: Primitive); private static readonly _scratchTechniqueFlags; execute(exec: ShaderProgramExecutor): void; get hasFeatures(): boolean; get renderOrder(): RenderOrder; getPass(target: Target): Pass; } /** @internal */ export type PushCommand = PushBranchCommand | PushBatchCommand | PushStateCommand | PushClipCommand; /** @internal */ export type PopCommand = PopBranchCommand | PopBatchCommand | PopClipCommand; /** @internal */ export type DrawCommand = PushCommand | PopCommand | PrimitiveCommand; /** For a single RenderPass, an ordered list of commands to be executed during that pass. * @internal */ export type DrawCommands = DrawCommand[]; /** Extracts the commands for rendering the flashed classifier (if any) from the by-index set of volume classifier commands. * NB: Cmds will be sets of some pushes, a primitive, and then some pops (equal to number of pushes). * The primitive should be right in the middle of a set. We need to find the set which matches the flashID. * @internal */ export declare function extractFlashedVolumeClassifierCommands(flashedId: Id64String, cmds: DrawCommands, numCmdsPerClassifier: number): DrawCommands | undefined; /** @internal */ export declare function extractHilitedVolumeClassifierCommands(hilites: Hilites, cmds: DrawCommands): DrawCommands; //# sourceMappingURL=DrawCommand.d.ts.map