import { ControllerAxes as ControllerAxes_2 } from './input'; import { DrawContext as DrawContext_2 } from '..'; import { EdgeValues as EdgeValues_2 } from '.'; import { IndexedCollection } from 'gl-matrix'; import { mat4 } from 'gl-matrix'; import { quat } from 'gl-matrix'; import { ReadonlyMat3 } from 'gl-matrix'; import { ReadonlyMat4 } from 'gl-matrix'; import { ReadonlyQuat } from 'gl-matrix'; import { ReadonlyVec2 } from 'gl-matrix'; import { ReadonlyVec3 } from 'gl-matrix'; import { ReadonlyVec4 } from 'gl-matrix'; import { RenderStateDynamicObject as RenderStateDynamicObject_2 } from '..'; import { TouchContactPoint as TouchContactPoint_2 } from './input'; import { vec2 } from 'gl-matrix'; import { vec3 } from 'gl-matrix'; /** Axis-aligned bounding box * @category Render State */ export declare interface AABB { /** Minimum coordinates. */ readonly min: ReadonlyVec3; /** Maximum coordinates. */ readonly max: ReadonlyVec3; } export declare interface AABB2 { readonly min: ReadonlyVec2; readonly max: ReadonlyVec2; } export declare interface AABB3 { readonly min: ReadonlyVec3; readonly max: ReadonlyVec3; } declare interface AABB_2 { readonly length: number; readonly min: Float3; readonly max: Float3; } declare interface AABB_3 { readonly length: number; readonly min: Float3_2; readonly max: Float3_2; } declare interface AABB_4 { readonly length: number; readonly min: Float3_3; readonly max: Float3_3; } /** Active texture index. */ export declare type ActiveTextureIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; /** Fixed sized array of active texture names. */ export declare type ActiveTexturesArray = Omit, "with"> & { with(index: ActiveTextureIndex, value: RenderStateTextureReference): ActiveTexturesArray; }; export declare interface Alignment { readonly objectId: number; readonly points: ReadonlyVec3[]; readonly stations: number[]; readonly top: number; readonly bottom: number; readonly horizontalPointsOfCurvature: HorizontalPointOfCurvature[]; readonly verticalPointsOfCurvature: VerticalPointOfCurvature[]; readonly verticalAlignment: ReadonlyVec2[]; readonly tesselatedSegment: boolean; } declare interface AlignmentData extends CurveSegmentData { readonly verticalPointsOfCurvature: readonly PointOfCurvature[]; readonly horizontalPointsOfCurvature: readonly PointOfCurvature[]; } /** ArcValues is a collection of values for measuring a single arc */ export declare interface ArcValues { readonly kind: "arc"; /** Radius of the arc */ readonly radius: number; /** Angle of the arc segment */ readonly totalAngle: number; } /** Parameters for asynchronous shader compilation and linking. */ export declare interface AsyncProgramParams { /** For debugging/diagnostics purposes. */ readonly name?: string; /** Common GLSL header information to be inserted before the body code. */ readonly header?: Partial; /** The vertex shader. */ readonly vertexShader: string; /** The fragment shader (optional with transform feedback shaders). */ readonly fragmentShader?: string; /** The names of the vertex attributes to be bound prior to linking using gl.bindAttribLocation(). */ readonly attributes?: readonly string[]; /** The names of the shader uniform blocks to be bound prior to linking using gl.uniformBlockBinding(), in the order which they appear */ readonly uniformBufferBlocks?: readonly string[]; /** Texture uniforms to be bound post-linking. */ readonly textureUniforms?: readonly string[]; /** Transform feedback buffers to be bound post-linking. */ readonly transformFeedback?: { /** Should output attributes be written into a single interleaved buffer or separate buffers? */ readonly bufferMode: "INTERLEAVED_ATTRIBS" | "SEPARATE_ATTRIBS"; /** Name of output attribute names (varyings). */ readonly varyings: readonly string[]; }; } /** Helper type, like typescript's `Partial`, but where at least one property must be defined. */ export declare type AtLeastOne; }> = Partial & U[keyof U]; /* Excluded from this release type: Base64String */ /** Base class for all camera controllers. * @category Camera Controllers */ export declare abstract class BaseController { /** The input source for this controller. */ readonly input: ControllerInput; /** The controller type id. */ abstract readonly kind: string; /** The camera projection kind. * @see {@link RenderStateCamera.kind}. */ abstract readonly projection: RenderStateCamera["kind"] | undefined; /** * Camera controller state generation. * @remarks * If the controller state changes, the generation count will be incremented once every call to {@link renderStateChanges}. * This can be used to detect changes by comparing to a local generation count. * The count is wrapped at 0xffffffff, so make sure you use != comparison and not < comparison. */ get generation(): number; /** Signal changes to internal state. */ protected changed(): void; private _changed; private _generation; private _flyTo; private _isMoving; /** * @param input The input source for this controller. */ protected constructor( /** The input source for this controller. */ input: ControllerInput); /** The input axes * @see {@link ControllerInput.axes} */ get axes(): ControllerAxes_2; /** Whether the camera is currently considered moving or not. * @see {@link View.isIdleFrame} */ get moving(): boolean; /** The input element width. * @see {@link ControllerInput.width} */ get width(): number; /** The input element height. * @see {@link ControllerInput.height} */ get height(): number; /** The input multiplier. * @see {@link ControllerInput.multiplier} */ get multiplier(): number; /** The input zoom position. * @see {@link ControllerInput.zoomPos} */ get zoomPos(): number[]; /** The input pointer table. * @see {@link ControllerInput.touchPoints} */ get pointerTable(): readonly TouchContactPoint_2[]; /** The input shift button state. * @see {@link ControllerInput.hasShift} */ get hasShift(): boolean; /** The current fly-to state, if any. */ get currentFlyTo(): Orientation | undefined; protected resetFlyTo(): void; /** Initialize a fly-to transition. * @param flyTo The transition parameters */ protected setFlyTo(flyTo: FlyToParams): void; /** Apply time sensitive changes to controller state. * @param elapsedTime The # of milliseconds elapsed since the last update. * @remarks * Fly-to animations happens here, * as well as motion based on keyboard pressed-state, such as the WASD keys. */ animate(elapsedTime: number): void; /** Serialize the state of this controller into init parameters. * @param includeDerived Include derived state which may not be intrinsic to this controller, such as orbit controller position. * @see {@link init} */ abstract serialize(includeDerived?: boolean): ControllerInitParams; /** Initialize controller from parameters. * @see {@link serialize} */ abstract init(params: ControllerInitParams): void; /** Attempt to fit controller position such that the specified bounding sphere is brought into view. * @param center The center of the bounding sphere, in world space. * @param radius The radius of the bounding sphere, in world space. */ abstract autoFit(center: ReadonlyVec3, radius: number): void; /** Update internal controller state */ abstract update(): void; /** Retrieve changes to render state from derived class, if any. * @param state The baseline state to apply changes to. * @see {@link View.modifyRenderState} * @remarks * If there are no changes, the returned object will be empty, i.e. {}. */ abstract stateChanges(state?: RenderStateCamera): Partial; /** Attach this controller to the input object */ attach(): void; /** * Handler for mouse buttons events. * @virtual */ abstract mouseButtonChanged(event: MouseEvent): Promise | void; /** * Handler for touch events. * @virtual */ abstract touchChanged(event: TouchEvent): Promise | void; /** * Handler for mouse/touch move events. * @virtual */ abstract moveBegin(event: TouchEvent | MouseEvent): Promise | void; /** Move controller to specified position/rotation. * @param targetPosition The position to move to, in world space. * @param flyTime The time, in milliseconds, for the transition animation to last, or 0 for instant update. * Default should be 1000. * @param rotation Optional target rotation, or undefined to retain current rotation. * @virtual */ abstract moveTo(targetPosition: ReadonlyVec3, flyTime?: number, rotation?: ReadonlyQuat): void; /** Bring the specified bounding sphere into view. * @param boundingSphere The bounding sphere to move into view. * @param flyTime The time, in milliseconds, for the transition animation to last, or 0 for instant update. * Default should be 1000. * @virtual * @remarks * This function will retain the current camera controller rotation. */ abstract zoomTo(boundingSphere: BoundingSphere, flyTime?: number): void; /** Retrieve the state changes to be applied to the specified render state. * @param state The baseline render state. * @param elapsedTime The time elapsed since last call, in milliseconds. */ renderStateChanges(state: RenderStateCamera, elapsedTime: number): RenderStateChanges | undefined; /** Compute the distance to a point from the specified view plane. * @param point The point to measure distance too * @param cameraPosition The position of the camera/view plane. * @param cameraRotation The rotation of the camera/view plane. * @returns A signed distance from the point to the view plane, i.e. positive for points in front of the plane and negative otherwise. */ protected static getDistanceFromViewPlane(point: ReadonlyVec3, cameraPosition: ReadonlyVec3, cameraRotation: ReadonlyQuat): number; } declare class BaseModule { readonly worker: MeasureWorker; readonly parent: MeasureView; constructor(worker: MeasureWorker, parent: MeasureView); } /** A basic GPU benchmark helper class. * @category Device Profile */ export declare class Benchmark { readonly canvas: HTMLCanvasElement; readonly gl: WebGL2RenderingContext; static readonly size = 1024; static get numPixels(): number; constructor(); dispose(): void; } /** Bounding sphere * @category Render State */ export declare interface BoundingSphere { /** Sphere center. */ readonly center: ReadonlyVec3; /** Sphere radius. */ readonly radius: number; } declare interface BoundingSphere_2 { readonly length: number; readonly origo: Float3; readonly radius: F32; } declare interface BoundingSphere_3 { readonly length: number; readonly origo: Float3_2; readonly radius: F32; } declare interface BoundingSphere_4 { readonly length: number; readonly origo: Float3_3; readonly radius: F32; } declare interface Bounds { readonly length: number; readonly box: AABB_2; readonly sphere: BoundingSphere_2; } declare interface Bounds_2 { readonly length: number; readonly box: AABB_3; readonly sphere: BoundingSphere_3; } declare interface Bounds_3 { readonly length: number; readonly box: AABB_4; readonly sphere: BoundingSphere_4; } /** Bounding volume. */ declare interface Bounds_4 { /** Axis aligned bounding box. */ readonly box: AABB; /** Bounding Sphere. */ readonly sphere: BoundingSphere; } declare const enum BufferFlags { color = 1, pick = 2, depth = 4, all = 7 } declare type BufferParams = BufferParamsSize | BufferParamsData; declare interface BufferParamsData { readonly kind: BufferTargetString; readonly srcData: BufferSource; readonly usage?: BufferUsageString; } declare interface BufferParamsSize { readonly kind: BufferTargetString; readonly byteSize: GLsizeiptr; readonly usage?: BufferUsageString; } declare class BufferReader { readonly buffer: ArrayBuffer; pos: number; private readonly _u8; private readonly _u16; private readonly _u32; private readonly _i8; private readonly _i16; private readonly _i32; private readonly _f16; private readonly _f32; private readonly _f64; constructor(buffer: ArrayBuffer); private read; get eof(): boolean; u8(size: number): Uint8Array; u16(size: number): Uint16Array; u32(size: number): Uint32Array; i8(size: number): Int8Array; i16(size: number): Int16Array; i32(size: number): Int32Array; f16(size: number): Uint16Array; f32(size: number): Float32Array; f64(size: number): Float64Array; } declare type BufferTargetString = "ARRAY_BUFFER" | "ELEMENT_ARRAY_BUFFER" | "COPY_READ_BUFFER" | "COPY_WRITE_BUFFER" | "TRANSFORM_FEEDBACK_BUFFER" | "UNIFORM_BUFFER" | "PIXEL_PACK_BUFFER" | "PIXEL_UNPACK_BUFFER"; declare type BufferUsageString = "STATIC_DRAW" | "DYNAMIC_DRAW" | "STREAM_DRAW" | "STATIC_READ" | "DYNAMIC_READ" | "STREAM_READ" | "STATIC_COPY" | "DYNAMIC_COPY" | "STREAM_COPY"; /** Kind strings of built-in camera controller. * @category Camera Controller * @category Render View */ export declare type BuiltinCameraControllerKind = keyof BuiltinCameraControllerType; /** Types of built-in camera controller. * @category Camera Controller * @category Render View */ export declare type BuiltinCameraControllerType = ReturnType; /** * Return the built-in camera controllers. * @param input The control input. * @param pick The control pick context, typically the view in where */ export declare function builtinControllers(input: ControllerInput, pick: PickContext, conversions: ScreenSpaceConversions): { readonly orbit: OrbitController; readonly flight: FlightController; readonly ortho: OrthoController; readonly panorama: PanoramaController; readonly cadMiddlePan: CadMiddlePanController; readonly cadRightPan: CadRightPanController; readonly special: SpecialFlightController; readonly hover: HoverController; readonly null: NullController; }; /** Variant of flight controller that uses middle mouse button for panning. * @category Camera Controllers */ export declare class CadMiddlePanController extends FlightController { readonly pick: PickContext; kind: "cadMiddlePan"; constructor(input: ControllerInput, pick: PickContext, conversions: ScreenSpaceConversions, _params?: FlightControllerParams); getTransformations(): CameraTransformations; } /** Variant of flight controller that uses right mouse button for panning. * @category Camera Controllers */ export declare class CadRightPanController extends FlightController { readonly pick: PickContext; kind: "cadRightPan"; constructor(input: ControllerInput, pick: PickContext, conversions: ScreenSpaceConversions, _params?: FlightControllerParams); getTransformations(): CameraTransformations; } /** * Camera values needed when drawing measure data. The camera state from RenderState can be used here {@link RenderStateCamera} */ export declare interface Camera { readonly kind: "pinhole" | "orthographic"; readonly position: ReadonlyVec3; readonly rotation: ReadonlyQuat; readonly fov: number; readonly near: number; readonly far: number; } /** Optional values to initialize camera controller. */ export declare interface CameraControllerInitialValues { /** The camera pivot position. */ readonly pivot?: ReadonlyVec3; /** The camera position. */ readonly position?: ReadonlyVec3; /** The camera rotation. */ readonly rotation?: ReadonlyQuat; /** The camera field of view. * @see {@link RenderStateCamera.fov}. */ readonly fov?: number; } /** Camera controller switch options. * @category Camera Controller * @category Render View */ export declare interface CameraControllerOptions { /** Whether to attempt an auto initializion of camera position or not. * @remarks * This is a heuristic won't work well for scenes with clusters of geometry scattered far apart. * Georeferenced autocad models that contains "meta" geometry at origo are often problematic and may require you to supply a position manually. */ readonly autoInit?: boolean; } /** @ignore */ export declare type CameraControllers = { readonly [P in T]: BaseController; }; /** Camera controller factory function signature type. * @template T dude */ export declare type CameraControllersFactory = (input: ControllerInput, pick: PickContext, conversions: ScreenSpaceConversions) => T; declare interface CameraTransformations { tx: number; ty: number; tz: number; wtx?: number; wty?: number; wtz?: number; rx: number; ry: number; shouldPivot: boolean; } /** Gives values to create a camera based on selected object */ export declare interface CameraValues { /** Normalized direction */ normal: ReadonlyVec3; /** World position */ position: ReadonlyVec3; } declare type ChildIndex = number; declare interface ChildInfo { readonly length: number; readonly hash: HashRange; readonly childIndex: U8; readonly childMask: U32; readonly tolerance: I8; readonly positionBPC: U8; readonly totalByteSize: U32; readonly offset: Double3; readonly scale: F32; readonly bounds: Bounds; readonly subMeshes: SubMeshProjectionRange; readonly descendantObjectIds: DescendantObjectIdsRange; } declare interface ChildInfo_2 { readonly length: number; readonly hash: HashRange_2; readonly childIndex: U8; readonly childMask: U32; readonly tolerance: I8; readonly positionBPC: U8; readonly totalByteSize: U32; readonly offset: Double3_2; readonly scale: F32; readonly bounds: Bounds_2; readonly subMeshes: SubMeshProjectionRange_2; readonly descendantObjectIds: DescendantObjectIdsRange_2; } declare interface ChildInfo_3 { readonly length: number; readonly hash: HashRange_3; readonly childIndex: U8; readonly childMask: U32; readonly tolerance: I8; readonly totalByteSize: U32; readonly offset: Double3_3; readonly scale: F32; readonly bounds: Bounds_3; readonly subMeshes: SubMeshProjectionRange_3; readonly descendantObjectIds: DescendantObjectIdsRange_3; } declare interface Circle2DData { readonly kind: "circle"; readonly origin: ReadonlyVec2; readonly radius: number; } declare interface Circle3DData { readonly kind: "circle"; readonly origin: ReadonlyVec3; readonly axisX: ReadonlyVec3; readonly axisY: ReadonlyVec3; readonly radius: number; } /** Object id/indices for picking of rendered clipping planes. * @category Render State */ export declare enum ClippingId { plane0 = 4294967280, plane1 = 4294967281, plane2 = 4294967282, plane3 = 4294967283, plane4 = 4294967284, plane5 = 4294967285, plane6 = 4294967286 } /** How to combine the half-spaces of multiple clipping planes into a clipping volume. * @category Render State */ export declare enum ClippingMode { /** Use the intersection of the clipping plane half-spaces. * @remarks * This is useful for creating a clipping space where everything outside e.g. a slab or a box is clipped/hidden. * * `inside_volume = inside(plane0) AND inside(plane1) AND ...` */ intersection = 0, /** Use the union of the clipping plane half-spaces. * @remarks * This is useful for creating spaces where everything inside e.g. a slab or a box is clipped/hidden. * * `inside_volume = inside(plane0) OR inside(plane1) OR ...` */ union = 1 } /** * Module for all collision calculations */ export declare class CollisionModule { readonly worker: MeasureWorker; readonly parent: MeasureView; constructor(worker: MeasureWorker, parent: MeasureView); /** * Returns collision values between 2 entities * currently only works for two cylinders */ collision(a: ParametricEntity, b: ParametricEntity, setting?: MeasureSettings): Promise; } /** Collision values*/ export declare interface CollisionValues { /** Collision point between two objects*/ readonly point: vec3; } declare type ColorAttachment = `COLOR_ATTACHMENT${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15}`; declare type CompareFuncString = "NEVER" | "LESS" | "EQUAL" | "LEQUAL" | "GREATER" | "NOTEQUAL" | "GEQUAL" | "ALWAYS"; declare type CompareModeString = "COMPARE_REF_TO_TEXTURE" | "NONE"; declare type ComponentType = ComponentTypeFloat | ComponentTypeInt | ComponentTypeUint; declare type ComponentTypeFloat = "HALF_FLOAT" | "FLOAT"; declare type ComponentTypeInt = "BYTE" | "SHORT" | "INT"; declare type ComponentTypeUint = "UNSIGNED_BYTE" | "UNSIGNED_SHORT" | "UNSIGNED_INT"; declare interface Compressed { readonly internalFormat: CompressedTextureFormatString; } declare type CompressedTextureFormatString = "COMPRESSED_RGB_S3TC_DXT1_EXT" | "COMPRESSED_RGBA_S3TC_DXT1_EXT" | "COMPRESSED_RGBA_S3TC_DXT3_EXT" | "COMPRESSED_RGBA_S3TC_DXT5_EXT" | "COMPRESSED_SRGB_S3TC_DXT1_EXT" | "COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT" | "COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT" | "COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT" | "COMPRESSED_R11_EAC" | "COMPRESSED_SIGNED_R11_EAC" | "COMPRESSED_RG11_EAC" | "COMPRESSED_SIGNED_RG11_EAC" | "COMPRESSED_RGB8_ETC2" | "COMPRESSED_RGBA8_ETC2_EAC" | "COMPRESSED_SRGB8_ETC2" | "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC" | "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2" | "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2" | "COMPRESSED_RGB_PVRTC_4BPPV1_IMG" | "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG" | "COMPRESSED_RGB_PVRTC_2BPPV1_IMG" | "COMPRESSED_RGBA_PVRTC_2BPPV1_IMG" | "COMPRESSED_RGB_ETC1_WEBGL" | "COMPRESSED_RGBA_ASTC_4x4_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR" | "COMPRESSED_RGBA_ASTC_5x4_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR" | "COMPRESSED_RGBA_ASTC_5x5_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR" | "COMPRESSED_RGBA_ASTC_6x5_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR" | "COMPRESSED_RGBA_ASTC_6x6_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR" | "COMPRESSED_RGBA_ASTC_8x5_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR" | "COMPRESSED_RGBA_ASTC_8x6_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR" | "COMPRESSED_RGBA_ASTC_8x8_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR" | "COMPRESSED_RGBA_ASTC_10x5_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR" | "COMPRESSED_RGBA_ASTC_10x6_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR" | "COMPRESSED_RGBA_ASTC_10x10_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR" | "COMPRESSED_RGBA_ASTC_12x10_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR" | "COMPRESSED_RGBA_ASTC_12x12_KHR" | "COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR" | "COMPRESSED_RGBA_BPTC_UNORM_EXT" | "COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT" | "COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT" | "COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT" | "COMPRESSED_RED_RGTC1_EXT" | "COMPRESSED_SIGNED_RED_RGTC1_EXT" | "COMPRESSED_RED_GREEN_RGTC2_EXT" | "COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT"; /** Compute rotation quaternion from roll, pitch and yaw angles. * @param roll Roll angle in degrees, * @param pitch Pitch angle in degrees, * @param yaw Yaw angle in degrees, * @category Camera Controllers */ export declare function computeRotation(roll: number, pitch: number, yaw: number, flipYZ?: boolean): quat; declare interface ConeData { readonly kind: "cone"; readonly transform: FixedSizeArray_2; readonly coefficients: FixedSizeArray_2; readonly radius: number; readonly halfAngleTan: number; } /** Input event callbacks. * @category Camera Controllers */ export declare interface ContollerInputContext { /** Mouse button events. */ mouseButtonChanged(event: MouseEvent): Promise | void; /** Touch "click" events. */ touchChanged(event: TouchEvent): Promise | void; /** Mouse or touch move events. */ moveBegin(event: TouchEvent | MouseEvent): Promise | void; } /** The input gesture axes values. * @property keyboard_ad Keyboard `A` and `D` axis. * @property keyboard_ws Keyboard `W` and `S` axis. * @property keyboard_qe Keyboard `Q` and `E` axis. * @property keyboard_arrow_left_right Keyboard cursor left and right axis. * @property keyboard_arrow_up_down Keyboard cursor up and down axis. * @category Camera Controllers */ export declare type ControllerAxes = { [P in ControllerAxesName]: number; }; declare type ControllerAxesName = "keyboard_ad" | "keyboard_ws" | "keyboard_qe" | "keyboard_arrow_left_right" | "keyboard_arrow_up_down" | "mouse_lmb_move_x" | "mouse_lmb_move_y" | "mouse_rmb_move_x" | "mouse_rmb_move_y" | "mouse_mmb_move_x" | "mouse_mmb_move_y" | "mouse_navigate" | "mouse_navigate" | "mouse_wheel" | "touch_1_move_x" | "touch_1_move_y" | "touch_2_move_x" | "touch_2_move_y" | "touch_2_rotate" | "touch_3_move_x" | "touch_3_move_y" | "touch_pinch2" | "touch_pinch3"; /** Common controller initialization parameters. * @remarks * No controller uses all of these parameters. * This interface represents the union of all possible intialization paramters for all possible controllers. * This is useful for deserialization, where the kind of controller is not known at compile time. * @category Camera Controllers */ export declare interface ControllerInitParams { /** The kind of controller to initialize. */ readonly kind: string; /** The camera position, if applicable. */ readonly position?: ReadonlyVec3; /** The camera rotation, if applicable. */ readonly rotation?: ReadonlyQuat; /** The camera perspective field of view, in degrees, if applicable. */ readonly fovDegrees?: number; /** The camera orthographic field of meters, in degrees, if applicable. */ readonly fovMeters?: number; /** The camera pivot point, if applicable. */ readonly pivot?: ReadonlyVec3; /** The distance to the pivot point, if applicable. */ readonly distance?: number; } /** * The input source of camera controllers. * @remarks * This class abstract away input gestures, such as mouse, keyboard and touch event into a unified model. * It does this by defining a {@link ControllerAxes | set of axes} that represents an imagined gamepad/joystick input device for each class of input gestures. * The assumption is that each of these axes may be bound to a pair of keyboard keys, e.g. `A` and `D`, or some input position coordinate, e.g. the mouse `x` position for left/right motion. * All of these axes are updated independently, i.e. it is possible to move a camera with both keyboard and mouse simultaneously. * It is up to each camera controller to scale and apply each of these axes into an actual motion of the camera. * @category Camera Controllers */ export declare class ControllerInput { /** The underlying HTMLElement providing input events. */ readonly domElement: HTMLElement; /** A set of optional callbacks for controllers that wants to handle certain input events themselves. */ callbacks: ContollerInputContext | undefined; /** The current values of each input axis. */ readonly axes: ControllerAxes; /** The current list of individual touch contact points. */ touchPoints: readonly TouchContactPoint[]; private readonly _keys; private _mouseButtonDown; private _zoomY; private _zoomX; private readonly _prevTouchCenter; private _touchZoomDistancePrev; private _mouseDownClientPos; private _mouseMoveStarted; private _mouseMoveEventIndex; private _pointerLocked; private _listenToDocumentEvents; private _lastMouseMoveEvent; private _mouseWheelLastActive; private static readonly _gestureKeys; /** Whether to use {@link https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API | mouse pointer lock} or not. */ usePointerLock: boolean; /** Consider mouse started moving after mouse passed this distance. Default is 0 */ mouseMoveSensitivity: number; /** Ignore wheel events when shift is pressed. Default is false */ disableWheelOnShift: boolean; /** * @param domElement The HTMLElement to subscribe to input events from. */ constructor(domElement?: HTMLElement, listenToDocumentEvents?: boolean); /** Unsubscribe from input events. */ dispose(): void; /** Return the client width of the input {@link domElement}. */ get width(): number; /** Return the client height of the input {@link domElement}. */ get height(): number; /** Current multiplier applied to motion via the Control/Alt keys. */ get multiplier(): number; /** Whether the shift key is currently pressed or not. */ get hasShift(): boolean; /** The pixel position centering zoom gestures. * @remarks * This is typically the current cursor position while using the mouse scroll wheel, * or the center position between touch points in a pinch gesture. */ get zoomPos(): number[]; get mouseButtonDown(): boolean; /** Subscribe to input events from {@link domElement}. */ protected connect(): void; /** Unsubscribe to input events from {@link domElement}. */ protected disconnect(): void; private click; private contextmenu; private static isGestureKey; private shouldCatchInput; /** Indicate whether the mouse scroll wheel has recently been moved. */ isScrolling(): boolean; private updateModifierKeys; private keydown; private keyup; private blur; private mousedown; private mouseup; private wheel; private mousemove; replayLastMouseMoveAsMouseDown(): void; private getTouchData; private touchstart; private touchend; private touchcancel; private touchmove; /** Apply time-related state updates. * @param elapsedTime The amount of milliseconds passed since the last call to this function. */ animate(elapsedTime: number): void; /** Reset axes to their default/neutral state. */ resetAxes(): void; /** Determine if axes are all at their default/neutral state. */ axesEmpty(): boolean; } /** Common controller input parameters. * @category Camera Controllers */ export declare type ControllerParams = FlightControllerParams | OrthoControllerParams | PanoramaControllerParams | OrbitControllerParams; /** Transformation coordinate space. * @see {@link https://learnopengl.com/Getting-started/Coordinate-Systems}. * @category Render State */ export declare enum CoordSpace { /** World space. */ World = 0, /** View space. */ View = 1, /** Clip space. */ Clip = 2 } /** * Standard measure module for standard measure functions */ export declare class CoreModule extends BaseModule { /** * Measure object, if b is undefined then single measure values are returned else the measurement between 2 objects * Standard measuring function for measure single or between 2 parametric objects. * @param a The entity that is being measured, this can either be a parametric object or a single point * @param b If this is defined then the measure function will return the measurement between a and b. * @param settingA settings for object a * @param settingB settings for object b * @returns Measurement values either for a single object or between the objects */ measure(a: MeasureEntity, b?: MeasureEntity, settingA?: MeasureSettings, settingB?: MeasureSettings): Promise; /** Returns the measure entity for given object and location, measure entity is a single part of a parametric object, * such as surface, edge or vertex. If the object and position does not contain parametric data a single vertex will be returned * @param id The object id of selected object * @param selectionPosition selected position, this is required to select the individual part of the parametric object * @param tolerance Tolerance for picking, the distance used is in meters * @returns Selected measure entity, this will be a vertex if nothing can be selected at the location * status if the object is loaded, and connection point where the parametric object has been selected. */ pickMeasureEntity(id: ObjectId, selectionPosition: ReadonlyVec3, tolerance?: SnapTolerance, allowGenerated?: boolean): Promise<{ entity: MeasureEntity; status: LoadStatus; connectionPoint?: vec3; }>; /** * @param id The object id of selected object * @returns the measure entity for given object if it is a single curveSegment */ pickCurveSegment(id: ObjectId): Promise; /** Returns the measure entity for given object and location if the current object is selected * This is much faster than pickMeasureEntity and can be used for hover * @param id The object id of selected object * @param selectionPosition selected position, this is required to select the individual part of the parametric object * @param tolerance Tolerance for picking, the distance used is in meters * @returns Selected measure entity, this will be undefined if nothing is selectable at current position * **/ pickMeasureEntityOnCurrentObject(id: ObjectId, selectionPosition: ReadonlyVec3, tolerance: SnapTolerance, allowGenerated?: boolean): Promise; /** Novorender attempts to generate parametric data from tesselated objects if it is not provided in the file. * @param id The object id of selected object * @returns true if the parametric data is generated from novorender and not directly from parametric file * **/ isParametricDataGenerated(id: ObjectId): Promise; /** * @ignore * @privateRemarks not currently in use */ getParametricProduct(productId: number): Promise; /** * @ignore * @privateRemarks not currently in use */ getCameraValues(a: ParametricEntity, cameraDir: vec3): Promise; /** * Swaps between inner and outer cylinder, returns undefined if there is only one * @param entity Entity to be swapped * @param to Force cylinder to either be inner or outer * @returns Returns a new entity of the selected cylinder, if there is only one cylinder undefined is returned. */ swapCylinder(entity: MeasureEntity, to: "inner" | "outer"): Promise; /** * Calculates the area from polygon. Treat polygon as closed, Z is treated as height and is ignored. * @param vertices Vertices defining the polygon, last and first vertex will be connected to create a closed polygon * @param normals Normals used to define the plane where the area is measured. IF the difference is too high it will use Z as the normal * @returns The area of the selected polygon, do note this is 2d calulation and height is ignored */ areaFromPolygon(vertices: ReadonlyVec3[]): { area: number | undefined; polygon: ReadonlyVec3[]; }; /** * Measure between multiple points. Will return the angles, segment length and total length * @param vertices Vertices defining the line strip to be measured * @returns Angles, segment length and total length of the input linestrip */ measureLineStrip(vertices: ReadonlyVec3[]): LineStripMeasureValues; /** * @ignore */ private measurePair; /** * @ignore */ private measureSingle; /** * @ignore */ measureToPoint(a: MeasureEntity, b: ReadonlyVec3, setting?: MeasureSettings): Promise; /** * @ignore * Measure distance between 2 points */ pointToPoint(a: ReadonlyVec3, b: ReadonlyVec3): DuoMeasurementValues; getVertexEdges(entity: MeasureEntity): Promise; } /** * Create a highlight color transform that replaces material colors. * @param color New material color or color modifier with optional alpha to be used uniformly across selection. * @category Render State */ export declare function createColorSetHighlight(color: RGB | RGBA): RGBATransform; /** * Create a simple cube mesh object. * @param material The material to use, or undefined for default material. * @example * ```typescript * const cube = createCubeObject(); * view.modifyRenderState({ dynamic: { objects: [cube] } }); * ``` * @category Geometry * @experimental */ export declare function createCubeObject(material?: RenderStateDynamicMaterial): RenderStateDynamicObject; /** * Create a highlight color transform that modifies material colors using hue, saturation and lightness. * @param color New material hue, saturation and lightness modifier with optional alpha. * @category Render State */ export declare function createHSLATransformHighlight(options: AtLeastOne): RGBATransform; /** * Create a highlight color transform that doesn't change colors. * @category Render State */ export declare function createNeutralHighlight(): RGBATransform; /** * Create and initialize an offline view state object. * @param storage The offline storage to use. */ export declare function createOfflineViewState(storage: OfflineStorageOPFS): Promise; /* Excluded from this release type: createPBRMaterial */ /* Excluded from this release type: createRandomInstances */ /** * Create a highlight color transform that modifies material colors. * @param color New material color or color modifier with optional alpha. * @remarks * Colors can either be replaced or modified using the {@link LinearTransform}. * @category Render State */ export declare function createRGBATransformHighlight(options: AtLeastOne): RGBATransform; /** * Create a simple sphere mesh object. * @param detail The level of tesselation, expressed as # subdivisions of the base icosahedron. * @param material The material to use, or undefined for default material. * @example * ```typescript * const sphere = createSphereObject(); * view.modifyRenderState({ dynamic: { objects: [sphere] } }); * ``` * @category Geometry * @experimental */ export declare function createSphereObject(detail?: number, material?: RenderStateDynamicMaterial): RenderStateDynamicObject; /** * Create a highlight color transform that replaces material opacity. * @param opacity New material opacity between 0 and 1, where 0 is 100% transparent and 1.0 is 100% opaque. * @category Render State */ export declare function createTransparentHighlight(opacity: number): RGBATransform; /* Excluded from this release type: CubeId */ declare type CubeImages = readonly [ posX: BufferSource, negX: BufferSource, posY: BufferSource, negZ: BufferSource, posZ: BufferSource, negZ: BufferSource ]; declare namespace Current { export { readSchema, version, PrimitiveType, OptionalVertexAttribute, MaterialType_2 as MaterialType, TextureSemantic, HashRange, SubMeshProjectionRange, DescendantObjectIdsRange, VertexRange, VertexIndexRange, TextureInfoRange, PixelRange, ChildInfo, Double3, Bounds, AABB_2 as AABB, Float3, BoundingSphere_2 as BoundingSphere, SubMeshProjection, SubMesh, TextureInfo, Float3x3, Vertex, Int16_3, Int32_3, Int8_3, RGBA_U8, Half2, Triangle, Schema } } export declare type CurvatureKind = "line" | "arc" | "clothoid"; declare type Curve2DData = Line2DData | Circle2DData | Nurbs2DData; declare type Curve3DData = Line3DData | Circle3DData | Nurbs3DData | LineStrip3DData; declare type CurveKind = "line" | "arc" | "nurbs" | "lineStrip"; declare interface CurveSegmentData { readonly parameterBounds: readonly [number, number]; readonly tesselationParameters: readonly number[]; readonly curve3D: Index; } declare interface CylinderData { readonly kind: "cylinder"; readonly transform: FixedSizeArray_2; readonly coefficients: FixedSizeArray_2; readonly radius: number; } export declare enum CylinderOptions { center = "center", closest = "closest", furthest = "furthest", top = "top", bottom = "bottom" } /** CylinderValues is a collection of values for measuring a single cylinder */ export declare interface CylinderValues { readonly kind: "cylinder"; /** Cylinder radius */ readonly radius: number; /** Start of the line going in the center of the cylinder */ readonly centerLineStart: vec3; /** End of the line going in the center of the cylinder */ readonly centerLineEnd: vec3; /** @ignore */ readonly entity: ParametricEntity; } /** Possible options when measuring and drawing cylinders */ export declare type CylinerMeasureType = { [K in keyof CylinderOptions]: CylinderOptions[K] extends string ? CylinderOptions[K] : never; }[keyof CylinderOptions]; /** The Data API context for a scene. */ declare interface DataContext { /** * Get the associated meta data from object id. * @param objectIndex The object render id/index. * @returns The associated meta data. */ getObjectMetaData(objectIndex: ObjectId_2): Promise; /* Excluded from this release type: allObjectMetaData */ } /** Decompose rotation quaternion into roll, pitch and yaw angles. * @param rot Rotation quaternion. * @returns Rotation angles in radians. * @category Camera Controllers */ export declare function decomposeRotation(rot: ReadonlyQuat, flipYZ?: boolean): { /** The yaw angle, in radians. */ readonly yaw: number; /** The pitch angle, in radians. */ readonly pitch: number; /** The roll angle, in radians. */ readonly roll: number; }; /** Create a default render state. */ export declare function defaultRenderState(): RenderState; /* Excluded from this release type: delay */ /** An extended variant of RenderState with additional derived properties. * @category Render State */ export declare interface DerivedRenderState extends RenderState { /** Local space is a variant of world space that is close to camera to avoid excessively large coordinates and thus float32 rounding errors in shader. */ readonly localSpaceTranslation: ReadonlyVec3; /** The set of matrices that used to transform coordinate between spaces. */ readonly matrices: Matrices; /** The 6 planes of the view frustum, defined in world space. */ readonly viewFrustum: ViewFrustum; /** The effective number of MSAA samples uses for this frame. * @remarks This originates from {@link RenderStateOutput.samplesMSAA} but is potentially capped to the device's MSAA sample limit. */ effectiveSamplesMSAA: number; } declare interface DescendantObjectIdsRange { readonly start: U32; readonly count: U32; } declare interface DescendantObjectIdsRange_2 { readonly start: U32; readonly count: U32; } declare interface DescendantObjectIdsRange_3 { readonly start: U32; readonly count: U32; } /** Deviation values taken from screen */ export declare type DeviationInspections = { /** Spaced out labels for the most significant deviations based on settings */ labels: DeviationLabel[]; /** Line strip of pixel values to draw a line through the deviations on screen */ line?: vec2[]; }; /** Settings for deviation inspection */ export declare type DeviationInspectionSettings = { /** Projection to use, currently only supports circular. Projection is needed to generate line through points and offset labels*/ projection?: DeviationProjection; /** Option to generate line trough the deviation points, note that projection needs to also be set*/ generateLine?: boolean; /** Prioritize the smallest or largest deviations*/ deviationPrioritization: "minimum" | "maximum"; }; /** Deviation label with pixel position and deviation value as string. */ export declare interface DeviationLabel { /** Deviation value with up to 3 decimals. */ deviation: string; /** Deviation value. */ deviationValue: number; /** X,y pixel position */ position: vec2; } /** Projection, currently only circular from the center line position, typically used for tunnels */ export declare type DeviationProjection = { /** Pixel position of center line */ centerPoint2d: ReadonlyVec2; /** 3d position of center line */ centerPoint3d: ReadonlyVec3; /** Max distance from center point to sample in meters - to filter out potentially irrelevant samples */ maxDistanceFromCenter?: number; }; declare interface Deviations { readonly length: number; readonly a?: F16; readonly b?: F16; readonly c?: F16; readonly d?: F16; } declare interface Deviations_2 { readonly length: number; readonly a?: F16; readonly b?: F16; readonly c?: F16; readonly d?: F16; } /** * Deviation sampled from screen */ export declare interface DeviationSample { /** x coordinate in pixel space */ readonly x: number; /** y coordinate in pixel space */ readonly y: number; /** World space position of underlying pixel. */ readonly position: ReadonlyVec3; /** The spatial deviation of underlying pixel. * @remarks This only applies to point clouds with precomputed deviation data. */ readonly deviation: number; /** The depth/distance from the view plane. */ readonly depth: number; } /** Feature flags for current device. True = enable. * @category Device Profile */ export declare interface DeviceFeatures { /** Enable/disable outline rendering. */ readonly outline: boolean; } /** Device hardware limitations. * @remarks * Note that these limitations should reflect the effective limitations of the browser hosting web app, with room for UI and other app related resources. * @category Device Profile */ export declare interface DeviceLimits { /** Max. # bytes allowed for GPU resources, such as buffers and textures. */ readonly maxGPUBytes: number; /** Max. render primitives (points, lines and triangles) allowed for each frame. */ readonly maxPrimitives: number; /** Max. # of multisample anti aliasing {@link https://en.wikipedia.org/wiki/Multisample_anti-aliasing | MSAA}. * @remarks * Should be an integer number, generally between 2 and 16. * Higher numbers will give better anti aliasing at the expense of slower rendering and more memory usage. * 4 is a reasonable value for most devices. * 8 works well on powerful discrete GPUs, such as Nvidia. * If this value exceeds the max # samples allowed on this device, the driver will cap it to the lower number. */ readonly maxSamples: number; } /** * Information about current device performance and limitations. * @remarks * This information is normally not available in the browser for security reasons. * Hence, we make a best guess estimate based on known device names, GPU model names, a basic benchmark test. * Overestimating may crash the browser, so when in doubt we go with a low estimate. * Underestimating will produce fewer details and lower resolution/quality than your device can handle. * Knowledgeable users may adjust these settings manually, but should be warned to do so with caution. * @category Device Profile */ export declare interface DeviceProfile { /** What features should be enabled or disabled on this device. */ readonly features: DeviceFeatures; /** What are the practical resource limitations of this device. * @remarks * The effectively available resources are affected by other resources used by the browser and other apps. * Make sure to put these values well below the nominal/theoretical limits to allow for this. */ readonly limits: DeviceLimits; /** What particular quirks/bugs does this device have. */ readonly quirks: DeviceQuirks; /** Geometry detail bias. * @remarks * A value of 1.0 is a reasonable default for mid-end devices and acts as a baseline. * Smaller values will produce less geometric details, which may improve rendering performance at the cost of geometric error. * Larger values will produce more geometric details, which in turn requires more powerful GPU to keep performance acceptable. * The formula is essentially this: * `acceptable_geometric_error = geometry_max_error / detailBias` */ readonly detailBias: number; /** Render resolution bias. * @remarks * A value of 1.0 is a reasonable default for mid-end devices and acts as a baseline. * Smaller values will reduce resolution, which may improve rendering performance at the cost of less image fidelity. * Larger values will increase resolution, which in turn requires more powerful GPU to keep performance acceptable. * The formula is essentially this: * `effective_resolution = default_resolution * renderResolution` */ readonly renderResolution: number; /** Target framerate to aim for on this device. * @remarks * Most devices can display up to 60 FPS, which is perceived as nice and fluid. * However, lower frame rates enables more detail and fidelity. * 30 or even 20 frames per second may be acceptable on weak devices. * Note that this value is merely a hint for automatic adjustments and does not guarantee the effective framerate. */ readonly framerateTarget: number; /** How to render material textures. * @remarks * Mobile devices may not have enough memory or performance for physically based rendering (PBR). * In these cases, we revert to a faster and more basic rendering technique. * The weakest devices will only render the average color of the texture. */ readonly materialTextureRendering: "None" | "Basic" | "PBR"; /** Resolution to use for material textures. * @remarks * Higher resolutions requires more memory and are more taxing on memory bandwidth/performance. * Most mobile devices will not benefit much from higher resolutions as their screens are much smaller than a PC monitor. */ readonly materialTextureResolution: null | 256 | 512 | 1024; /** General GPU tier for this device. * @remarks * 0 is weakest, while higher tiers represent more powerful GPUs. * The tier system is a gross simplification of GPU performance estimation and does not allow for device-specific fine tuning. * Use as a starting point only. */ readonly tier: GPUTier; } /** Known device specific quirks and bugs that we can work around. * @remarks * These problems usually stems from buggy native WebGL drivers. * Workarounds may involve disabling certain features or not producing certain outputs. * @category Device Profile */ export declare interface DeviceQuirks { /** Adreno 600 series driver bug. Normals in the picking buffer will be 0 and toon shading will be off. */ readonly adreno600: boolean; /** Older Android webgl drivers struggle to compile large shader programs, even asynchronously. To avoid stuttering, disable aggressive recompile, at the expense of overall render performance. */ readonly slowShaderRecompile: boolean; /** Older IOS/Ipad devices don't implement flat shading for float varyings properly and thus introduces interpolation noise, which needs to be rounded off. */ readonly iosInterpolationBug: boolean; } declare class DirtyRange { readonly size: number; begin: number; end: number; constructor(size: number); get isEmpty(): boolean; clear(): void; reset(): void; expand(begin: number, end: number): void; } declare interface Double3 { readonly length: number; readonly x: F64; readonly y: F64; readonly z: F64; } declare interface Double3_2 { readonly length: number; readonly x: F64; readonly y: F64; readonly z: F64; } declare interface Double3_3 { readonly length: number; readonly x: F64; readonly y: F64; readonly z: F64; } /** * Load a {@link https://www.khronos.org/gltf/ | gltf} file from url. * @param url Url to gltf or glb file. * @param baseObjectId The base (start) object id to assign to the loaded object for picking. * @param abortController Optional abort controller. * @returns An array of dynamic render state objects ready to be assigned to {@link RenderState.dynamic}. * @remarks * Only a subset of the features in {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html | glTF2} specs are supported. * More specifically, unsupported features are: * * {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-accessor-sparse | Sparse accessors} * * {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-animation | Animation} * * {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-camera | Camera} * * {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-skin | Skin} * * Currently the only extensions supported is {@link https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_unlit/README.md | KHR_materials_unlit}. * @category Geometry */ export declare function downloadGLTF(url: URL, baseObjectId?: number, abortController?: AbortController, extension?: "gltf" | "glb"): Promise; /** * Download scene from url. * @param baseUrl Url of the containing folder, e.g. `https://blobs.novorender.com//` * @param configPath The relative path to the scene json file, e.g. `webgl2_bin/` * @param abortSignal Optional abort signal. * @param urlBuilder Optional custom URL builder for file requests. * @returns A render state scene ready to be assigned to {@link RenderState.scene}. * @remarks * The loaded state does not contain any geometry, only the data required to start geometry streaming. * It may take several frames for any geometry to appear, and several seconds for it to fully resolve. * @category Render State */ export declare function downloadScene(baseUrl: URL, configPath: string, abortSignal?: AbortSignal, urlBuilder?: (baseUrl: string, filePath: string) => URL | Promise): Promise; /** An entity that can be used in measureView.draw.getDrawMeasureEntity, Objects returned from the api with draw kind parameter can be used*/ export declare interface DrawableEntity { /** Object id corresponding to he object ids gotten from picking from the core3d api*/ readonly ObjectId?: ObjectId; /** Collection of kinds that can be drawn using measureView.draw.getDrawMeasureEntity*/ readonly drawKind: "edge" | "face" | "vertex" | "curveSegment" | "manhole" | "measureResult" | "points"; } /** Draw context for keeping updated canvas widht height and camera properties */ export declare interface DrawContext { /** Pixel width of the render canvas. */ camera: Camera; /** Pixel height of the render canvas.*/ width: number; /** Camera values, RenderStateCamera from core 3d api can be used { @link RenderStateCamera }. */ height: number; } declare type DrawMode = "POINTS" | "LINE_STRIP" | "LINE_LOOP" | "LINES" | "TRIANGLE_STRIP" | "TRIANGLE_FAN" | "TRIANGLES"; /** * Module for converting measure data to drawable objects. * functions will generally use Camera to object to project the objects to view space */ export declare class DrawModule extends BaseModule { readonly worker: MeasureWorker; readonly parent: MeasureView; readonly drawContext: DrawContext; constructor(worker: MeasureWorker, parent: MeasureView, drawContext: DrawContext); /** @ignore */ getEntitiyObjects(entity: MeasureEntity, setting?: MeasureSettings): Promise; /** * Updates the input draw objects with new 2d info based on camera properties * @param drawProduct The product that will be updated based on current camera. * @returns Corresponding 3D position at the view plane in world space, or undefined if there is no active render context. */ updateProduct(drawProduct: DrawProduct, context?: DrawContext): void; /** Converts world space lines to on screen space lines * @param points World space points that will be projected to screen space * @param round Round result coordinates. Default is true * @returns Screen space points, a path that will cut to the edge of the screen, * points2d, all the points in 2d space regadless if they are within the current canvas size * and the original points removed from screen points */ toScreenSpace(points: ReadonlyVec3[], { round }?: { round?: boolean; }): { screenPoints: ReadonlyVec2[]; points2d: ReadonlyVec2[]; indicesOnScreen: number[]; } | undefined; /** Converts world space points to on screen space points * @param points World space points that will be projected to screen space * @returns Screen space points regadless if they are within the current canvas size * @deprecated use view.convert.worldSpaceToScreenSpace instead */ toMarkerPoints(points: ReadonlyVec3[]): (ReadonlyVec2 | undefined)[]; /** Returns a hierarcical structure of the element, describing how it should be drawn in 2d * @param entity the entity that is being drawn to screen, this can be any object that furfill the DrawableEntity interface {@link DrawableEntity} * @param setting settings on how the entity is supposed to be displayed * @returns hierarcical structure of the element, describing how it should be drawn in 2d, including labels and angles */ getDrawEntity(entity: DrawableEntity, setting?: MeasureSettings): Promise; /** Converts a list of points to draw parts, these can be added to a DrawObjects. * @param points Set of points describing a polygon or linestrip * @param setting settings on how the entity is supposed to be displayed * @returns hierarcical structure of the element, describing how it should be drawn in 2d, including labels and angles */ getDrawPartsFromPoints(points: ReadonlyVec3[], settings?: LinesDrawSetting, objectId?: number): DrawPart[]; /** Converts a list of points to a drawable polygon or linestrip * @param points Set of points describing a polygon or linestrip * @param setting settings on how the entity is supposed to be displayed * @param context Optional to display the drawn object in another context * @returns hierarcical structure of the element, describing how it should be drawn in 2d, including labels and angles */ getDrawObjectFromPoints(points: ReadonlyVec3[], settings?: LinesDrawSetting, context?: DrawContext): DrawProduct | undefined; /** Combines multiple segments into a single drawable object. * @param segments Line segments to be added to the list, These can be of any lenght * @param setting settings on how the entity is supposed to be displayed * @param context Optional to display the drawn object in another context * @returns hierarcical structure of the element, describing how it should be drawn in 2d, including labels and angles */ getDrawObjectFromLineSegments(segments: ReadonlyVec3[][], id: ObjectId_2, settings?: LinesDrawSetting, context?: DrawContext): DrawProduct | undefined; /** Returns a draw object that places a text based on input points. * @param points Set of points for where the text should be placed. * @param text Text * @param context Optional to display the drawn object in another context * @returns Draw product for displaying the text at chosen locations */ getDrawText(points: ReadonlyVec3[], text: string, context?: DrawContext): DrawProduct | undefined; /** Returns a draw object that traces intersection between the 2d paths and displays the 3d distance as a label * @param objects Products that are being traced. * @param line Line that traces over objects. * @returns Draw product for displaying lines between intersections and distance labels. */ getTraceDrawOject(objects: DrawProduct[], line: Line2d, align?: ReadonlyVec2): DrawProduct; /** returs the 2d normal of the first draw part the line hits * @param object Product with parts * @param line Line that needs to intersect the product. * @returns The 2d normal of the drawn object at the intersection of the input line. */ get2dNormal(object: DrawProduct, line: { start: ReadonlyVec2; end: ReadonlyVec2; }): { normal: ReadonlyVec2; position: ReadonlyVec2; } | undefined; } /** An object for 2d drawings, can contain multiple parts */ export declare interface DrawObject { /** Type of draw object */ readonly kind: "cylinder" | "plane" | "edge" | "curveSegment" | "vertex" | "complex" | "text" | "unknown"; /** Different parts of the object */ readonly parts: DrawPart[]; } declare type DrawParams = DrawParamsArrays | DrawParamsArraysMultiDraw | DrawParamsArraysInstanced | DrawParamsElements | DrawParamsElementsRange | DrawParamsElementsMultiDraw | DrawParamsElementsInstanced; declare interface DrawParamsArrays extends DrawParamsBase { /** Equivalent to gl.drawArrays() */ readonly kind: "arrays"; readonly count: number; readonly first?: number; } declare interface DrawParamsArraysInstanced extends DrawParamsBase { /** Equivalent to gl.drawArraysInstanced() */ readonly kind: "arrays_instanced"; readonly count: number; readonly instanceCount: number; readonly first?: number; } declare interface DrawParamsArraysMultiDraw extends DrawParamsBase { /** Equivalent to `ext.multiDrawArraysWEBGL()` */ readonly kind: "arrays_multidraw"; readonly drawCount: number; readonly firstsList: Int32Array; readonly firstsOffset?: number; readonly counts: Int32Array; readonly countsOffset?: number; } declare interface DrawParamsBase { readonly mode?: DrawMode; } declare interface DrawParamsElements extends DrawParamsBase { /** Equivalent to gl.drawElements() */ readonly kind: "elements"; /** # of indices to draw */ readonly count: number; /** Type of indices */ readonly indexType: "UNSIGNED_BYTE" | "UNSIGNED_SHORT" | "UNSIGNED_INT"; /** Byte offset in the element array buffer. Must be a valid multiple of the size of the given type. */ readonly byteOffset?: number; } declare interface DrawParamsElementsInstanced extends DrawParamsBase { /** Equivalent to gl.drawElementsInstanced() */ readonly kind: "elements_instanced"; readonly count: number; readonly instanceCount: number; readonly indexType: "UNSIGNED_BYTE" | "UNSIGNED_SHORT" | "UNSIGNED_INT"; readonly byteOffset?: number; } declare interface DrawParamsElementsMultiDraw extends DrawParamsBase { /** Equivalent to `ext.multiDrawArraysWEBGL()` */ readonly kind: "elements_multidraw"; readonly drawCount: number; readonly indexType: "UNSIGNED_BYTE" | "UNSIGNED_SHORT" | "UNSIGNED_INT"; readonly byteOffsets: Int32Array; readonly byteOffsetsOffset?: number; readonly counts: Int32Array; readonly countsOffset?: number; } declare interface DrawParamsElementsRange extends DrawParamsBase { /** Equivalent to gl.drawRangeElements() */ readonly kind: "elements_range"; /** # of indices to draw */ readonly count: number; /** Type of indices */ readonly indexType: "UNSIGNED_BYTE" | "UNSIGNED_SHORT" | "UNSIGNED_INT"; /** Byte offset in the element array buffer. Must be a valid multiple of the size of the given type. */ readonly byteOffset?: number; /** The minimum array index contained in buffer range. */ readonly minIndex: number; /** The maximum array index contained in buffer range. */ readonly maxIndex: number; } /** Information about object to draw for measurement */ export declare interface DrawPart { /** Name of the part */ readonly name?: string; /** Optional color */ readonly color?: string; /** * Display text of the part, * For lines of 2 points it is the length * For angles its the angle in degrees * For surfaces its a list of list strings. First list is for the outer loop while the remaining is for the voids */ readonly text?: string | string[][]; /** * Performs same function as `text`, but returns most numbers separately, * so they could be converted and formatted by the client. * Both `text` and `textTemplate` are returned. */ readonly textTemplate?: TextTemplate | TextTemplate[][]; /** Type of object to draw */ readonly drawType: "lines" | "filled" | "vertex" | "curveSegment" | "angle" | "text"; /** From/to 3d elevation of object, used for cylinder to or lines to show slope */ readonly elevation?: ElevationInfo | (ElevationInfo | undefined)[]; /** Void in the draw part, only valid for filled kind*/ readonly voids?: DrawVoid[]; /** World coordinates*/ readonly vertices3D: ReadonlyVec3[]; /** Direction of the points. Used for text rotation */ readonly directions3D?: ReadonlyVec3[]; /** View space coordinates, in pixel values, empty if the entire part is out of view*/ vertices2D?: ReadonlyVec2[]; /** Angles in 2D space. Angle will be defined only if directions3D is present */ angles2D?: number[]; /** Indices reffering to vertices3D and text if it is a list, -1 means an added empty text*/ indicesOnScreen?: number[]; } /** A hierarcical structure to draw 2d objects */ export declare interface DrawProduct { /** Type of draw product */ readonly kind: "basic" | "manhole" | "measureResult"; /** Objects to draw */ readonly objects: DrawObject[]; /** Object id of the drawn product*/ readonly ObjectId?: ObjectId; } declare type DrawStatistics = { readonly points: number; readonly lines: 0; readonly triangles: 0; } | { readonly points: 0; readonly lines: number; readonly triangles: 0; } | { readonly points: 0; readonly lines: 0; readonly triangles: number; }; /** Hole in a filled polygon */ export declare interface DrawVoid { /** View space coordinates, in pixel values, empty if the entire part is out of view*/ vertices2D?: ReadonlyVec2[]; /** World coordinates*/ vertices3D: ReadonlyVec3[]; /** Indices reffering to vertices3D and text if it is a list, -1 means an added empty text*/ indicesOnScreen?: number[]; } /** DuoMeasurementValues is a collection of values for measuring two objects */ export declare interface DuoMeasurementValues { readonly drawKind: "measureResult"; /** Total distance between the objects */ readonly distance?: number; /** Total normdistance between the objects from object A */ readonly normalDistance?: number; /** Distance on the X plane between the objects */ readonly distanceX: number; /** Distance on the Y plane between the objects */ readonly distanceY: number; /** Distance on the Z plane between the objects */ readonly distanceZ: number; /** Angle between objects, used for cylinders, and the directions*/ readonly angle?: { radians: number; angleDrawInfo: [vec3, vec3, vec3]; additionalLine?: [vec3, vec3]; }; /** Point to display normal distance between objects from object A */ readonly normalPoints?: vec3[] | undefined; /** information about the first object of calculation */ readonly measureInfoA?: MeasureObjectInfo; /** information about the second object of calculation */ readonly measureInfoB?: MeasureObjectInfo; } /** * Function that can be used for flyto will speed up and down * @param t input parameter * @returns modified parameter */ export declare function easeInOut(t: number): number; /** * Function that can be used for flyto will speed down * @param t input parameter * @returns modified parameter */ export declare function easeOut(t: number): number; declare interface EdgeData { readonly halfEdges: readonly [Index, Index | null]; readonly curve3D?: Index; readonly parameterBounds: readonly [number, number]; readonly vertices?: IndexPair; readonly arcLength: number; readonly aabb: AABB3; readonly virtual?: true; readonly tesselationParameters: readonly number[]; } /** EdgeValues is a collection of values for measurment on a single edge */ export declare type EdgeValues = LineValues | ArcValues | LineStripValues; export declare type ElevationInfo = { from: number; to: number; horizontalDisplay: boolean; slope?: number; }; /* Excluded from this release type: emptyActiveTexturesArray */ declare type EnumArray = { readonly [index: number]: T; }; /** Background/IBL environment description * @category Render View */ export declare interface EnvironmentDescription { /** Display name of environment */ readonly name: string; /** Data URL. */ readonly url: string; /** Thumbnail URL. */ readonly thumnbnailURL: string; } declare type F16 = Uint16Array; declare type F32 = Float32Array; declare type F64 = Float64Array; declare interface FaceData { readonly surface?: Index; readonly pickingSurfaces?: ReadonlyVec4[]; readonly facing: -1 | 1; readonly outerLoop: Index; readonly innerLoops?: readonly Index[]; readonly area: number; readonly aabb: AABB3; readonly triangulation: Triangulation; } /** FaceValues is a collection of values for measurment on a single face */ export declare type FaceValues = PlaneValues | CylinderValues | PolymeshValues; /** A basic GPU fill rate profiler. * @category Device Profile */ export declare class FillrateProfiler { /** The benchmark context. */ readonly benchmark: Benchmark; readonly program: WebGLProgram; readonly uniforms: { [k: string]: WebGLUniformLocation | null; }; /** * @param benchmark The benchmark context to use. * @param shaders The shader imports. */ constructor( /** The benchmark context. */ benchmark: Benchmark, shaders: ShaderImports["benchmark"]); /** * Measure fill rate by rendering a series of noisy, semi-transparent quads. * @returns Fill rate estimate in pixels/second. * @remarks * This test is quite inaccurate and does not match close to the nominal fill rate of a GPU, particularly on tile based mobile GPUs. * The result should only serve as a rough estimate. */ measure(): Promise; } /** Helper type for arrays of fixed size */ export declare type FixedSizeArray = N extends 0 ? never[] : { 0: T; length: N; } & ReadonlyArray; declare type FixedSizeArray_2 = N extends 0 ? never[] : { length: N; } & ReadonlyArray; /** The flight controller mimics the behavior of an ethereal, hovering drone, allowing unconstrained movements through walls and obstacles. * @category Camera Controllers */ export declare class FlightController extends BaseController { /** The context used for pick queries. */ readonly pick: PickContext; readonly conversions: ScreenSpaceConversions; /* Excluded from this release type: arrowKeyScale */ /** Can be overwritten by subclasses to change pivot button */ protected pivotButton: MouseButtons; /* Excluded from this release type: pivotFingers */ kind: string; projection: "pinhole"; private params; private _position; private readonly _orientation; private _pivot; private _fov; private _angularVelocity; private _flyToFromDeacceleration; private readonly resetPickDelay; private lastUpdatedMoveBegin; private lastUpdate; private lastUpdateWithWheel; private moveBeginDelay; private recordedMoveBegin; private recordedMoveBeginDepth; private recordedMoveBegin2d; private recordedMoveBeginObjectId; private inMoveBegin; /** * @param input The input source. * @param pick The context used for pick queries. */ constructor(input: ControllerInput, /** The context used for pick queries. */ pick: PickContext, conversions: ScreenSpaceConversions); /** Camera position, in world space. */ get position(): ReadonlyVec3; set position(value: ReadonlyVec3); /** Computed rotation quaternion, in world space. * @remarks * This rotation is derived from {@link pitch} and {@link yaw} angles. */ get rotation(): ReadonlyQuat; /** The camera pitch angle, in degrees. */ get pitch(): number; set pitch(value: number); /** The camera yaw angle, in degrees. */ get yaw(): number; set yaw(value: number); /** The camera vertical field of view angle, in degrees. */ get fov(): number; set fov(value: number); /** The optional pivot point to orbit around, in world space. */ get pivot(): PivotState | undefined; resetVelocity(): void; /** Update controller parameters. * @param params Set of parameters to change. */ updateParams(params: RecursivePartial): void; serialize(): ControllerInitParams; init(params: ControllerInitParams): void; autoFit(center: ReadonlyVec3, radius: number): void; moveTo(targetPosition: ReadonlyVec3, flyTime?: number, rotation?: ReadonlyQuat, easeFunction?: (t: number) => number): void; zoomTo(boundingSphere: BoundingSphere, flyTime?: number): void; update(): void; private deAccelerateRotation; stateChanges(state?: RenderStateCamera): Partial; mouseButtonChanged(event: MouseEvent): Promise; touchChanged(event: TouchEvent): Promise; moveBegin(event: TouchEvent | MouseEvent): Promise; private shouldStickToPrevPick; private resetPivot; private setPivot; /** Function for getting input modifiers based on how far the 3d objects are from the mouse cursor */ protected modifiers(): { mouseWheelModifier: number; mousePanModifier: number; touchMovementModifier: number; pinchModifier: number; scale: number; }; /** Function to get transformations since last updated. * This can be overwritten to easily change direction and scale of input while keeping the standard caluculation for flight controller */ protected getTransformations(): CameraTransformations; /** FlightController type guard function. * @param controller The controller to type guard. */ static is(controller: BaseController): controller is FlightController; /** FlightController type assert function. * @param controller The controller to type assert. */ static assert(controller: BaseController): asserts controller is FlightController; } /** Flight controller initialization parameters * @category Camera Controllers */ export declare interface FlightControllerParams { /** The camera linear velocity factor. * @defaultValue 1 */ linearVelocity: number; /** The camera rotational velocity factor. * @defaultValue 1 */ rotationalVelocity: number; /** Delay for pick updates, in milliseconds. * @defaultValue 200 */ pickDelay: number; /** * When set, the controller will sample the distance to the pixel under the mouse cursor, * or central pinch point, and move the camera with speed proportional to that distance. * The min and max determines the bounds of how slow/fast it is allowed to move. * * Setting this to `null` disables this feature, using a constant speed factor of 1.0. * @defaultValue null */ proportionalCameraSpeed: { readonly min: number; readonly max: number; } | null; } declare interface Float3 { readonly length: number; readonly x: F32; readonly y: F32; readonly z: F32; } declare interface Float3_2 { readonly length: number; readonly x: F32; readonly y: F32; readonly z: F32; } declare interface Float3_3 { readonly length: number; readonly x: F32; readonly y: F32; readonly z: F32; } declare interface Float3x3 { readonly length: number; readonly e00: F32; readonly e01: F32; readonly e02: F32; readonly e10: F32; readonly e11: F32; readonly e12: F32; readonly e20: F32; readonly e21: F32; readonly e22: F32; } declare interface Float3x3_2 { readonly length: number; readonly e00: F32; readonly e01: F32; readonly e02: F32; readonly e10: F32; readonly e11: F32; readonly e12: F32; readonly e20: F32; readonly e21: F32; readonly e22: F32; } declare interface Float3x3_3 { readonly length: number; readonly e00: F32; readonly e01: F32; readonly e02: F32; readonly e10: F32; readonly e11: F32; readonly e12: F32; readonly e20: F32; readonly e21: F32; readonly e22: F32; } /** Camera fly-to transition/animation parameter * @category Camera Controllers */ export declare interface FlyToParams { /** Total flight time in milliseconds. */ readonly totalFlightTime: number; /** The transition start camera orientation. */ readonly begin: Orientation; /** The transition end camera orientation. */ readonly end: Orientation; readonly easeFunction: (t: number) => number; } export declare class FollowModule extends BaseModule { /** * @ignore */ private followParametricEntity; /** Returns an object that can be used to calculate camera positions that follow the object * Supports Edges, curve segments and cylinder * @param object The object being selected. * @param selectionPosition Function need the selected position to select a subpart of the object in case it is composed of several parts. * @param setting Settings. * @returns Follow path object that will conain information as well as a function to use for following the parametric object, * undefined if the current picked part is not eligble for follow path */ followParametricObjectFromPosition(id: ObjectId, selectionPosition: ReadonlyVec3, setting?: MeasureSettings): Promise; /** Returns an object that can be used to calculate camera posisiotns that follow the objects * Supports multiple cylinder, * In case of one object, and that object only containing one curve segment it will return curve segment * @param ids Set of object ids to follow, can be line segments or cylinders. * @param setting Settings. * @returns Follow path object that will conain information as well as a function to use for following the parametric object, * undefined if there are no objects the can be followed in the ids list */ followParametricObjects(ids: ObjectId[], setting?: MeasureSettings): Promise; /** * Returns camera values for given parameter T, * if T is before start it will return camera values at start and if its larger than end it will return camera values for end */ getCameraValues(t: number, folowObject: FollowParametricObject): Promise; /** * Returns the closest start position on the line strip to the given position * @param followObject The follow object to get the closest start position from * @param position The position to get the closest start position from * @returns The closest start position on the line strip to the given position */ getClosestStation(followObject: FollowParametricObject, position: ReadonlyVec3): number | undefined; } /** Used to get camera values along a curve segment or cylinder center */ export declare interface FollowParametricObject { /** Type of object that is being followed */ readonly type: "edge" | "curve" | "cylinder" | "cylinders"; /** Collection of Object Ids, if multiple then it must be following cylinders*/ readonly ids: ObjectId[]; /** Information about the entity, used to avoid finding the objects in api functions*/ readonly selectedEntity: MeasureEntity | undefined; /** * Start and stop bounds of the followed object, * unless the parametric object specify otherwise start will be 0 and end will be the length of all segments */ readonly parameterBounds: ParameterBounds; /* Excluded from this release type: emulatedCurve */ /* Excluded from this release type: lineStrip */ } declare type FrameBufferBinding = FrameBufferTextureBinding | FrameBufferRenderBufferBinding; declare interface FrameBufferParams { readonly depth?: FrameBufferBinding; readonly stencil?: FrameBufferBinding; readonly color: readonly (FrameBufferBinding | null)[]; } declare interface FrameBufferRenderBufferBinding { readonly kind: "FRAMEBUFFER" | "DRAW_FRAMEBUFFER" | "READ_FRAMEBUFFER"; readonly renderBuffer: WebGLRenderbuffer | null; } declare interface FrameBufferTextureBinding { readonly kind: "FRAMEBUFFER" | "DRAW_FRAMEBUFFER" | "READ_FRAMEBUFFER"; readonly texture: WebGLTexture | null; readonly texTarget?: "TEXTURE_2D"; readonly level?: number; readonly layer?: number; } declare interface GenMipMap { readonly generateMipMaps?: boolean; } declare interface GeometryData { compoundCurve?: readonly Index[]; shells?: readonly Index[]; solids?: readonly Index[]; readonly aabb: { readonly min: ReadonlyVec3; readonly max: ReadonlyVec3; }; } /** * Create a device profile. * @param tier The performance level of device GPU, 0-3, where 0 is weakest. * @param resolutionScaling An optional scale factor to apply to output image resolution. * @returns A {@link DeviceProfile} reflecting the typical capabilities of a GPU at given tier level. * @remarks * A simple tier system is probably too simplistic but provides a starting point. * The resulting device profile may be modified further before passing it into the {@link View} constructor. * @category Device Profile */ export declare function getDeviceProfile(tier: GPUTier, resolutionScaling?: number): DeviceProfile; /* Excluded from this release type: getMaterialCommon */ /* Excluded from this release type: getOfflineViewState */ /** * GPU performance tier. * @remarks * This is a rough estimate of the capabilities of a device GPU. * 0 is weakest and 3 is strongest. * As a general guide, these are the targets for the different tiers: * - 0: Unknown GPU - A weak android device. Also the fallback tier for unknown GPUs. * - 1: IOS, IPad, high-end android device, weak integrated (intel) GPU * - 2: Mac M1 or better, strong integrated GPU or weak/old discrete GPU. * - 3: Discrete GPU, mid to high end. * @category Device Profile */ export declare type GPUTier = 0 | 1 | 2 | 3; /* Excluded from this release type: GradientKind */ declare interface Half2 { readonly length: number; readonly x: F16; readonly y: F16; } declare interface Half2_2 { readonly length: number; readonly x: F16; readonly y: F16; } declare interface Half2_3 { readonly length: number; readonly x: F16; readonly y: F16; } declare interface HalfEdgeData { readonly edge: Index; readonly curve2D?: Index; readonly parameterBounds: readonly [number, number]; readonly direction: -1 | 1; readonly face: Index; readonly faceVertexIndices: readonly Index[]; readonly aabb?: AABB2; } declare interface HashRange { readonly start: U32; readonly count: U32; } declare interface HashRange_2 { readonly start: U32; readonly count: U32; } declare interface HashRange_3 { readonly start: U32; readonly count: U32; } export declare interface HorizontalAlignment { segment: DrawObject; pointsOfCurvature: DrawPart; curvatures: DrawPart; } export declare type HorizontalPointOfCurvature = { station: number; point: ReadonlyVec3; index: number; kind: CurvatureKind; parameter?: number; }; /** Hover flight controller. * Fly speed/rotation is determined based on the mouse offset from the click position. * @category Camera Controllers */ export declare class HoverController extends FlightController { readonly pick: PickContext; kind: "hover"; private _motion; private _clickPos; private readonly _clickOffset; /** * The position of the mouse when the left button was pressed. */ get clickPosition(): vec2 | null; /** * Type of currently active motion. */ get motion(): "keepElevation" | "upDownLeftRight"; constructor(input: ControllerInput, pick: PickContext, conversions: ScreenSpaceConversions, _params?: FlightControllerParams); mouseButtonChanged(event: MouseEvent): Promise; touchChanged(event: TouchEvent): Promise; update(): void; getTransformations(): CameraTransformations; } /** Options for HSL + alpha color transformation. * @remarks * All input values are between 0 and 1. * See {@link https://en.wikipedia.org/wiki/HSL_and_HSV | Wikipedia} for more details on the HSV color space. * @category Render State */ export declare interface HSLAOptions { /** Lightness adjustment. */ readonly lightness: number | LinearTransform; /** Saturation adjustment (scale). */ readonly saturation: number; /** Opacity/alpha adjustment. */ readonly opacity: number | LinearTransform; } declare type I16 = Int16Array; declare type I32 = Int32Array; declare type I8 = Int8Array; declare type Index = number; declare type IndexPair = readonly [number, number]; /** * Create and initialize the core 3D render context. * @param deviceProfile Details about the device on which we're running. * @param canvas The html canvas to render to. * @param setRenderContext A callback function to call whenever the render context changes. * @param showWatermark Show company watermark. * @returns A method to explicitly set new device profile (from user input or debugging purposes). * This is a relatively low-level API that is aimed at advanced developers only. * You should call this method once for each view that you wish to render. * It will not return a {@link RenderContext} immediately, since that object is tied to a WebGLRenderingContext, which can be lost and recreated. * Instead it will call your setback function, either when the render context is ready or restored. * You can check {@link RenderContext.isContextLost} to see if the underlying WebGLRenderingContext is lost or not. * Changes to device profile will force a recreation of the entire context and should generally be avoided. * @category Render View */ export declare function initCore3D(deviceProfile: DeviceProfile, canvas: HTMLCanvasElement, setRenderContext: (context: RenderContext) => void, showWatermark: boolean, webglContextAttributes: WebGLContextAttributes): Promise; /* Excluded from this release type: inspectDeviations */ declare interface InstanceData { geometry: Index | string; transformation?: FixedSizeArray_2; } declare interface Int16_3 { readonly length: number; readonly x: I16; readonly y: I16; readonly z: I16; } declare interface Int16_3_2 { readonly length: number; readonly x: I16; readonly y: I16; readonly z: I16; } declare interface Int16_3_3 { readonly length: number; readonly x: I16; readonly y: I16; readonly z: I16; } declare interface Int32_3 { readonly length: number; readonly x: I32; readonly y: I32; readonly z: I32; } declare interface Int32_3_2 { readonly length: number; readonly x: I32; readonly y: I32; readonly z: I32; } declare interface Int8_3 { readonly length: number; readonly x: I8; readonly y: I8; readonly z: I8; } declare interface Int8_3_2 { readonly length: number; readonly x: I8; readonly y: I8; readonly z: I8; } declare interface Int8_3_3 { readonly length: number; readonly x: I8; readonly y: I8; readonly z: I8; } /** Sorted outlines on screen from closest to furthest from input point */ export declare type Intersection = { left: ReadonlyVec3[]; leftObjects?: number[]; leftNormals?: ReadonlyVec3[]; right: ReadonlyVec3[]; rightObjects?: number[]; rightNormals?: ReadonlyVec3[]; up: ReadonlyVec3[]; upObjects?: number[]; upNormals?: ReadonlyVec3[]; down: ReadonlyVec3[]; downObjects?: number[]; downNormals?: ReadonlyVec3[]; zUp?: ReadonlyVec3[]; zUpObjects?: number[]; zUpNormals?: ReadonlyVec3[]; zDown?: ReadonlyVec3[]; zDownObjects?: number[]; zDownNormals?: ReadonlyVec3[]; }; declare type Intersection_2 = { /** * Position of the intersection. * When using `xyOffsets` - position will be intersection at the offset, * but projected onto the XY plane. */ position: ReadonlyVec3; /** * Normal of the intersected triangle. */ normal: ReadonlyVec3; /** * Intersected object ID. */ objectId: number; /** * Tangent of the intersection. * If it's missing - it means * - Tangent was not requested * - There's no tangent for this intersection within `tangentThreshold` */ tangent?: ReadonlyVec3; }; /* Excluded from this release type: isQuotaExceeded */ /* Excluded from this release type: isRetryableStatus */ export declare type LaserIntersectionRequest = { /** * Z axis up direction. */ zDir: ReadonlyVec3; /** * Origin point to shoot lasers from. */ origin: ReadonlyVec3; /** * Direction to use for the X axis. * If not provided - will be determined based on the closest edge lying on the XY plane. * If it fails for some reason - use default. * If provided - Y direction is calculated based on normal and xDir and then xDir is updated * based on the Y direction, so all three directions are orthogonal. * @default [1, 0, 0] */ xDir?: ReadonlyVec3; /** * Check left (negative X) direction. * @default false */ left?: boolean; /** * Check right (positive X) direction. * @default false */ right?: boolean; /** * Check up (positive Y) direction. * @default false */ up?: boolean; /** * Check down (negative Y) direction. * @default false */ down?: boolean; /** * Check Z axis up (positive Z) direction. * @default false */ zUp?: boolean; /** * Check Z axis down (negative Z) direction. * @default false */ zDown?: boolean; /** * Minimum distance from the origin to consider an intersection valid. * @default 0.001 */ minDistFromOrigin?: number; /** * Minimum distance between results to consider them valid. * The furthest from origin result is discarded. * @default 0.001 */ minDistBetweenResults?: number; /** * Whether intersection tangents should be populated. * Tangent shows direction of an intersection between the intersected triangle * and another close triangle (if there's any). * This can be useful for styling intersection points. * @default true */ populateTangents?: boolean; /** * When looking for tangents - intersection is usually slightly off if laser * is not pefectly at the surface but a bit below it. * This offset allows searching for intersecting triangles with a threshold. * @default 0.003 */ tangentThreshold?: number; /** * Find N intersections and then stop searching in this direction. * This is useful to limit the number of intersections and speed up the search. * @default undefined */ resultLimit?: number; /** * In addition to searching triangle intersection with given directions - * shift each triangle by -offset along Z axis (or shift XY plane by offset) * and check for intersection again. * If original laser is offset by -offset (so installed slightly below the surface) - * xyOffsets can be used to find intersections above the surface at the same time. * Returned points are still lying on the XY plane, so the intersection might feel slightly off. * In this sense it simulates sensitivity or threshold. * @default undefined */ xyOffsets?: number[]; /** * Assume that incoming zDir is not exact. * Search for original clicked triangle by looking at * triangles of the given object ID and that are closely aligned with the given zDir. * @default false */ validateNormal?: false | { objectId: number; position: ReadonlyVec3; }; }; export declare type LaserIntersectionResult = { /** * Intersections in the left (negative X) direction. */ left: Intersection_2[]; /** * Intersections in the right (positive X, `xDir`) direction. */ right: Intersection_2[]; /** * Intersections in the up (positive Y) direction. */ up: Intersection_2[]; /** * Intersections in the down (negative Y, `yDir`) direction. */ down: Intersection_2[]; /** * Intersections in the Z axis up (positive Z, `zDir`) direction. */ zUp: Intersection_2[]; /** * Intersections in the Z axis down (negative Z) direction. */ zDown: Intersection_2[]; /** * X direction used for the intersection. * May differ from provided xDir if it is not provided or * if it doesn't make orthonormal basis with zDir. */ xDir: ReadonlyVec3; /** * Y direction used for the intersection. * Calculated as cross(xDir, zDir). */ yDir: ReadonlyVec3; /** * Z direction used for the intersection. * Can differ from provided zDir if `validateNormal` was used. */ zDir: ReadonlyVec3; }; /** * Laser interseciton values collected from a single brep face */ export declare interface LaserIntersections { kind: "plane" | "cylinder"; /** Intersection in x direction negative direction first then negative*/ x: ReadonlyVec3[][]; /** Intersection in y direction negative direction first then negative*/ y: ReadonlyVec3[][]; /** Intersection in z direction negative direction first then negative*/ z: ReadonlyVec3[][]; /** X direction of the face*/ xDirection?: ReadonlyVec3; /** Y direction of the face*/ yDirection?: ReadonlyVec3; /** Z direction of the face*/ zDirection?: ReadonlyVec3; } export declare type Line2d = { start: ReadonlyVec2; end: ReadonlyVec2; }; declare interface Line2DData { readonly kind: "line"; readonly origin: ReadonlyVec2; readonly direction: ReadonlyVec2; } declare interface Line3DData { readonly kind: "line"; readonly origin: ReadonlyVec3; readonly direction: ReadonlyVec3; } /** Linear transform options. * @remarks * The transform is performed by first applying scale, then adding offset, i.e.: result = value * scale + offset. * If scale = 0, offset will effectively replace input value. * @category Render State */ export declare interface LinearTransform { /** Multiplicand for input value. Default = 1.*/ readonly scale?: number; /** Addend for scaled input value. Default = 0. */ readonly offset?: number; } declare interface LineCluster { readonly objectId: number; readonly segments: number; readonly vertices: Float32Array; readonly normals: Int16Array; readonly points: Uint32Array; active: boolean; } /** Setting for drawing lines */ export declare interface LinesDrawSetting { /** If closed is set to true the line enpoints will be joined and the polygon filled */ closed?: boolean; /** Generate angles between each line segment */ angles?: boolean; /** Generate length labels on each line segment in meters */ generateLengthLabels?: boolean; /** Generate slope labels in percentage and and direction arrow on each line segment*/ generateSlope?: boolean | Set; /** Number of decimals on labels */ decimals?: number; } declare interface LineStrip3DData { readonly kind: "lineStrip"; readonly vertices: ReadonlyVec3[]; } /** Gives values based on selected linestrip*/ export declare interface LineStripMeasureValues { /** The total length of the linestrip */ readonly totalLength: number; /** The input vertices */ readonly linestrip: ReadonlyVec3[]; /** List of lenths based on line segments starting with segment between vertex 0 and 1 */ readonly segmentLengts: number[]; /** List of angles between line segments starting with angle between segment 0 and 1 */ readonly angles: number[]; } /** LineStripValues is a collection of values for measuring a line strip */ export declare interface LineStripValues { readonly kind: "lineStrip"; /** Accumulated length of all lines in strip */ readonly totalLength?: number; } /** LineValues is a collection of values for measuring a single line */ export declare interface LineValues { readonly kind: "line"; /** Distance from the start to the end of the line */ readonly distance: number; /** Gradient of the line */ readonly gradient: vec3; /** The start of the line */ readonly start: vec3; /** The end of the line */ readonly end: vec3; } /** Load status of the parametric object, uknown means that it have never been fetched and missing means that the object does not have parametric data*/ export declare type LoadStatus = "loaded" | "unknown" | "missing"; /** * An interface for reporting status updates, progress and errors to UI. * @remarks * Loggers report updates to their associated object, e.g. an offline context or an individual offline scene. */ export declare interface Logger { /** * Update the current status of object, intended for permanent display. * @param state The new state of object, e.g. "ready", "error" or "completed". */ status(state: string): void; /** * Log an informational message, mostly intended for diagnostics. * @param message: The message to be displayed. */ info?(message: string): void; /** * Log an error message. * @param message: The error message to be displayed. */ error(message: OfflineErrorMessage): void; /** * Update progress for potentially long running processes, such as synchronization. * @param value The progress as a factor between 0 and {@link max}. * @param max The maximum value, or `undefined` if value is also undefined. * @param operation The operation currently being progressed. */ progress?(value: number, max: number | undefined, operation: "scan" | "download"): void; } declare interface LoopData { readonly halfEdges: readonly Index[]; readonly errorMargin?: number; } declare namespace LTS { export { readSchema_3 as readSchema, version_3 as version, PrimitiveType_3 as PrimitiveType, OptionalVertexAttribute_3 as OptionalVertexAttribute, MaterialType_4 as MaterialType, TextureSemantic_3 as TextureSemantic, HashRange_3 as HashRange, SubMeshProjectionRange_3 as SubMeshProjectionRange, DescendantObjectIdsRange_3 as DescendantObjectIdsRange, VertexRange_3 as VertexRange, VertexIndexRange_3 as VertexIndexRange, TextureInfoRange_3 as TextureInfoRange, PixelRange_3 as PixelRange, ChildInfo_3 as ChildInfo, Double3_3 as Double3, Bounds_3 as Bounds, AABB_4 as AABB, Float3_3 as Float3, BoundingSphere_4 as BoundingSphere, SubMeshProjection_3 as SubMeshProjection, SubMesh_3 as SubMesh, TextureInfo_3 as TextureInfo, Float3x3_3 as Float3x3, Vertex_3 as Vertex, Int16_3_3 as Int16_3, Int8_3_3 as Int8_3, RGBA_U8_3 as RGBA_U8, Half2_3 as Half2, Deviations_2 as Deviations, Triangle_3 as Triangle, Schema_3 as Schema } } declare type MagFilterString = "NEAREST" | "LINEAR"; /** Gives values based on selected manhole, * must contain a top plane, bottom plane an a cylinder running for atleast 50% of the distance between top and bottom * Tesselated manholes will not work */ export declare interface ManholeMeasureValues { /** Can be drawn by Api.getDrawMeasureEntity*/ readonly drawKind: "manhole"; /** Object id from the web-gl api*/ readonly ObjectId: ObjectId; /** Plane at the top of the manhole*/ readonly top: PlaneValues; /** Z value of the top plane, center is used if tilted*/ readonly topElevation: number; /** Outer bottom plane of the manhole*/ readonly bottomOuter: PlaneValues; /** Z value of the outer bottom plane, center is used if tilted*/ readonly bottomOuterElevation: number; /** Inner bottom plane, can only be found if circular planes are used, else this is always undefiend*/ readonly bottomInner?: PlaneValues; /** Z value of the inner bottom plane, center is used if tilted*/ readonly bottomInnerElevation?: number; /** Inner cylinder if there are 2 cylinders in the manhole */ readonly inner?: CylinderValues; /** Radius of the inner cylinder */ readonly innerRadius?: number; /** Radius of the outer cylinder, outer will be chosen if only one exists */ readonly outer: CylinderValues; /** Radius of the outer cylinder */ readonly outerRadius: number; /** * @ignore * Internal values used for drawing */ readonly internal: { readonly top: FaceData; readonly bottomOuter: FaceData; readonly bottomInner?: FaceData; readonly inner?: FaceData; readonly outer: FaceData; }; } /** * Modules specialized for measuring manholes */ export declare class ManholeModule extends BaseModule { /** * Give manhole measure object to inspect from objectId, * note that this object can be used for all measurement {@link measure} * and aslo be drawn {@link DrawableEntity} * @param ObjectId The object Id where the api try to fetch manhole object from * @returns Values for manhole measurement, */ measure(objectId: number): Promise; /** * @ignore */ getManholeDrawObject(entity: ManholeMeasureValues): Promise; } /** Scene materials property arrays, encoded as base 64 strings. * @category Render State */ export declare interface MaterialProperties { /** Diffuse color properties. */ readonly diffuse: { readonly red: Base64String; readonly green: Base64String; readonly blue: Base64String; }; /** Opacity properties. */ readonly opacity: Base64String; /** Specular properties. */ readonly specular: { readonly red: Base64String; readonly green: Base64String; readonly blue: Base64String; }; /** Shininess properties. */ readonly shininess: Base64String; } declare type MaterialTextures = ReturnType; declare const MaterialType: typeof Current.MaterialType; declare type MaterialType = Current.MaterialType | Previous.MaterialType | LTS.MaterialType; declare const enum MaterialType_2 { opaque = 0, opaqueDoubleSided = 1, transparent = 2, elevation = 3 } declare const enum MaterialType_3 { opaque = 0, opaqueDoubleSided = 1, transparent = 2, elevation = 3 } declare const enum MaterialType_4 { opaque = 0, opaqueDoubleSided = 1, transparent = 2, elevation = 3 } declare const enum MaterialType_5 { opaque = 0, opaqueDoubleSided = 1, transparent = 2, elevation = 3 } /** A helper object for computing transformation matrices between {@link CoordSpace | spaces} on demand. * @category Render State */ export declare interface Matrices { /** * Return a 4x4 matrix for transforming coordinate from one space to another. * @param from The original space. * @param to The destination space. */ getMatrix(from: CoordSpace, to: CoordSpace): ReadonlyMat4; /** * Return a 3X3 matrix for transforming normals from one space to another. * @param from The original space. * @param to The destination space. * @remarks * Normals has to be normalized after transformation. */ getMatrixNormal(from: CoordSpace, to: CoordSpace): ReadonlyMat3; } /** Maximum number of simultaneous textures allowed. */ export declare type MaxActiveTextures = 10; /** * Interface often used in the measure api to describe a selected parametric object, * It can either be an object or a simple 3d point * Any measure entity can be drawn using the draw module {@link DrawModule} */ export declare type MeasureEntity = (ParametricEntity & { curvePart?: "edgeMidpoint" | "arcCenter"; }) | PointEntity; export declare interface MeasureEntityPickResult { entity: MeasureEntity | undefined; status: LoadStatus; connectionPoint?: vec3; } /** * Base class for specific errors from the measure API. */ export declare class MeasureError extends Error { readonly type: string; constructor(type: string, message: string); } /** MeasurementValues is a collection of values for any measurment */ export declare type MeasurementValues = EdgeValues | FaceValues | DuoMeasurementValues; export declare interface MeasureObjectInfo { /** Closest point on object */ readonly point?: vec3; /** Parameter on closest point, one if its a curve two if its a surface */ readonly parameter?: number | [number, number]; /** The valid measurement settings for object*/ readonly validMeasureSettings?: boolean; } /** Additional options for measurement */ export declare interface MeasureSettings { /** Where to measure cylinder from, in case of measure between two cylinder, same option will be used for both*/ cylinderMeasure?: CylinerMeasureType; /** Setting to get labels along the curve when drawing segments*/ segmentLabelInterval?: number; /** Forces measures taken to the plane*/ planeMeasure?: ReadonlyVec4; } /** * Master class for all measure functionality * The functionality is split into separate modules */ export declare class MeasureView { readonly drawContext: DrawContext; /** * Module for collision calculations, see {@link CollisionModule} */ collision: CollisionModule; /** * Module for drawing measure objects on screen, see {@link DrawModule} */ draw: DrawModule; /** * Module for following parameteric objects such as line strips and cylinders, see {@link FollowModule} */ followPath: FollowModule; /** * Module for inspecting and measuring manholes, see {@link ManholeModule} */ manhole: ManholeModule; /** * Module for general measuring functions, see {@link CoreModule} */ core: CoreModule; /** * Module for 2d profiles from lines or cylinders, see {@link ProfileModule} */ profile: ProfileModule; /** * Module for road spesific calulations and data, see {@link RoadModule} */ road: RoadModule; /** * Measure worker */ readonly worker: MeasureWorker; /** Main-thread end of the URL provider MessagePort. * * The opposite end (`port2`) is transferred to the worker during * {@link loadScene}. This port lets the measure worker request fresh URLs * from the host's `urlBuilder` (e.g. for short-lived Procore signed URLs) * without restarting the worker. * * Held on the instance so {@link dispose} can close it cleanly. */ private urlProviderPort?; /** Tracks whether {@link loadScene} has completed successfully. Used to * fail-fast on accidental second calls — the underlying worker's * `initialize` is idempotent, so a second call would silently strand the * newly-supplied `urlProviderPort`. */ private hasLoaded; /** * Creates a measure view.. */ constructor(drawContext: DrawContext); loadScene(baseUrl: URL, brepLutPath: string, _abortSignal?: AbortSignal, useProcoreUrlFormat?: boolean, urlBuilder?: (baseUrl: string, filePath: string) => URL | Promise): Promise; /** * Cleanup if measure module is no longer needed */ dispose(): void; } declare class MeasureWorker { private readonly worker; private pendingCalls; private messageId; constructor(); private handleMessage; private handleError; private callWorker; /** Like {@link callWorker} but supports a Transferable list — used to hand * a MessagePort over to the worker during initialize. */ private callWorkerWithTransfer; initialize(config: MeasureWorkerConfig, transfer?: Transferable[]): Promise; downloadBrep(id: number): Promise<{ product: ProductData; size: number; } | null>; isBrepGenerated(id: number): Promise; getCameraValuesFromFace(id: ObjectId_2, faceIdx: number, instanceIdx: number, cameraDir: vec3): Promise; getFaces(id: ObjectId_2, viewWorldMatrix: ReadonlyMat4): Promise; getProductObject(productId: number): Promise; getParameterBoundsForCurve(id: ObjectId_2, pathIdx: number, pathKind: "edge" | "curveSegment"): Promise; evalCurve(id: ObjectId_2, pathIdx: number, instanceIdx: number, parameter: number, pathKind: "edge" | "curveSegment"): Promise<[ReadonlyVec3, ReadonlyVec3] | undefined>; getCylinderCurve(id: ObjectId_2, faceIdx: number, instanceIdx: number, setting?: MeasureSettings): Promise<[ParameterBounds, [ReadonlyVec3, ReadonlyVec3]] | undefined>; pickFaceEntity(id: ObjectId_2, position: vec3, tolerance?: number, allowGenerated?: boolean): Promise<{ entity: MeasureEntity; status: LoadStatus; faceType: "surface" | "polymesh" | "points"; connectionPoint?: vec3; } | undefined>; pickEntity(id: ObjectId_2, position: vec3, tolerance?: SnapTolerance, allowGenerated?: boolean): Promise<{ entity: MeasureEntity; status: LoadStatus; connectionPoint?: vec3; }>; pickEntityOnCurrentObject(id: ObjectId_2, position: vec3, tolerance: SnapTolerance, allowGenerated?: boolean): Promise; getEdges(id: ObjectId_2, viewWorldMatrix: ReadonlyMat4): Promise; getPaths(id: ObjectId_2, worldViewMatrix: ReadonlyMat4): Promise; getCurveSegmentEntity(id: ObjectId_2): Promise; getTesselatedEdge(id: ObjectId_2, edgeIdx: number, instanceIdx: number): Promise; getCurveFromSegment(id: ObjectId_2, curveSegmentIdx: number): Promise; getLaserObject(id: ObjectId_2, faceIdx: number, instanceIdx: number, position: ReadonlyVec3): Promise<{ drawObject: DrawObject; laserValues: LaserIntersections; } | undefined>; getCurveSegmentDrawObject(id: ObjectId_2, curveSegmentIdx: number, instanceIdx: number, segmentLabelInterval?: number): Promise; curveSegmentProfile(id: ObjectId_2, curveSegmentIdx: number, instanceIdx: number): Promise; cylinderProfile(id: ObjectId_2, faceIdx: number, instanceIdx: number, setting?: MeasureSettings): Promise; multiSelectProfile(products: ObjectId_2[], setting?: MeasureSettings): Promise; getLineStripFromCylinders(products: ObjectId_2[], setting?: MeasureSettings): Promise; cylindersToLinestrip(products: ObjectId_2[], setting?: MeasureSettings): Promise; getFaceDrawObject(id: ObjectId_2, faceIdx: number, instanceIdx: number, setting?: MeasureSettings): Promise; edgeToEdgeMeasure(idA: ObjectId_2, edgeIdxA: number, instanceIdxA: number, idB: ObjectId_2, edgeIdxB: number, instanceIdxB: number): Promise; edgeToPointMeasure(id: ObjectId_2, edgeIdx: number, instanceIdx: number, point: vec3): Promise; segmentToPointMeasure(id: ObjectId_2, segIdx: number, instanceIdx: number, point: vec3): Promise; faceToPointMeasure(id: ObjectId_2, faceIdx: number, instanceIdx: number, point: vec3, setting?: MeasureSettings): Promise; edgeToFaceMeasure(idA: ObjectId_2, edgeIdx: number, edgeInstanceIdx: number, idB: ObjectId_2, faceIdx: number, faceInstanceIdx: number, setting?: MeasureSettings): Promise; faceToFaceMeasure(idA: ObjectId_2, faceIdxA: number, instanceIdxA: number, idB: ObjectId_2, faceIdxB: number, instanceIdxB: number, settingA?: MeasureSettings, settingB?: MeasureSettings): Promise; segmentToSegmentMeasure(idA: ObjectId_2, segIdxA: number, instanceIdxA: number, idB: ObjectId_2, segIdxB: number, instanceIdxB: number): Promise; segmentToEdgeMeasure(idA: ObjectId_2, segIdx: number, segInstanceIdx: number, idB: ObjectId_2, edgeIdx: number, edgeInstanceIdx: number): Promise; segmentToFaceMeasure(idA: ObjectId_2, segIdx: number, segInstanceIdx: number, idB: ObjectId_2, faceIdx: number, faceInstanceIdx: number, setting?: MeasureSettings): Promise; getCurveValues(id: ObjectId_2, pathIdx: number, instanceIdx: number, pathKind: "edge" | "curveSegment"): Promise; getFaceValues(id: ObjectId_2, faceIdx: number, instanceIdx: number, setting?: MeasureSettings): Promise; getVertexEdges(id: ObjectId_2, instanceIdx: number, pathIdx: number): Promise; getManholeValues(id: ObjectId_2): Promise; getManholeDrawObject(entity: ManholeMeasureValues): Promise; swapCylinder(id: ObjectId_2, faceIdx: number, instanceIdx: number, to: "inner" | "outer"): Promise; faceToFaceCollision(idA: ObjectId_2, faceIdxA: number, instanceIdxA: number, idB: ObjectId_2, faceIdxB: number, instanceIdxB: number, setting?: MeasureSettings): Promise; getAlignment(id: ObjectId_2): Promise; terminate(): void; isReady(): boolean; } declare interface MeasureWorkerConfig { baseUrl: string; lutPath: string; /** Optional flag to use Procore `?file=` URL format instead of path-appending. * Required because the worker can't see the host's `urlBuilder`; this tells the * worker how to construct fallback URLs when `urlProviderPort` is not used. */ useProcoreUrlFormat?: boolean; /** Optional MessagePort the worker uses to request fresh URLs from the main thread. * When provided, the worker delegates all URL construction to the host's `urlBuilder` * via this port — enabling per-request signed URL refresh for long-lived sessions * without restarting the measure view. See {@link UrlRequestMessage} / {@link UrlResponseMessage}. * When absent, the worker falls back to local URL construction using `baseUrl` + * `useProcoreUrlFormat`. */ urlProviderPort?: MessagePort; } /** * Utility function for merging the properties of two objects recursively * * @param original - Original, baseline object. * @param changes - Changes to be applied to baseline object. * @returns A clone of the original with all the changes applied. * * @remarks * This function is similar to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign | Object.assign}, only recursive. */ export declare function mergeRecursive(original: T | null | undefined, changes: RecursivePartial): T; /* Excluded from this release type: Mesh */ /* Excluded from this release type: MeshDrawRange */ /* Excluded from this release type: MeshObjectRange */ declare interface MeshState { mode?: ShaderMode; doubleSided?: boolean; } /** Meta data associated with an object. */ declare interface MetaDataEntry { /** The object render id/index. */ readonly id: ObjectId_2; /** The path of the object expressed as a hierarchical filesystem-like path string. */ readonly path: string; /** The name of object (typically a GUID from IFC database). */ readonly name: string; /** The type of node. */ readonly type: NodeType; /** The object's bounding volume. */ readonly bounds: Bounds_4; /** A string dictionary of any additional metadata properties associated with object. */ readonly properties: readonly [key: string, value: string][]; /** The hierarchical nesting level, if applicable */ readonly level?: number; /** A list of descendant object ids, if applicable. */ readonly descendants?: ObjectId_2[]; /** The description of object (typically from IFC database), if available. */ readonly description?: string; /** The url associated with object, if available. */ readonly url?: string; } declare type MinFilterString = "NEAREST" | "LINEAR" | "NEAREST_MIPMAP_NEAREST" | "LINEAR_MIPMAP_NEAREST" | "NEAREST_MIPMAP_LINEAR" | "LINEAR_MIPMAP_LINEAR"; declare type ModePrograms = { readonly [P in keyof typeof ShaderMode]: WebGLProgram; }; /** * Create a new copy of render state with specified modifications. * @param state The baseline render state. * @param changes The changes to apply to the baseline state. * @returns A new render state with all the changes applied. * @remarks * This function helps you modify render state in an immutable fashion, * which is key for correct and efficient render updates. * More specifically, it leaves all the unchanged sub objects of the returned render state alone. * This enables checking for changes using {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality | strict equality}. * Making unnecessary copies of unchanged sub objects will reduce render/update performance. * * This function also performs some basic validation of the new state changes, at a slight performance cost. * If validation fails, it will throw an error of `Error` objects, one per problem. * To mitigate this overhead, accumulating all the changes for a frame into a single object may be beneficial. * The {@link mergeRecursive} function may be useful in for this. * @category Render State */ export declare function modifyRenderState(state: RenderState, changes: RenderStateChanges): RenderState; /** Module shaders. */ export declare const moduleShaders: { readonly background: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly clipping: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly cube: { readonly render: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly line: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly intersect: { readonly vertexShader: string; }; }; readonly dynamic: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly grid: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly octree: { readonly render: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly line: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly point: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly debug: { readonly vertexShader: string; readonly fragmentShader: string; }; }; readonly tonemap: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly toon: { readonly vertexShader: string; readonly fragmentShader: string; }; readonly watermark: { readonly vertexShader: string; readonly fragmentShader: string; }; }; /** Flags for various mouse buttons. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons} * @category Camera Controllers */ export declare enum MouseButtons { none = 0, left = 1, right = 2, middle = 4, backward = 8, forward = 16 } declare type Mutable = { -readonly [P in keyof T]: T[P]; }; /* Excluded from this release type: MutableCameraState */ /* Excluded from this release type: Mutex */ /* Excluded from this release type: NodeBounds */ /* Excluded from this release type: NodeData */ /* Excluded from this release type: NodeGeometry */ /* Excluded from this release type: NodeGeometryKind */ declare type NodeLineClusters = Map; /* Excluded from this release type: NodeLoader */ /* Excluded from this release type: NodePayload */ /* Excluded from this release type: NodeState */ /* Excluded from this release type: NodeSubMesh */ /* Excluded from this release type: NodeTexture */ /** Type of node */ declare const enum NodeType { /** Node has children. */ Internal = 0, /** Node has no children. */ Leaf = 1 } /** Null type camera motion controller. * @remarks * This controller is completely passive and will not overwrite/modify any camera render state. * @category Camera Controllers */ export declare class NullController extends BaseController { kind: "null"; projection: undefined; /** * @param input The input source. */ constructor(input: ControllerInput); serialize(): ControllerInitParams; init(params: ControllerInitParams): void; autoFit(_center: ReadonlyVec3, _radius: number): void; update(): void; stateChanges(_state?: RenderStateCamera): Partial; /** NullController type guard function. * @param controller The controller to type guard. */ static is(controller: BaseController): controller is NullController; /** NullController type assert function. * @param controller The controller to type assert. */ static assert(controller: BaseController): asserts controller is NullController; mouseButtonChanged(_event: MouseEvent): Promise | void; touchChanged(_event: TouchEvent): Promise | void; moveBegin(_event: TouchEvent | MouseEvent): Promise | void; moveTo(_targetPosition: ReadonlyVec3, _flyTime?: number, _rotation?: ReadonlyQuat): void; zoomTo(_boundingSphere: BoundingSphere, _flyTime?: number): void; } declare interface Nurbs2DData { readonly kind: "nurbs"; readonly order: number; readonly controlPoints: ReadonlyVec2[]; readonly knots: number[]; readonly weights: number[] | undefined; } declare interface Nurbs3DData { readonly kind: "nurbs"; readonly order: number; readonly controlPoints: ReadonlyVec3[]; readonly knots: number[]; readonly weights: number[] | undefined; } declare interface NurbsSurfaceData { readonly kind: "nurbs"; readonly orders: [number, number]; readonly dim: [number, number]; readonly controlPoints: ReadonlyVec3[]; readonly knots: number[]; readonly weights: number[] | undefined; } /** * Object Id from the core 3d api. this is the way objects are linked between the general 3d api and the measure api */ export declare type ObjectId = number; /** Object render id/index. */ declare type ObjectId_2 = number; /** Options for {@link RenderContext.objectPixelCounts}. */ export declare interface ObjectPixelCountsOptions { /** Optional rectangular region in CSS pixels to scan. When omitted, the entire pick buffer is scanned. */ readonly region?: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number; }; /** Horizontal sampling stride in pixels (default 1). Values > 1 subsample the buffer to trade accuracy for speed, which is useful on high-DPI/high-resolution devices. */ readonly dx?: number; /** Vertical sampling stride in pixels (default 1). Values > 1 subsample the buffer to trade accuracy for speed, which is useful on high-DPI/high-resolution devices. */ readonly dy?: number; } /* Excluded from this release type: OctreeContext */ /* Excluded from this release type: OctreeModule */ /* Excluded from this release type: OctreeModuleContext */ /* Excluded from this release type: OctreeNode */ export declare interface OfflineContext { readonly manifestUrl: URL; isEnabled(): Promise; } /** * Offline directory interface. * @remarks * This objects offers a basic file folder-like abstraction for offline storage. */ declare class OfflineDirectoryOPFS { readonly context: OfflineStorageOPFS; /** The name of this folder. */ readonly name: string; constructor(context: OfflineStorageOPFS, /** The name of this folder. */ name: string); /** * Retrive the file names of this directory. * @remarks * Potentially slow? */ files(): AsyncIterableIterator; /** * Retrive the name and size of files downloaded to this directory. * @remarks * Will be cleared uplon fully downloading a scene as manifest can be used instead. */ getJournalEntries(): Promise>; /** * Retrive the name and size of files downloaded to this directory. * @remarks * Will be cleared uplon fully downloading a scene as manifest can be used instead. */ getDeleteQueueEntries(): Promise>; /** * Retrive the file sizes. * @param fileNames Optional list of files, or all files in dir if undefined. * @returns List of files sizes or undefined for files not found. */ filesSizes(fileNames?: readonly string[]): AsyncIterableIterator; /** * Read the specified file as an ArrayBuffer. * @param name The file name to read. * @returns The file content, or undefined if file does not exist. */ read(name: string): Promise; /** * Write the content of a file. * @param name: The file name to write. * @param buffer: The new content of this file. * @remarks * The input buffer may be transferred to an underlying worker and become inaccessible from the calling thread. * Thus, you should pass a copy if you need to retain the original. */ write(name: string, buffer: ArrayBuffer, { appendJournal }?: { appendJournal?: boolean | undefined; }): Promise; /** * Stream the content of a file. * @param name: The file name to write. * @param stream: The new content of this file. * @param size: The total byte size of the new file. * @remarks * The input buffer may be transferred to an underlying worker and become inaccessible from the calling thread. * Thus, you should pass a copy if you need to retain the original. */ writeStream(name: string, stream: ReadableStream, size: number, abortSignal?: AbortSignal, progress?: (bytes: number) => void): Promise; /** * Delete the specified file. * @param names The file names to delete. */ deleteFiles(names: Iterable, { closeJournal, rebuildJournal }?: { closeJournal?: boolean | undefined; rebuildJournal?: boolean | undefined; }): Promise; /** * Delete folder and everything inside it. */ delete(): Promise; } /** * Offline error code */ export declare enum OfflineErrorCode { /** * Device disk drive quota exceeded */ quotaExceeded = 0, /** * Device is offline */ offline = 1, /** * A file failed to download after exhausting retries, or returned a permanent (non-retryable) error. */ downloadFailed = 2 } /** * Offline error message */ export declare interface OfflineErrorMessage { /** * Human readable error message */ message: string; /** * Possible error type if it can be provided */ id?: OfflineErrorCode; } /** * An offline scene. * @remarks * This class supports incremental synchronization between offline and online storage. * Error and status updates are reported to the {@link logger} property. * By default it's undefined, so to display status, events and progress, you must assign your own object implementing the {@link Logger} interface. */ export declare class OfflineScene { /** The offline context for this scene. */ readonly context: OfflineViewState; /** The storage directory for this scene. */ readonly dir: OfflineDirectoryOPFS; /** The file manifest this scene. * @remarks * Initially, this may be empty or partial. * It may change when the scene is synchronized. */ manifest: SceneManifest; /** Logger for errors and status updates. */ logger: Logger | undefined; constructor( /** The offline context for this scene. */ context: OfflineViewState, /** The storage directory for this scene. */ dir: OfflineDirectoryOPFS, /** The file manifest this scene. * @remarks * Initially, this may be empty or partial. * It may change when the scene is synchronized. */ manifest: SceneManifest); /** Get the scene id. */ get id(): string; /** Delete all downloaded files for this scene and remove it from the context's list of offline scenes. */ delete(): Promise; /** * Get total number of used bytes. * @remarks * This file will scan through all the offline files to sum of their total size, * which can take a long time to complete. * Use manifest data instead if a valid manifest if available. */ getUsedSize(): Promise; /** * Reads the manifest file. * @param manifestUrl The url to the offline manifest, with sas key. * @param abortSignal A signal to abort downloads/synchronization. * @returns Total number of bytes in scene, if it fails it returns undefined */ readManifest(manifestUrl: URL, abortSignal: AbortSignal): Promise; /** * Drop the scene from the eviction loop's tracking. Awaits the loop's * `scene-removed` echo so bookkeeping is in sync on return. * * @param isTransitionToFullSync When true, the consumer-facing * `onIncrementalSceneRemoved` notification is suppressed. Used by * {@link OfflineScene.sync} to convert an incremental scene to a * fully-synced one without telling consumer UIs the scene was deleted. * Default `false` — the genuine-removal path used by * {@link OfflineScene.delete} (and the eviction loop's stale-scene * cleanup), which fires the notification. */ private removeSceneFromEviction; private removeSceneFilesFromEviction; private downloadManifest; /** * Delete files which are no longer used by the current manifest * @param sceneIndexUrl The url to the scene index.json file, complete with sas key. * @param abortSignal A signal to abort downloads/synchronization. * @returns True, if completed successfully, false if not. * @remarks * Errors are logged in the {@link logger}. */ deleteStaleFiles(sceneIndexUrl: URL, abortSignal: AbortSignal): Promise; /** * Incrementally synchronize scene files with online storage. * @param sceneIndexUrl The url to the scene index.json file, complete with sas key. * @param abortSignal A signal to abort downloads/synchronization. * @returns True, if completed successfully, false if not. * @remarks * Synchronization may be resumed after an abort/failure. * It compares the file manifest of local files with the online version and downloads only the difference. * Errors are logged in the {@link logger}. */ sync(sceneIndexUrl: URL, abortSignal: AbortSignal): Promise; } declare class OfflineStorageOPFS { readonly version: string; readonly worker: Worker | MessagePort; readonly promises: PromiseBag; readonly dirs: Map; readonly baseUrl: URL; readonly mode = "cors"; readonly urlBuilder: OfflineUrlBuilder | undefined; constructor(version: string, worker: Worker | MessagePort, options?: OPFSStorageOptions); parse(pathname: string, searchParams?: URLSearchParams): { readonly dir: string; readonly file: string; } | undefined; format(dir: string, file: string, type: ResourceType): string; /* Excluded from this release type: init */ /** * Decode request into directory and file name. * @param request A request generated from the {@link request} function. * @returns Request directory and file name, if url matches asset pattern, undefined otherwise. */ tryDecode(request: Request): { readonly dir: string; readonly file: string; } | undefined; /** * Decode request into directory and file name. * @param request A request generated from the {@link request} function. * @returns Request directory and file name. */ decode(request: Request): { readonly dir: string; readonly file: string; }; /** * Create a resource request. * @param dir The storage directory name. * @param file The storage file name. * @param signal A signal for aborting the request. * @param applyQuery Whether or not to apply query string to request url. * @returns A Request to feed to fetch() API and/or to match against cache entries. */ request(dir: string, file: string, type: ResourceType, query?: string, signal?: AbortSignal): Promise; /** * Determine if request is a potential offline asset or not. * @param request The resource request * @returns True, if request url matches that of a potential offline asset, False, if not. * @remarks * This function only check if the URL matches the pattern of potential offline assets, * not if it's actually available offline or not. * It's only meant as an early screening to not intercept purely online content. */ isAsset(request: Request): boolean; /** * Fetch resource from "offline storage, if available. * @param request The resource request * @returns A response or undefined if no match was found. */ fetch(request: Request): Promise; /** Existing directory names in this storage. */ get existingDirectories(): MapIterator; /** Check if directory already exists. */ hasDirectory(name: string): boolean; /** * Get or create a directory by name. * @param name The directory name. * @returns The directory storage. */ directory(name: string): Promise; private addDirectory; /** * Delete everything in this storage, including folders using a different/older schema. */ deleteAll(): Promise; initEvictionLoop(): Promise; disposeEvictionLoop(): Promise; } /** * URL-building hooks for backends with non-default URL shapes (e.g. Procore's * `/fas/api/.../?file=`). Omit for the default Novorender CDN format. */ export declare interface OfflineUrlBuilder { /** * Build a sync-download URL. `query` is the caller-supplied search string. * Sync (`URL`) and async (`Promise`) returns are both supported -- the * storage layer awaits the result so async builders (e.g. signed URLs that * mint per request) work transparently. */ buildRequestUrl(dir: string, file: string, type: ResourceType, query?: string): URL | Promise; /** * Reverse parser. Return `undefined` to fall back to the default 32-hex * path parser. Receives `searchParams` because some backends carry the * filename in `?file=` rather than the path. */ parsePathname?(pathname: string, searchParams: URLSearchParams): { dir: string; file: string; } | undefined; } /** * Viewstate for offline support UI. * @remarks * This view state serves as a base offline management UI. * The purpose is to view and manage offline scenes, such as updating/synchronizing with newer versions online. * A service worker will implement the actual offline support for the engine itself and will use the underlying storage objects for read access only. * Error and status updates are reported to the {@link logger} property. * By default it's undefined, so to display status, events and progress, you must assign your own object implementing the {@link Logger} interface. */ export declare class OfflineViewState { /** The offline storage used. */ readonly storage: OfflineStorageOPFS; /** The initially estimated storage usage and quotas, if available. You may use `navigator.estimate()` to get the latest update, although this doesn't necessarily reflect recent changes, hence the term "estimate". See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/estimate) for more details. */ readonly initialStorageEstimate: StorageEstimate | undefined; /** Map of active offline scenes */ readonly scenes: Map; readonly evictionBroadcastChannel: BroadcastChannel; onIncrementalSizeChange: ((size: number) => void) | undefined; onIncrementalSceneRemoved: ((sceneId: string) => void) | undefined; /** Logger for errors and status updates. */ logger: Logger | undefined; constructor( /** The offline storage used. */ storage: OfflineStorageOPFS, /** The initially estimated storage usage and quotas, if available. You may use `navigator.estimate()` to get the latest update, although this doesn't necessarily reflect recent changes, hence the term "estimate". See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/estimate) for more details. */ initialStorageEstimate: StorageEstimate | undefined); /** * Add a new scene to offline storage. * @param id: The scene id. * @returns The offline scene, or undefined if error. * @remarks * This function will merely mark the scene as an offline candidate. * You need to call {@link OfflineScene.sync} for the scene to be downloaded and ready for offline use. * Errors are logged in the {@link logger}. */ addScene(id: string): Promise; /** * Delete all offline data and remove every offline scene. * @returns True if success, False if an error occurred. * @remarks * Errors are logged in the {@link logger}. */ deleteAll(): Promise; /** * Initialize the eviction loop. * @remarks * Errors are logged in the {@link logger}. */ initEvictionLoop(): Promise; /** * Dispose the eviction loop. * @remarks * Errors are logged in the {@link logger}. */ private disposeEvictionLoop; setIncrementalStorageLimit(limit: number): void; /** * Remove incremental scenes whose last access timestamp is strictly older * than `olderThanMs` (a millisecond epoch — typically * `Date.now() - desiredMaxAgeMs`). Scene ids in `skipSceneIds` are never * removed, even if their on-disk timestamp looks stale. */ removeStaleIncrementalScenes(olderThanMs: number, skipSceneIds?: string[]): void; registerSceneForEviction(sceneId: string): void; dispose(): Promise; } /** Options for {@link createOPFSStorage} / {@link OfflineStorageOPFS}. */ export declare interface OPFSStorageOptions { /** Optional URL builder for non-default backends. Omit for the Novorender CDN. */ urlBuilder?: OfflineUrlBuilder; } declare const enum OptionalVertexAttribute { normal = 1, color = 2, texCoord = 4, projectedPos = 8 } declare const enum OptionalVertexAttribute_2 { normal = 1, color = 2, texCoord = 4, projectedPos = 8 } declare const enum OptionalVertexAttribute_3 { normal = 1, color = 2, texCoord = 4, projectedPos = 8 } /** A camera controller for orbiting around a point of interest. * @category Camera Controllers */ export declare class OrbitController extends BaseController { kind: "orbit"; projection: "pinhole"; private params; private readonly _orientation; private _pivot; private _distance; private _fov; /** * @param input The input source. * @param params Optional initialization parameters. */ constructor(input: ControllerInput, params?: Partial); /** The current controller parameters. */ get parameters(): OrbitControllerParams; /** Computed position, in world space. * @remarks * This position is derived from {@link pivot} point, {@link distance}, rotated around {@link pitch} and {@link yaw} angles. */ get position(): vec3; /** Computed rotation quaternion, in world space. * @remarks * This rotation is derived from {@link pitch} and {@link yaw} angles. */ get rotation(): ReadonlyQuat; /** The pitch angle around the pivot point, in degrees. */ get pitch(): number; set pitch(value: number); /** The yaw angle around the pivot point, in degrees. */ get yaw(): number; set yaw(value: number); /** The pivot point to orbit around, in world space. */ get pivot(): ReadonlyVec3; set pivot(value: ReadonlyVec3); /** The distance from the pivot point, in meters. */ get distance(): number; set distance(value: number); /** The camera vertical field of view angle, in degrees. */ get fov(): number; set fov(value: number); /** Update controller parameters. * @param params Set of parameters to change. */ updateParams(params: Partial): void; serialize(includeDerived?: boolean): ControllerInitParams; init(params: ControllerInitParams): void; autoFit(center: ReadonlyVec3, radius: number): void; update(): void; stateChanges(state?: RenderStateCamera): Partial; /** OrbitController type guard function. * @param controller The controller to type guard. */ static is(controller: BaseController): controller is OrbitController; /** OrbitController type assert function. * @param controller The controller to type assert. */ static assert(controller: BaseController): asserts controller is OrbitController; mouseButtonChanged(_event: MouseEvent): Promise | void; touchChanged(_event: TouchEvent): Promise | void; moveBegin(_event: TouchEvent | MouseEvent): Promise | void; moveTo(_targetPosition: ReadonlyVec3, _flyTime?: number, _rotation?: ReadonlyQuat): void; zoomTo(_boundingSphere: BoundingSphere, _flyTime?: number): void; } /** Orbit type camera motion controller * @category Camera Controllers */ export declare interface OrbitControllerParams { /** The camera distance relative to pivot point in meters. */ readonly maxDistance: number; /** Linear velocity modifier (default is 1.0) */ readonly linearVelocity: number; /** Rotational velocity modifier (default is 1.0) */ readonly rotationalVelocity: number; } /** Camera controller 3D orientation in world space. * @category Camera Controllers */ export declare interface Orientation { /** Camera position. */ readonly pos: ReadonlyVec3; /** Camera pitch angle in degrees. */ readonly pitch: number; /** Camera yaw angle in degrees. */ readonly yaw: number; } export declare class OrthoController extends BaseController { kind: "ortho"; projection: "orthographic"; private params; private _position; private _orientation; private _fov; private _moveVelocity; private _smoothedLook; private _pivot; private readonly pick; private readonly conversions; /** * @param input The input source. */ constructor(input: ControllerInput, pick?: PickContext, conversions?: ScreenSpaceConversions); /** Camera position, in world space. */ get position(): ReadonlyVec3; set position(value: ReadonlyVec3); /** Computed rotation quaternion, in world space. * @remarks * This rotation is derived from {@link pitch}, {@link yaw} and {@link roll} angles. */ get rotation(): ReadonlyQuat; /** The camera pitch angle, in degrees. */ get pitch(): number; set pitch(value: number); /** The camera yaw angle, in degrees. */ get yaw(): number; set yaw(value: number); /** The camera roll angle, in degrees. */ get roll(): number; set roll(value: number); /** The camera vertical field of view angle, in meters. */ get fov(): number; set fov(value: number); /** Update controller parameters. * @param params Set of parameters to change. */ updateParams(params: Partial): void; serialize(): ControllerInitParams; init(params: ControllerInitParams): void; autoFit(center: ReadonlyVec3, radius: number): void; private deAccelerate; touchChanged(event: TouchEvent): void; mouseButtonChanged(event: MouseEvent): Promise; moveTo(targetPosition: ReadonlyVec3, flyTime?: number, rotation?: ReadonlyQuat, easeFunction?: (t: number) => number): void; zoomTo(boundingSphere: BoundingSphere, flyTime?: number): void; update(): void; /** * Compute per-input-type speed modifiers based on the current orthographic view size. * @remarks * In orthographic projection {@link _fov} is the world-space view height in meters, * which is the direct analog of flight's `dist * tan(fov/2) * 2`. * When {@link OrthoControllerParams.proportionalCameraSpeed} is set the raw scale is * clamped to [min, max] so movements never feel too slow when zoomed in or too fast * when zoomed out. Without the param all modifiers equal `_fov` and behaviour is * identical to the previous `scale = _fov / height` formulation once divided by `height` * at the call site. */ private modifiers; private setPivot; private resetPivot; private getTransformations; stateChanges(state?: RenderStateCamera): Partial; private static fovFromPerspective; /** OrthoController type guard function. * @param controller The controller to type guard. */ static is(controller: BaseController): controller is OrthoController; /** OrthoController type assert function. * @param controller The controller to type assert. */ static assert(controller: BaseController): asserts controller is OrthoController; moveBegin(_event: TouchEvent | MouseEvent): Promise | void; } /** Ortho controller initialization parameters. * @category Camera Controllers */ export declare interface OrthoControllerParams { /** The interval to use for stepping clipping planes in the depth direction, i.e. when using mouse navigate buttons. * @defaultValue 1.0 */ readonly stepInterval: number; /** Whether to use mouse pointer lock or not. * @defaultValue false */ readonly usePointerLock: boolean; /** Whether two finger rotate will rotate camera or not. * @defaultValue false */ readonly touchRotate: boolean; /** Enable de acceleration when letting go while moving in touch * @defaultValue false */ readonly deAcceleration: boolean; /** Allow mouse/touch to change pitch & yaw (orbit / look-around). * When false, all mouse buttons pan -- the current behavior. * @defaultValue false */ readonly mouseRotate: boolean; /** Rotational velocity factor, mirrors FlightControllerParams.rotationalVelocity. * @defaultValue 1 */ readonly rotationalVelocity: number; /** Which button orbits around a pivot vs looks around. * false -> flight mapping (pivotButton = right): LMB look, RMB orbit. * true -> cadMiddlePan mapping (pivotButton = left): LMB orbit, RMB look. * Only meaningful when mouseRotate is enabled. * @defaultValue false */ readonly orbitOnPrimaryButton: boolean; /** * When set, pan and zoom input speeds are proportional to the current orthographic * view size ({@link OrthoController.fov} in metres), clamped to [min, max]. * This mirrors {@link FlightControllerParams.proportionalCameraSpeed} — the ortho fov * in metres is the natural depth-proxy for an orthographic camera. * * Setting this to `null` disables clamping and uses the raw fov-proportional scale, * which matches the previous behaviour. * @defaultValue null */ readonly proportionalCameraSpeed: { readonly min: number; readonly max: number; } | null; } declare class OutlineRenderer { readonly context: OctreeModuleContext; readonly localSpaceTranslation: ReadonlyVec3; readonly plane: ReadonlyVec4; readonly edgeAngleThreshold: number; readonly minVertexSpacing: number; readonly highlightIndices: Uint8Array; readonly intersectionOffsets: number[] | undefined; static readonly denormMatrix16: mat4; static readonly denormMatrix32: mat4; readonly planeLocalMatrix: ReadonlyMat4; readonly planeLocalNormalMatrix: ReadonlyMat3; readonly localPlaneMatrix: ReadonlyMat4; readonly nodeLinesCache: WeakMap; readonly lineClusters: WeakRef[]; constructor(context: OctreeModuleContext, localSpaceTranslation: ReadonlyVec3, plane: ReadonlyVec4, edgeAngleThreshold: number, minVertexSpacing: number, highlightIndices: Uint8Array, intersectionOffsets: number[] | undefined); resetActiveClusters(): void; intersectTriangles(renderNodes: readonly RenderNode[]): IterableIterator; createNodeLineClusters(node: OctreeNode): Map; private getPosPS; makeBuffers(clusters: readonly LineCluster[], state: DerivedRenderState, outlineColor: RGB): { readonly linesCount: number; readonly pointsCount: number; readonly linesVAO: WebGLVertexArrayObject; readonly pointsVAO: WebGLVertexArrayObject; } | undefined; renderLines(count: number, vao: WebGLVertexArrayObject, pass: ShaderPass): void; renderPoints(count: number, vao: WebGLVertexArrayObject, pass: ShaderPass, showVertices?: boolean): void; getLineClusters(): IterableIterator; getVertices(cluster: LineCluster): IterableIterator; getLines(cluster: LineCluster): IterableIterator<[ReadonlyVec3, ReadonlyVec3]>; get2dLines(cluster: LineCluster): IterableIterator<[ReadonlyVec2, ReadonlyVec2]>; getNormalAt(cluster: LineCluster, triangleIndex: number): vec3; transformToPlane(v: ReadonlyVec3): ReadonlyVec2; transformFromPlane(v: ReadonlyVec2): ReadonlyVec3; } /** * Deviation sampled from screen */ export declare interface OutlineSample { /** x coordinate in pixel space */ readonly x: number; /** y coordinate in pixel space */ readonly y: number; /** World space position of underlying pixel. */ readonly position: ReadonlyVec3; } /** * NPM package version, if applicable. */ export declare const packageVersion: any; /** Panorama type camera motion controller * @remarks * For rotating the camera inside a sphere with a panorama image projected onto it. * @category Camera Controllers */ export declare class PanoramaController extends BaseController { kind: "panorama"; projection: "pinhole"; private params; private _position; private readonly _orientation; private _fov; /** * @param input The input source. */ constructor(input: ControllerInput); /** Camera position, in world space. */ get position(): ReadonlyVec3; set position(value: ReadonlyVec3); /** Computed rotation quaternion, in world space. * @remarks * This rotation is derived from {@link pitch} and {@link yaw} angles. */ get rotation(): ReadonlyQuat; /** The camera pitch angle, in degrees. */ get pitch(): number; set pitch(value: number); /** The camera yaw angle, in degrees. */ get yaw(): number; set yaw(value: number); /** The camera vertical field of view angle, in degrees. */ get fov(): number; set fov(value: number); /** Update controller parameters. * @param params Set of parameters to change. */ updateParams(params: Partial): void; serialize(): ControllerInitParams; init(params: ControllerInitParams): void; autoFit(center: ReadonlyVec3, radius: number): void; moveTo(targetPosition: ReadonlyVec3, flyTime?: number, rotation?: ReadonlyQuat): void; update(): void; stateChanges(state?: RenderStateCamera): Partial; /** PanoramaController type guard function. * @param controller The controller to type guard. */ static is(controller: BaseController): controller is PanoramaController; /** PanoramaController type assert function. * @param controller The controller to type assert. */ static assert(controller: BaseController): asserts controller is PanoramaController; mouseButtonChanged(_event: MouseEvent): Promise | void; touchChanged(_event: TouchEvent): Promise | void; moveBegin(_event: TouchEvent | MouseEvent): Promise | void; zoomTo(_boundingSphere: BoundingSphere, _flyTime?: number): void; } /** Panorama camera controller parameters * @category Camera Controllers */ export declare interface PanoramaControllerParams { /** The camera rotational velocity factor. * @defaultValue 1 */ rotationalVelocity: number; } /** Parameter bounds */ export declare interface ParameterBounds { /** Start of parameter */ readonly start: number; /** End of parameter*/ readonly end: number; } declare interface ParametricEdge { index: number; values: EdgeValues | undefined; } /** * This is the identification of a spesific edge, face or curve segment in the object. * It is often required by measure functions */ export declare interface ParametricEntity { /** Object Id from the core 3d api. */ ObjectId: ObjectId; /** the type of object that can be drawn from this spesific entity, see {@link DrawModule} */ drawKind: "edge" | "face" | "curveSegment" | "points"; kind: CurveKind | SurfaceKind | "polymesh" | "points"; /** @ignore */ pathIndex: number; /** @ignore */ instanceIndex: number; /** @ignore */ parameter?: number | ReadonlyVec2 | ReadonlyVec3; /** @ignore */ tangent?: ReadonlyVec3; /** @ignore */ normal?: ReadonlyVec3; } declare interface ParametricFace { index: number; values: FaceValues | undefined; outerLoop: ParametricEdge[]; innerLoops?: ParametricEdge[][]; } declare interface ParametricGeometry { index: number; solids: ParametricSolid[]; } declare interface ParametricProduct { geometries: ParametricGeometry[]; } declare interface ParametricSolid { volume?: number; outerShell: ParametricFace[]; innerShells?: ParametricFace[][]; } declare interface ParseConfig { readonly version: string; readonly hasPointIntensity?: boolean; readonly hasPointClassification?: boolean; readonly numPointDeviations?: number; } declare type PassPrograms = { readonly [P in keyof typeof ShaderPass]: ModePrograms; }; declare type PathInfo = { path: string; centerDepth: number; originalIndex: number; instanceIndex: number; kind: "edge" | "face"; }; declare interface PayloadPromiseMethods { readonly resolve: (value: NodePayload | undefined) => void; readonly reject: (reason: string) => void; } /* Excluded from this release type: PBRMaterialCommon */ /* Excluded from this release type: PBRMaterialInfo */ /* Excluded from this release type: PBRMaterialTextures */ /** A context interface for pick operations. * @remarks * This is used by some controllers to determine the position and depth of point of screen to allow e.g. orbiting around said point. * You may pass {@link View} or {@link RenderContext} directly, or wrap some custom variant of picking in your own object. * @see {@link View.pick} * @category Camera Controllers */ export declare interface PickContext { pick: (x: number, y: number, options?: PickOptions) => Promise; } /** Extra pick options. */ export declare interface PickOptions { /** The radius of the sample disc (0 yields a single pixel). */ readonly sampleDiscRadius?: number; /** True to wait for the pick buffers to be available, false to return whatever is in the current pick buffer synchronously. * @remarks The latter option is more error prone, but useful for e.g. mouse hover operations. */ readonly searchType?: PickSearchType; readonly async?: boolean; /** Return pick without depth. */ readonly pickCameraPlane?: boolean; /** Return only picked pixels with clipping outline. */ readonly pickOutline?: boolean; } /** * Pick Sample information */ export declare interface PickSample { /** relative x pixel offset (not css pixel) from pick center. */ readonly x: number; /** relative y pixel offset (not css pixel) from pick center. */ readonly y: number; /** World space position of underlying pixel. */ readonly position: ReadonlyVec3; /** World space normal of underlying pixel. */ readonly normal: ReadonlyVec3; /** The object id/index of underlying pixel. */ readonly objectId: number; /** The value of the currently selected point visualization of the underlying pixel, if any. */ readonly pointFactor?: number; /** The depth/distance from the view plane. */ readonly depth: number; /** The picked pixel is part of clipping outline */ readonly clippingOutline: boolean; } /** Extended pick sample information. * @category Render View */ export declare interface PickSampleExt extends PickSample { /** Sample normal, in view space. */ readonly normalVS: ReadonlyVec3; /** Whether sample lies on an edge, corner or surface. */ readonly sampleType: "edge" | "corner" | "surface"; } export declare type PickSearchType = "closestToCamera" | "closestToPickCenter"; /** A 3D rotation expressed as pitch, roll and yaw angles. * @see {@link https://en.wikipedia.org/wiki/Aircraft_principal_axes} * @category Camera Controllers */ export declare class PitchRollYawOrientation { private _pitch; private _yaw; private _roll; private _rot; /** * @param pitch Pitch angle, in degrees. * @param yaw Yaw angle, in degrees. * @param roll Roll angle, in degrees. */ constructor(pitch?: number, yaw?: number, roll?: number); /** Pitch angle, in degrees. */ get pitch(): number; set pitch(value: number); /** Roll angle, in degrees. */ get roll(): number; set roll(value: number); /** Yaw angle, in degrees. */ get yaw(): number; set yaw(value: number); /** Rotation expressed as a quaternion. * @remarks * The rotation will return a new object if after pitch, roll or yaw angles have changed since last time this accessor was called. * Othewise, it returns the previous, cached, object. * This enables {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality | strict equality} * to determine when the rotation remains unchanged. * @see {@link https://glmatrix.net/docs/module-quat.html} */ get rotation(): ReadonlyQuat; /** Set pitch, roll and yaw angles from rotation quaternion. * @param rot The rotation quaternion to decompose into angles. */ decomposeRotation(rot: ReadonlyQuat): void; private computeRotation; } declare type PivotState = { readonly center: ReadonlyVec3; readonly offset: ReadonlyVec3; readonly distance: number; readonly active: boolean; }; declare interface PixelRange { readonly start: U32; readonly count: U32; } declare interface PixelRange_2 { readonly start: U32; readonly count: U32; } declare interface PixelRange_3 { readonly start: U32; readonly count: U32; } declare interface PlaneData { readonly kind: "plane"; readonly transform: FixedSizeArray_2; readonly coefficients: FixedSizeArray_2; } /** PlaneValues is a collection of values for measuring a single Plane */ export declare interface PlaneValues { readonly kind: "plane"; /** Width of the plane */ readonly width?: number; /** Height of the plane */ readonly height?: number; /** Largest outer radius of the plane in case of only arcs */ readonly outerRadius?: number; /** Largest inner radius of the plane in case of only arcs */ readonly innerRadius?: number; /** Normal of the plane */ readonly normal: vec3; /** Calculated area of the plane */ readonly area?: number; /** Corner vertices of the plane */ readonly vertices: vec3[]; /** Outer edges of the plane*/ readonly outerEdges: EdgeValues[]; /** Inner edges of the plane*/ readonly innerEdges: EdgeValues[][]; /** Y value of the plane origin*/ readonly heightAboveXyPlane?: number; /** @ignore */ readonly entity: ParametricEntity; /** The maximum normal distance error, only applies for generated geometry*/ readonly errorMargin?: number; } export declare interface PointEntity { /** Object Id from the core 3d api. */ ObjectId: ObjectId; /** Point entity will always draw as a single vertex from the draw module, see {@link DrawModule}*/ drawKind: "vertex"; /** @ignore */ pathIndex?: number; /** @ignore */ instanceIndex?: number; /** @ignore */ parameter: ReadonlyVec3; } declare type PointOfCurvature = { parameter?: number; station: number; kind: CurvatureKind; }; /** A basic GPU point rate profiler. * @category Device Profile */ export declare class PointrateProfiler { /** The benchmark context. */ readonly benchmark: Benchmark; readonly program: WebGLProgram; readonly uniforms: { [k: string]: WebGLUniformLocation | null; }; /** * @param benchmark The benchmark context to use. * @param shaders The shader imports. */ constructor( /** The benchmark context. */ benchmark: Benchmark, shaders: ShaderImports["benchmark"]); /** * Measure fill rate by rendering a series of noisy, semi-transparent point primitives. * @returns Primitive/point rate estimate in primitives/second. * @remarks * This test is quite inaccurate and does not match close to the nominal primitive/triangle rate of a GPU, particularly on tile based mobile GPUs. * Points are being used instead of triangles since they more closely reflect the maximum theoretical primitive rate of most GPUs. * The result should only serve as a rough estimate. */ measure(): Promise; } export declare type PointVisualization = PointVisualizationRGB | PointVisualizationIntensity | PointVisualizationElevation | PointVisualizationDeviation | PointVisualizationClassification; /** * Classification visualization, will use the classification values and the color gradient described in {@link RenderStatePointCloud} */ export declare interface PointVisualizationClassification { readonly kind: "classification"; } /** * Deviation visualization, will use the classification values and the color gradient described in {@link RenderStatePointCloud} * The gradients will follow the deviation index */ export declare interface PointVisualizationDeviation { readonly kind: "deviation"; /** Deviation index */ readonly index: number; } /** * Elevation visualization, will use the global elevation and the color gradient described in {@link RenderStateTerrain} */ export declare interface PointVisualizationElevation { readonly kind: "elevation"; } /** * Intensity visualization, will use grayscale */ export declare interface PointVisualizationIntensity { readonly kind: "intensity"; } /** * Color visualization, will use the RGBA values in each vertex */ export declare interface PointVisualizationRGB { readonly kind: "color"; } /** PolymeshValues is a collection of values for measuring a face with no identifiable surface. * These are generated surfaces typically from tesselated data. */ export declare interface PolymeshValues { readonly kind: "polymesh"; /** Perimiter of the polymesh surface */ readonly perimiter: number; /** Start and end verticies for each curve in the face loop */ readonly vertices: vec3[]; /** Calculated area of the original triangles */ readonly area?: number; /** @ignore */ readonly entity: ParametricEntity; } declare type Pow2 = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32758 | 65536; declare namespace Previous { export { readSchema_2 as readSchema, version_2 as version, PrimitiveType_2 as PrimitiveType, OptionalVertexAttribute_2 as OptionalVertexAttribute, MaterialType_3 as MaterialType, TextureSemantic_2 as TextureSemantic, HashRange_2 as HashRange, SubMeshProjectionRange_2 as SubMeshProjectionRange, DescendantObjectIdsRange_2 as DescendantObjectIdsRange, VertexRange_2 as VertexRange, VertexIndexRange_2 as VertexIndexRange, TextureInfoRange_2 as TextureInfoRange, PixelRange_2 as PixelRange, ChildInfo_2 as ChildInfo, Double3_2 as Double3, Bounds_2 as Bounds, AABB_3 as AABB, Float3_2 as Float3, BoundingSphere_3 as BoundingSphere, SubMeshProjection_2 as SubMeshProjection, SubMesh_2 as SubMesh, TextureInfo_2 as TextureInfo, Float3x3_2 as Float3x3, Vertex_2 as Vertex, Int16_3_2 as Int16_3, Int32_3_2 as Int32_3, Int8_3_2 as Int8_3, RGBA_U8_2 as RGBA_U8, Half2_2 as Half2, Deviations, Triangle_2 as Triangle, Schema_2 as Schema } } declare const enum PrimitiveType { points = 0, lines = 1, lineLoop = 2, lineStrip = 3, triangles = 4, triangleStrip = 5, triangleFan = 6 } declare const enum PrimitiveType_2 { points = 0, lines = 1, lineLoop = 2, lineStrip = 3, triangles = 4, triangleStrip = 5, triangleFan = 6 } declare const enum PrimitiveType_3 { points = 0, lines = 1, line_loops = 2, line_strip = 3, triangles = 4, triangle_strip = 5, triangle_fan = 6 } /* Excluded from this release type: PrimitiveTypeString */ declare const primitiveTypeStrings: readonly ["POINTS", "LINES", "LINE_LOOP", "LINE_STRIP", "TRIANGLES", "TRIANGLE_STRIP", "TRIANGLE_FAN"]; declare interface ProductData { readonly version?: string; readonly units: string; readonly vertices: readonly VertexData[]; readonly geometries: readonly GeometryData[]; readonly instances: readonly InstanceData[]; readonly solids: readonly SolidData[]; readonly shells: readonly ShellData[]; readonly faces: readonly FaceData[]; readonly loops: readonly LoopData[]; readonly edges: readonly EdgeData[]; readonly halfEdges: readonly HalfEdgeData[]; readonly surfaces: readonly SurfaceData[]; readonly curves3D: readonly Curve3DData[]; readonly curves2D: readonly Curve2DData[]; readonly curveSegments: readonly (AlignmentData | CurveSegmentData)[]; readonly snappingPoints: readonly SnappingPoints[]; } /** 2d profile with slope information */ export declare interface Profile { readonly profilePoints: ReadonlyVec2[]; /** Highetst Z value on the profile */ readonly top: number; /** Lowest Z value on the profile */ readonly bottom: number; /** Start Z value of the profile */ readonly startElevation: number; /** End Z value of the profile */ readonly endElevation: number; } /** * Module for converting parametric data to profiles. which can easily be used for charts and graphs */ export declare class ProfileModule extends BaseModule { /** * Returns the profile view of a linestrip where x is the length of the line and y is the height * This function can be used if an object contains multiple unconnected entities. * @param entity The parametric entity used to create the profile * @param setting Settings * @returns Profile where x is the length of the line and y is the height, * it supports curve segments and cylinders, othwerwise it retuns undefiend */ viewFromEntity(entity: MeasureEntity, setting?: MeasureSettings): Promise; /** * Returns the profile view of selected objects where x is the length of the line and y is the height, * currently only supports cylinders * @param products Products used to create a profile, this can be a list of line segments, line strips or connected cylinders * @param setting Settings * @returns Profile where x is the length of the line and y is the height, * it supports curve segments and cylinders, othwerwise it retuns undefiend */ viewFromMultiSelect(products: ObjectId[], setting?: MeasureSettings): Promise; reverse(inProfile: Profile): Profile; } declare interface ProgramAsyncParams { readonly header?: string | Partial; readonly vertexShader: string; readonly fragmentShader: string | undefined; } declare interface ProgramParams { readonly vertexShader: string; readonly fragmentShader?: string; readonly headerChunk?: string; readonly flags?: readonly string[]; readonly commonChunk?: string; readonly uniformBufferBlocks?: string[]; readonly textureUniforms?: readonly string[]; readonly transformFeedback?: { readonly bufferMode: "INTERLEAVED_ATTRIBS" | "SEPARATE_ATTRIBS"; readonly varyings: readonly string[]; }; } /* Excluded from this release type: Programs */ /* Excluded from this release type: PromiseBag */ declare function readSchema(r: BufferReader): { readonly version: "2.3"; readonly childInfo: ChildInfo; readonly hashBytes: Uint8Array; readonly descendantObjectIds: Uint32Array; readonly subMeshProjection: SubMeshProjection; readonly subMesh: SubMesh; readonly positionBPC: Uint8Array; readonly textureInfo: TextureInfo; readonly vertex: Vertex; readonly triangle: Triangle; readonly vertexIndex: Uint16Array | undefined; readonly texturePixels: Uint8Array; }; declare function readSchema_2(r: BufferReader): { readonly version: "2.2"; readonly childInfo: ChildInfo_2; readonly hashBytes: Uint8Array; readonly descendantObjectIds: Uint32Array; readonly subMeshProjection: SubMeshProjection_2; readonly subMesh: SubMesh_2; readonly positionBPC: Uint8Array; readonly textureInfo: TextureInfo_2; readonly vertex: Vertex_2; readonly triangle: Triangle_2; readonly vertexIndex: Uint16Array | undefined; readonly texturePixels: Uint8Array; }; declare function readSchema_3(r: BufferReader): { readonly version: "2.1"; readonly childInfo: ChildInfo_3; readonly hashBytes: Uint8Array; readonly descendantObjectIds: Uint32Array; readonly subMeshProjection: SubMeshProjection_3; readonly subMesh: SubMesh_3; readonly textureInfo: TextureInfo_3; readonly vertex: Vertex_3; readonly triangle: Triangle_3; readonly vertexIndex: Uint16Array | undefined; readonly texturePixels: Uint8Array; }; /** Helper type, like typescript's `Partial`, only recursive. */ export declare type RecursivePartial = { [P in keyof T]?: RecursivePartial; }; declare type RenderBufferFormat = "R8" | "R8UI" | "R8I" | "R16UI" | "R16I" | "R32UI" | "R32I" | "RG8" | "RG8UI" | "RG8I" | "RG16UI" | "RG16I" | "RG32UI" | "RG32I" | "RGB8" | "RGBA8" | "SRGB8_ALPHA8" | "RGBA4" | "RGB565" | "RGB5_A1" | "RGB10_A2" | "RGBA8UI" | "RGBA8I" | "RGB10_A2UI" | "RGBA16UI" | "RGBA16I" | "RGBA32I" | "RGBA32UI" | "DEPTH_COMPONENT16" | "DEPTH_COMPONENT24" | "DEPTH_COMPONENT32F" | "DEPTH24_STENCIL8" | "DEPTH32F_STENCIL8" | "STENCIL_INDEX8" | "R16F" | "RG16F" | "RGBA16F" | "R32F" | "RG32F" | "RGBA32F" | "R11F_G11F_B10F"; declare interface RenderbufferParams { readonly internalFormat: RenderBufferFormat; readonly width: number; readonly height: number; readonly samples?: number | "max"; } /** * Set of buffers uses for rendering and pick. * @remarks * These buffers are only useful for advanced developers who aim to extend this API with their own custom 3D module. * @category Render Module */ declare class RenderBuffers { /** The underlying webgl2 rendering context. */ readonly gl: WebGL2RenderingContext; /** The buffer width in pixels. */ readonly width: number; /** The buffer height in pixels. */ readonly height: number; /** # of MSAA samples. */ readonly samples: number; /** The resource bin to manage resource tracking and disposal. */ readonly resourceBin: ResourceBin; /** Flag to indicate the CPU/read buffers needs to be updated. */ readBuffersNeedUpdate: boolean; /** Texture resources. */ readonly textures: { readonly color: WebGLTexture; readonly pick: WebGLTexture; readonly depth: WebGLTexture; }; /** Renderbuffer resources. */ readonly renderBuffers: { readonly colorMSAA: WebGLRenderbuffer | null; readonly depthMSAA: WebGLRenderbuffer | null; }; /** Frame buffer resources. */ readonly frameBuffers: { readonly color: WebGLFramebuffer; readonly colorMSAA: WebGLFramebuffer | null; readonly pick: WebGLFramebuffer; }; /** CPU/JS copy of pick buffers. */ readonly readBuffers: { readonly pick: WebGLBuffer; }; private typedArrays; private pickFence; /* Excluded from this release type: __constructor */ /* Excluded from this release type: resolveMSAA */ /* Excluded from this release type: invalidate */ private read; /* Excluded from this release type: pickBuffers */ /* Excluded from this release type: dispose */ private rejectPromises; /* Excluded from this release type: pollPickFence */ /* Excluded from this release type: deletePickFence */ } /** The view specific context for rendering and picking. * @remarks * A render context describes a view into which a {@link RenderState} can be rendered. * It is tightly bound to a HTML canvas and WebGL2RenderingContext. * Consequently, it will be disposed if the gl context is lost and recreated when the gl context is restored. * * The render context must be {@link init | initialized} with an array of {@link RenderModule | render modules}. * Unused modules may be removed and custom ones inserted here. * Ordering the modules correctly is important as they are rendered in order. * The {@link TonemapModule} should be last, as it will copy the HDR render buffers into the output canvas to make things visible. * * Features such as async picking and shader linking requires {@link poll} to be called at regular intervals, * e.g. at the start of each frame. * Otherwise the promises will never be resolved. * * @category Render Module */ export declare class RenderContext { /** The HTML canvas used for this context. */ readonly canvas: HTMLCanvasElement; /** The lutGGX file. */ readonly lutGGXImage: ImageBitmap; /** WebGL2 render context associated with this object. */ readonly gl: WebGL2RenderingContext; /** WebGL common GLSL code header used across shaders. */ readonly commonChunk: string; /** WebGL basic fallback IBL textures to use while loading proper IBL textures. */ readonly defaultIBLTextureParams: TextureParamsCubeUncompressed; private static defaultModules; private modules; private cameraUniformsData; private clippingUniformsData; private outlinesUniformsData; private localSpaceTranslation; private readonly asyncPrograms; private readonly resourceBins; private readonly defaultResourceBin; private readonly iblResourceBin; /** * Pick buffer is rendered and copied to CPU, but may represent stale frame. * Flag is not reset every frame unless resolution changes. */ private pickBuffersValid; /** * Pick buffer is rendered, copied to CPU and represents the current frame. * Flag is reset every frame. */ private pickBuffersUpToDate; /** * Pick buffer is rendered, but not yet copied to CPU. * Flag is reset every frame. */ private pickBuffersRendered; private sceneResolved; private currentPick; private activeTimers; private currentFrameTime; private statistics; private prevFrame; /* Excluded from this release type: captureSink */ readonly usePrepass = false; private isOrtho; private viewClipMatrix; private viewWorldMatrix; private viewWorldMatrixNormal; private viewClipMatrixLastPoll; private viewWorldMatrixLastPoll; /** WebGL uniform buffer for camera related uniforms. */ readonly cameraUniforms: WebGLBuffer; /** WebGL uniform buffer for clipping related uniforms. */ readonly clippingUniforms: WebGLBuffer; /** WebGL uniform buffer for outline related uniforms. */ readonly outlineUniforms: WebGLBuffer; /** WebGL GGX/PBR shading lookup table texture. */ readonly lut_ggx: WebGLTexture; /** WebGL Sampler used to sample mip mapped IBL texture trilinear. */ readonly samplerEnvMip: WebGLSampler; /** WebGL Sampler used to sample mipmapped texture trilinear. */ readonly samplerMip: WebGLSampler; /** WebGL Sampler used to sample mipmapped texture trilinear repeating UV. */ readonly samplerMipRepeat: WebGLSampler; /** WebGL Sampler used to sample other, non-mipmapped IBL textures bilinear. */ readonly samplerSingle: WebGLSampler; /* Excluded from this release type: deviceProfile */ /* Excluded from this release type: materialCommon */ /* Excluded from this release type: materialFiles */ outlineRenderers: WeakMap; private polygonMode; /** {@link RenderState} used to render the previous frame, if any. */ prevState: DerivedRenderState | undefined; /** {@link RenderState} used to make the newest state available during render. */ currentState: DerivedRenderState | undefined; /** Set to true to force a re-render when state not contained in {@link RenderState} has changed, e.g. download complete etc. */ changed: boolean; /* Excluded from this release type: pause */ /** WebGL render and pick buffers * @remarks * Note that these buffers will be recreated whenever the {@link RenderState.output} size changes. */ buffers: RenderBuffers; /** WebGL textures used for image based lighting ({@link https://en.wikipedia.org/wiki/Image-based_lighting | IBL}). * @remarks * Note that these buffers will be changed by the background module when download of the specified {@link RenderState.background.url} IBL textures completes. * * The process to create the textures are similar to that of {@link https://github.com/KhronosGroup/glTF-IBL-Sampler}/ */ iblTextures: { /** WebGL cubemap texture containing the irradiance/diffuse values of current IBL environment. */ readonly diffuse: WebGLTexture; /** WebGL cubemap texture containing the radiance/specular values of current IBL environment. */ readonly specular: WebGLTexture; /** # mip maps in current specular texture. */ readonly numMipMaps: number; /** # True if these are the default IBL textures. */ readonly default: boolean; }; readonly loaderWorker: Worker; private get octreeModule(); /* Excluded from this release type: __constructor */ /** Initialize render context with specified render modules. * @remarks * The default/built-in render modules can be retrieved using {@link createDefaultModules}. * These will be used if no modules are specified. * Developers may introduce their own render modules here. * Note that the order of the modules matters, as this is the order by which they will be rendered. * @param showWatermark `false` filters out the watermark module regardless if the modules are provided or not. */ init(modules?: readonly RenderModule[], showWatermark?: boolean): Promise; private linkAsyncPrograms; /** * Dispose of the GPU resources used by this context, effectively destroying it and freeing up memory. * @remarks * Calling this method is optional as the garbage collection of the underlying WebGL render context will do the same thing. * This may take some time, however, so calling this function is recommended if you plan to create a new context shortly thereafter. */ dispose(): void; /** Return the current pixel width of the drawing buffer. */ get width(): number; /** Return the current pixel height of the drawing buffer. */ get height(): number; /** Query if pick buffers are valid. * Valid means that the buffer is filled (not just arrays with zeros) and represents correct resolution. * @remarks This could be useful for optimistic/non-async picking. */ isPickBuffersValid(): boolean; /** Query if pick buffers are rendered. * Means pick buffer is rendered, but not yet copied to CPU. * @remarks This could be useful for optimistic/non-async picking. */ isPickBuffersRendered(): boolean; /** Query if pick buffers are up to date. * Means it's valid and it represents current (latest) frame. * @remarks This could be useful for optimistic/non-async picking. */ isPickBuffersUpToDate(): boolean; /** * The scene is considered resolved when all currently split nodes are done downloading. */ isSceneResolved(): boolean; /* Excluded from this release type: setSceneResolved */ /** Query whether the underlying WebGL render context is currently lost. * @remarks * This could occur when too many resources are allocated or when browser window is dragged across screens. * Loss and restoration of WebGL contexts is supported by this API automatically. */ isContextLost(): boolean; /* Excluded from this release type: drawBuffers */ /** Helper function to update WebGL uniform buffer from proxies. */ updateUniformBuffer(uniformBuffer: WebGLBuffer, proxy: UniformsProxy): void; /** Explicitly update WebGL IBL textures from specified parameters. */ updateIBLTextures(params: { readonly diffuse: TextureParamsCubeUncompressed; readonly specular: TextureParamsCubeUncompressedMipMapped; } | null): void; /** * Helper function to check for changes in render state. * @param state The parts of the render state to check for changes. * @returns True if any of the specified parts has changed since last frame. * @remarks * Since the render state is immutable, any changes will automatically trickle up to the container object as well. * Thus, this function does a shallow strict equality of the parts of the renderstate specified in the state parameter. * @example * Example of how to check for changes in either camera or output render state. * ```typescript * const {camera, output} = renderState; * if(renderContext.hasStateChanged({camera, output})) { * // update related GPU state here... * } * ``` */ hasStateChanged(state: Partial): boolean; /** Create a new named resource bin. */ resourceBin(name: string): ResourceBin; /** Compile WebGL/GLSL shader program asynchronously. */ makeProgramAsync(resourceBin: ResourceBin, params: AsyncProgramParams): Promise; private resetGLState; /* Excluded from this release type: capturePassPixels */ private resetStatistics; /* Excluded from this release type: addRenderStatistics */ /* Excluded from this release type: addLoadStatistics */ /* Excluded from this release type: contextLost */ /* Excluded from this release type: emulateLostContext */ /** Poll the status of WebGL pick fences and timers and resolve associated promises when possible. */ poll(): void; private beginTimer; private pollTimers; /** Wait for the next frame to be ready for rendering. * @param context render context to wait for, if any. * @remarks Use this function instead of requestAnimationFrame()! */ static nextFrame(context: RenderContext | undefined): Promise; /** * Render a new frame using the specified render state. * @param state An object describing what the frame should look like. * @returns A promise to the performance related statistics involved in rendering this frame. */ render(state: RenderState): Promise; /** The maximum number of GPU bytes available for allocation. * @remarks * This is an approximation based on the device profile limits minus the estimated size of the core render buffers. * The actual size of the core render buffers is dependent on the current output resolution and MSAA settings. * This value may be useful to determine how much GPU memory is available to allocate. */ get maxGPUBytes(): number; /** * Approximate bytes per on-screen pixel for current render buffers. * @remarks * Layout per pixel (base): * - Color texture (R11F_G11F_B10F): 4 bytes * - Depth texture (DEPTH_COMPONENT32F): 4 bytes * - Pick texture (RGBA32UI): 16 bytes * - Pick PBO staging buffer (PIXEL_PACK_BUFFER): 16 bytes * = 40 bytes base (samples = 1) * MSAA extras (samples > 1): * - MSAA color renderbuffer: 4 * samples bytes * - MSAA depth renderbuffer: 4 * samples bytes * = +8 * samples bytes * Total: 40 + (samples > 1 ? 8 * samples : 0) * @example * samples = 4 -> 40 + 32 = 72 bytes. */ get bytesPerPixel(): number; clearPickBuffers(): void; renderPickBuffers(): void; getLinearDepths(pick: Uint32Array): IterableIterator; /** * scan the pick buffer for deviation values * @returns Return pixel coordinates and deviation values for any deviation on screen */ getDeviations(): Promise; /** * scan the pick buffer for pixels from clipping outline * @returns Return pixel coordinates and world position for any clipping outline on screen */ getOutlines(): Promise; private updateCameraUniforms; private updateClippingUniforms; /* Excluded from this release type: updateOutlinesUniforms */ /* Excluded from this release type: screenSpaceLaser */ private extractPick; /** * Pick information about underlying object and geometry. * @param x Center x coordinate in CSS pixels. * @param y Center y coordinate in CSS pixels. * @param options More details of pick operation. * @returns A set of pick samples of the specified sample disc, or * `undefined` if the pick buffer was not ready (transient — caller may retry). * An empty array means the buffer was read but contained no hits. */ pick(x: number, y: number, options?: PickOptions): Promise; /** * Pick unique object IDs within a rectangular region. * @param x0 Top-left x coordinate in CSS pixels. * @param y0 Top-left y coordinate in CSS pixels. * @param x1 Bottom-right x coordinate in CSS pixels. * @param y1 Bottom-right y coordinate in CSS pixels. * @returns A set of unique object IDs within the specified rectangle. */ selectBox(x0: number, y0: number, x1: number, y1: number): Promise>; private extractSelectBox; /** * Count how many pixels each object covers in the pick buffer. * @param terrainMaxId The highest objectId considered terrain. Objects with `objectId <= terrainMaxId` are excluded. * @param options See {@link ObjectPixelCountsOptions}. * @returns A map of objectId to the number of (sampled) pixels it covers. * @remarks Empty pixels, reserved object IDs (>= 0xf000_0000) and terrain objects (objectId <= `terrainMaxId`) are excluded. * When `dx`/`dy` are > 1 the returned counts are subsampled; multiply by `dx * dy` to estimate full-resolution coverage. */ objectPixelCounts(terrainMaxId: number, options?: ObjectPixelCountsOptions): Promise>; private extractObjectPixelCounts; setPolygonFillMode(mode: "FILL" | "LINE"): void; getNonParametricEdgeDirAtPoints(points: { pos: ReadonlyVec3; normal: ReadonlyVec3; }[], tolerance: number): Promise<(ReadonlyVec3 | null)[] | undefined>; getNormalAtPosition(position: ReadonlyVec3, objectId: number, tolerance: number): vec3 | undefined; threePointLaser(request: LaserIntersectionRequest): LaserIntersectionResult | undefined; updateDeviceProfile(profile: DeviceProfile): void; } /** A render module factory object. * @remarks * The render module should be able to gracefully recreate its context from a new render context whenever a lost GL context is restored. * @category Render Module */ export declare interface RenderModule { /** Human readable name of module. */ readonly kind: string; /** Create a new instance for a given render context. */ withContext(context: RenderContext): RenderModuleContext | Promise; } /** A render module's context for a specific render context. * @remarks This object should contain all GPU/render context specific resources and handle actual updates and rendering. * @category Render Module */ export declare interface RenderModuleContext { /** Associated render module. */ readonly module: RenderModule; /** * Update module specific GPU state, such as uniform buffers. * @param state The current frame render state. */ update(state: DerivedRenderState): void; /** * Do a preliminary render pass to fill in Z-buffer for GPUs where this is beneficial. * @param state The current frame render state. */ readonly prepass?: (state: DerivedRenderState) => void; /** * Render into pick buffers with module specific data. * @param state The current frame render state. */ readonly pick?: (state: DerivedRenderState) => void; /** * Render into color and depth buffer. * @param state The current frame render state. */ render(state: DerivedRenderState): void; /** Handle loss of underlying WebGLContext, e.g. by cancelling pending downloads. */ contextLost(): void; /** Dispose of all GPU resources. */ dispose(): void; } declare interface RenderNode { readonly mask: number; readonly node: OctreeNode; } /** * An object describing the what to be rendered and how by {@link RenderContext.render}. * @remarks * The render state is immutable by design. * You should not attempt to mutate existing objects. * The correct way to change render state is to use the {@link modifyRenderState} function. * This function will create a new copy of objects with new/modified properties, while retaining all objects that hasn't changed. * It will also perform basic validation. * The engine uses {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality | strict equality} to determine if some portion of the state has changed. * Hence, it's important that unchanged sub objects are not copied. * * The render state is serializable via JSON or {@link https://developer.mozilla.org/en-US/docs/Web/API/structuredClone | structuredClone()}. * This can be useful for test/diagnostics purposes, since the render state should define how the output image eventually is rendered. * It may take a while for downloads of streamed resources to complete, however, so the output image will not be fully resolved until all pending downloads are complete. * There are also other runtime factors, such as device specific limitations or variations, that may contribute to small deviations in the output image. * A direct pixel to pixel comparison between two output images generated by identical render state is thus likely to fail unless it's rendered on the same device and same version of our API, browser, OS and drivers. * @category Render State */ export declare interface RenderState { /** Output image related state. */ readonly output: RenderStateOutput; /** background/environment related state. */ readonly background: RenderStateBackground; /** camera related state. */ readonly camera: RenderStateCamera; /** Render quality related state. */ readonly quality: RenderStateQuality; /** Grid helper related state. */ readonly grid: RenderStateGrid; /** @ignore */ readonly debug: RenderStateDebug; /** @internal. */ readonly cube: RenderStateCube; /** Static, streamable scene related state. */ readonly scene: RenderStateScene | undefined; /** Terrain rendering related state. */ readonly terrain: RenderStateTerrain; /** Dynamic objects related state. */ readonly dynamic: RenderStateDynamicObjects; /** Clipping planes related state. */ readonly clipping: RenderStateClipping; /** Highlights related state. */ readonly highlights: RenderStateHighlightGroups; /** Outlines related state. */ readonly outlines: RenderStateOutlines; /** Tonemapping related state. */ readonly tonemapping: RenderStateTonemapping; /** Point cloud rendering related state. */ readonly points: RenderStatePointCloud; /** Triangles rendering related state. */ readonly triangles: RenderStateTriangles; /** Toon outline rendering related state. */ readonly toonOutline: RenderStateToonOutline; /** Pick info rendering related state. */ readonly pick: RenderStatePick; } /** Background/environment related render state. * @category Render State */ export declare interface RenderStateBackground { /** The background color to be used if no url is specified. * @remarks * If undefined, the default background will be used instead. */ readonly color?: RGB; /** The absolute url of the background/environment. * @remarks * This should point to the folder that contains the textures files of the desired environment, e.g. `https://api.novorender/env/lake/'. */ readonly url?: string; /** A blur factor to use when rendering the background image. * @remarks * 0 will yield no blur, while 1 will yield max blur. * Blurring is useful for not overly cluttering up the image with backgrounds while still retaining the ambience and lighting characteristics. */ readonly blur?: number; /** The alpha/transparency factor to use when rendering the background. * @remarks * 0 will yield a fully transparent background, while 1 will yield a fully opaque background. * Alpha is useful for blending the rendered background with other content behind the canvas. */ readonly alpha?: number; /** The horizontal rotation angle, in degrees. */ readonly rotation?: number; } /** Camera related render state. * @category Render State */ export declare interface RenderStateCamera { /** The type of camera projection to use. * @see * {@link https://en.wikipedia.org/wiki/Pinhole_camera_model | pinhole} * {@link https://en.wikipedia.org/wiki/Orthographic_projection | orthographic} */ readonly kind: "pinhole" | "orthographic"; /** Camera position in world space. */ readonly position: ReadonlyVec3; /** Camera rotation in world space. * @remarks * This rotation is from camera->world space, much like that of a local->world space transformation of any rendered object. * It should not be confused with the inverse transformation, i.e. world->camera space, commonly used in shaders. */ readonly rotation: ReadonlyQuat; /** Camera pivot point in world space. * @remarks * This is used to visualize a point around which the camera will pivot when moved. * (Currently not implemented) */ readonly pivot: ReadonlyVec3 | undefined; /** Camera's vertical field of view. * @remarks * For pinhole cameras, this value is interpreted as the angle between the top and bottom edge of the frustum in degrees. * For orthographic cameras, this value is interpreted as the distance between the top and bottom edge of the view frustum in meters. */ readonly fov: number; /** Camera's near clipping plane distance. * @remarks * This value must be larger than 0, preferable as large as it can comfortable be without excessive visual clipping artifacts. * Any pixels that are closer to the image plane will be clipped. * Larger values will greatly improve z-buffer resolution, * which helps reduce {@link https://en.wikipedia.org/wiki/Z-fighting | z-fighting}. */ readonly near: number; /** Camera's far clipping plane distance. * @remarks * This value must be larger than the {@link near} clipping plane. * Any pixels that are farther away from the image plane will be clipped. * Smaller values improves z-buffer resolution, which helps reduce {@link https://en.wikipedia.org/wiki/Z-fighting | z-fighting}. * Smaller values also increases the # objects culled, which could help improve rendering performance. */ readonly far: number; } /** A partial view of render state used for modifications. * @category Render State */ export declare type RenderStateChanges = RecursivePartial; /** Clipping related render state. * @category Render State */ export declare interface RenderStateClipping { /** Whether to enable or disable geometry clipping. * @remarks * Clipping only applies to static/streamble geometry. * Enabling clipping comes at a minor cost of rendering performance. */ readonly enabled: boolean; /** * Whether or not to visualize the clipping planes themselves. */ readonly draw: boolean; /** How to combine multiple clipping planes. */ readonly mode: ClippingMode; /** An array of up to 6 clipping planes. */ readonly planes: readonly RenderStateClippingPlane[]; /** Compute clipping plane intersection outlines on the GPU instead of the CPU. * When `true`, the outline where geometry meets a clipping plane is rendered directly * in the fragment shader (cheaper), but quality is worse, outline geometry is not available for * measurement/snapping, and {@link RenderStateOutlines.planes | outline-only planes} are not drawn. * When `false`, the legacy CPU path is used, which also populates outline data used for measurement. * @default false */ readonly gpuComputed: boolean; /** * @ignore * @privateRemarks Ability to override gpuComputed on and off based on conditions in the render loop. * Will be overwritten every frame */ readonly gpuComputedOverride: boolean | undefined; } /** Render state for a single clipping plane. * @category Render State */ export declare interface RenderStateClippingPlane { /** The half-space normal (xyz) and signed offset/distance (w) of the plane. */ readonly normalOffset: ReadonlyVec4; /** The color to use when visualizing the clipping plane, or undefined to not visualize. */ readonly color?: RGBA; /** Geometry outline settings for this clipping plane. */ readonly outline?: { /** Whether to render outlines or not. * @remarks * Currently, due to limitations in WebGL2, * outlines are a costly features that is disabled on weaker devices. * Even on more powerful GPUs this feature should be used sparingly. */ enabled: boolean; /** * The color to use for the outlines of this plane, or undefined to use the {@link RenderStateOutlines.lineColor | default outline color}. */ lineColor?: RGB; }; } /** A color gradient curve. * @remarks * This curve is used to visualize some scalar value as a color gradient, e.g. terrain evelvation or point cloud devience. * @category Render State */ export declare interface RenderStateColorGradient { /**A set of knots defining a non-uniform linear spline curve. * @remarks * Nodes must be sorted in ascending order of position! * At least two nodes are required for any sort of gradient. * Nodes do not have to be uniformly distributed position-wise. * To create a discontinuity in the gradient, two adjacent nodes with identical position, but different colors may be used. * Any position outside the min/max range defined by this list will be clamped to the color of the nearest node (min or max), i.e., no extrapolation will occur. */ readonly knots: readonly RenderStateColorGradientKnot[]; } /** Gradient curve knot node. * @category Render State */ export declare interface RenderStateColorGradientKnot { /** Knot position on the gradient ramp. */ readonly position: number; /** Color to use at this gradient position. */ readonly color: T; } /* Excluded from this release type: RenderStateCube */ /** Debug related state. * @category Render State */ export declare interface RenderStateDebug { /** Draw triangles as wireframe. @default false. */ readonly wireframe: boolean; /** Render bounding box around octree nodes. @default false. */ readonly showNodeBounds: boolean; } /** Dynamic mesh geometry state. * @category Render State */ export declare interface RenderStateDynamicGeometry { /** Type of render primitive. */ readonly primitiveType: DrawMode; /** Vertex attributes. */ readonly attributes: RenderStateDynamicVertexAttributes; /** Array of Vertex indices, or # vertices if mesh is not indexed. */ readonly indices: Uint32Array | Uint16Array | Uint8Array | number; } /** Texture image related state. * @category Render State */ export declare interface RenderStateDynamicImage { /** The parameters for to 2D, uncompressed texture creation. */ readonly params: TextureParams2DUncompressed | TextureParams2DUncompressedMipMapped; } /** Dynamic object instance render state. * @category Render State */ export declare interface RenderStateDynamicInstance { /** Object instance position, in world space. */ readonly position: ReadonlyVec3; /** Object instance rotation, in world space. */ readonly rotation?: ReadonlyQuat; /** Object instance scale, default = 1. */ readonly scale?: number; } /** Material related render state. * @category Render State */ export declare type RenderStateDynamicMaterial = RenderStateDynamicMaterialUnlit | RenderStateDynamicMaterialGGX; /** Common material properties. * @category Render State */ declare interface RenderStateDynamicMaterialCommon { /** Whether to render material as double sided or not. * @default: false */ readonly doubleSided?: boolean; /** How to interpret color alpha channel. * @remarks * `"OPAQUE"` renders all pixels regardless of alpha value. * * `"MASK"` renders only pixels with alpha larger or equal to {@link alphaCutoff}. * * `"BLEND"` blends pixels with background using alpha as blending factor. */ readonly alphaMode?: "OPAQUE" | "MASK" | "BLEND"; /** Cutoff factor used for alpha masking. * @defaultValue 0.5 */ readonly alphaCutoff?: number; } /** GGX type of PBR material. * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#materials * @category Render State */ export declare interface RenderStateDynamicMaterialGGX extends RenderStateDynamicMaterialCommon { /** Material union discriminant. */ readonly kind: "ggx"; /** Factor used directly or multiplied with {@link baseColorTexture}, if defined, for material base color. * @defaultValue `[1,1,1,1]` */ readonly baseColorFactor?: RGBA_2; /** Metallicness PBR factor (0-1) * @defaultValue 1 */ readonly metallicFactor?: number; /** Roughness PBR factor (0-1) * @defaultValue 1 */ readonly roughnessFactor?: number; /** Emissive light factor (0-1) * @defaultValue 1 */ readonly emissiveFactor?: RGB; /** Base color texture. */ readonly baseColorTexture?: RenderStateDynamicTextureReference; /** PBR Mmtallic + roughness texture. * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#metallic-roughness-material */ readonly metallicRoughnessTexture?: RenderStateDynamicTextureReference; /** PBR surface normal texture */ readonly normalTexture?: RenderStateDynamicNormalTextureReference; /** Occlusion/AO texture */ readonly occlusionTexture?: RenderStateDynamicOcclusionTextureReference; /** Emissive light texture */ readonly emissiveTexture?: RenderStateDynamicTextureReference; } /** Unlit material properties. * @category Render State */ export declare interface RenderStateDynamicMaterialUnlit extends RenderStateDynamicMaterialCommon { /** Material union discriminant. */ readonly kind: "unlit"; /** Factor used directly or multiplied with {@link baseColorTexture}, if defined, for material base color. * @defaultValue `[1,1,1,1]` */ readonly baseColorFactor?: RGBA_2; /** Base color texture. */ readonly baseColorTexture?: RenderStateDynamicTextureReference; } /** Dynamic mesh render state. * @category Render State */ export declare interface RenderStateDynamicMesh { /** Optional name of the mesh. */ readonly name?: string; /** Array of geometry+material sub meshes. */ readonly primitives: readonly RenderStateDynamicMeshPrimitive[]; } /** Dynamic mesh primitive. * @remarks * Meshes are rendered one material at a time. * This interfaces describes such a sub-mesh, or mesh primitive * @category Render State */ export declare interface RenderStateDynamicMeshPrimitive { /** What dynamic mesh geometry to use. */ readonly geometry: RenderStateDynamicGeometry; /** What dynamic mesh material to use. */ readonly material: RenderStateDynamicMaterial; } /** Normal map texture reference state. * @category Render State */ export declare interface RenderStateDynamicNormalTextureReference extends RenderStateDynamicTextureReference { /** Scale factor to apply to normal XY coordinate. * @defaultValue 1.0 */ readonly scale?: number; } /** Dynamic object related render state. * @category Render State */ export declare interface RenderStateDynamicObject { /** What mesh to render. */ readonly mesh: RenderStateDynamicMesh; /** * Object instances * @remarks * Instances renders the same mesh once for reach instance at a unique position and rotation. * This is accomplished by using GPU instancing, * which means there is very little overhead per instance. * As long as the total triangle count remains tolerable, thousands of instances is no problem. * @see https://learnopengl.com/Advanced-OpenGL/Instancing */ readonly instances: readonly RenderStateDynamicInstance[]; /** What base object id/index to use for object instances.*/ readonly baseObjectId?: number; } /** * Dynamic object related render state * @remarks * Unlike static/streamable geometry, dynamic objects can be moved and rotated freely. * They do not support level of detail (LOD), however, so care must be taken not to use excessive amount of triangles/primitives. * Also, geometry is kept both in javascript memory in the form of render state, * and also in GPU/WebGL2 memory as renderable geometry, * so avoid complex, memory consuming models if possible. * Dynamic objects can be created procedurally or by loading a glTF2 file {@link loadGLTF}. * * Since there is a significant overlap between the {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html | gltf2 specifications} and this render state, * you may read the glTF2 specs to learn more details. * @category Render State */ export declare interface RenderStateDynamicObjects { /** Dynamic objects to render. */ readonly objects: readonly RenderStateDynamicObject[]; } /** Occlusion map texture reference state. * @category Render State */ export declare interface RenderStateDynamicOcclusionTextureReference extends RenderStateDynamicTextureReference { /** Strength factor to apply to occlusion [0.0, 1.0]. * @defaultValue 1.0 */ readonly strength?: number; } /** Texture sampled related state * @category Render State * @see * https://en.wikipedia.org/wiki/Texture_filtering * https://learnopengl.com/Getting-started/Textures */ export declare interface RenderStateDynamicSampler { /** Minification filter * @defaultValue `"NEAREST_MIPMAP_LINEAR"` */ readonly minificationFilter?: MinFilterString; /** Magnification filter * @defaultValue `"LINEAR"` */ readonly magnificationFilter?: MagFilterString; /** Tuple of S and T wrap mode, respectively. * @defaultValue `["REPEAT", "REPEAT"]` */ readonly wrap?: readonly [WrapString, WrapString]; } /** Texture related state. * @category Render State */ export declare interface RenderStateDynamicTexture { /** Image to use for this texture */ readonly image: RenderStateDynamicImage; /** Sampler to use for this texture * @defaultValue Sampler with all default values. */ readonly sampler?: RenderStateDynamicSampler; } /** Texture reference state. * @category Render State */ export declare interface RenderStateDynamicTextureReference { /** What texture to use. */ readonly texture: RenderStateDynamicTexture; /** What set of texture coordinates to use (0 or 1). * @defaultValue 0 */ readonly texCoord?: 0 | 1; /** Optional texture coordinate 3x3 transformation matrix * @defaultValue Identity matrix. */ readonly transform?: ReadonlyMat3; } /** Vertex attribute type for dynamic objects. * @category Render State */ export declare type RenderStateDynamicVertexAttribute = Omit & { readonly buffer: BufferSource; }; /** Dynamic mesh vertex attributes state. * @category Render State */ export declare interface RenderStateDynamicVertexAttributes { /** Vertex position. */ readonly position: RenderStateDynamicVertexAttribute; /** Vertex normal. */ readonly normal?: RenderStateDynamicVertexAttribute; /** Vertex tangent. * @remarks Bi-tangent is computed from normal and tangent, if needed. */ readonly tangent?: RenderStateDynamicVertexAttribute; /** Vertex color. */ readonly color0?: RenderStateDynamicVertexAttribute; /** Vertex texture coordinate, set 0. */ readonly texCoord0?: RenderStateDynamicVertexAttribute; /** Vertex texture coordinate, set 1. */ readonly texCoord1?: RenderStateDynamicVertexAttribute; } /** Grid related render state. * @category Render State */ export declare interface RenderStateGrid { /** Turn grid on and off.*/ readonly enabled: boolean; /** Color of minor grid lines.*/ readonly color1: RGB; /** Color of major grid lines.*/ readonly color2: RGB; /** The grid's origin/center coordinate in world space.*/ readonly origin: ReadonlyVec3; /** The grid's x-axis in world space.*/ readonly axisX: ReadonlyVec3; /** The grid's y-axis in world space.*/ readonly axisY: ReadonlyVec3; /** Minor grid cell size * @defaultValue 1 */ readonly size1: number; /** Major grid cell size * @defaultValue 10 */ readonly size2: number; /** Max distance to render grid in meters. */ readonly distance: number; } /** * How to render the geometry of a {@link RenderStateHighlightGroup | highlight group}. * @remarks * {@link RGBATransform | Color transforms} allows you to modify the color, brightness and transparency of objects within the group. * * `"hide"` will hide the objects within the group more effectively than using alpha/opacity = 0, * while still retaining them in memory for quick re-rendering. * * `"filter"` will remove the objects from memory entirely, which helps improve rendering performance and memory usage. * Unlike hidden group, changes to filtered groups will trigger a complete reload of the streamable scene. * @category Render State */ export declare type RenderStateGroupAction = RGBATransform | "hide" | "filter"; /** * Render state for a specific highlight group. * @remarks * Group of objects may be visually highlighted through {@link RGBATransform | color transforms}, hidden or filtered out. * @category Render State */ export declare interface RenderStateHighlightGroup { /** How to treat this particular group. */ readonly action: RenderStateGroupAction; /** Outline highlight color. */ readonly outlineColor?: RGB; /** A set of unique object_id belonging to this group, sorted in ascending order. */ readonly objectIds: Iterable; /** Texture information. */ readonly texture?: RenderStateHighlightGroupTexture; /** Point visualization method */ readonly pointVisualization?: PointVisualization; } /** * Highlight related render state. * @remarks * Highlight comes as a modest performance cost. * * Group of objects may be visually highlighted through {@link RGBATransform | color transforms}, hidden or filtered out. * Currently, a maximum of 250 groups may be defined. * Any objects that are not part of a highlight group will be treated according to the {@link defaultAction} property. * This could help save memory when "everything else" needs to be hidden or highlighted. * * A particular object can only be rendered using a single highlight. * If the object id belongs to multiple groups, the last group in the {@link groups} array will determine how it's highlighted. * * Hiding a group is more effective than using alpha=0. * * Filtering of large group can greatly improve performance and memory consumption. * Adding or removing objects to filtered groups will trigger a complete reload of the scene, however. * It it thus recommended that this be used for relatively static groups only. * @category Render State */ export declare interface RenderStateHighlightGroups { /** Highlight action for all objects current not in a highlight group. * @defaultValue `undefined` */ readonly defaultAction: RenderStateGroupAction | undefined; /** * Point visualization for all points current not in a highlight group with point visualization. * Undefined will fall back to defualtAction then to color RGBA values. * @defaultValue `undefined` */ readonly defaultPointVisualization: PointVisualization | undefined; /** Highlight groups, max 250. */ readonly groups: readonly RenderStateHighlightGroup[]; /** Names of active textures. * @remarks * The textures are downloaded in the background and may take some time to become available. */ readonly textures?: ActiveTexturesArray; } /** * Render state for a highlight group texture. * @category Render State */ export declare interface RenderStateHighlightGroupTexture { /** Index into {@link RenderStateHighlightGroups.textures} array. */ readonly index: ActiveTextureIndex; /** Scale, default = 1. */ readonly scale?: number; /** Rotation in degrees, default = 0. */ readonly rotation?: number; /** Metalness [0,1], default = 0. */ readonly metalness?: number; /** Ambient light factor [0,1], default = 0. */ readonly ambient?: number; } /** Outline related render state. * @remarks * Enabling this feature will render the intersection of geometry surface with the specified plane as lines. * This is particularly useful when in orthographic mode on surfaces that are perfectly perpendicular to the image plane. * These surfaces would otherwise be invisible and unpickable. * * > Due to limitations of WebGL2, outline rendering comes as at potentially significant performance and memory cost. * Thus, is may be unavailable on weaker devices and should be used sparingly otherwise. * @category Render State */ export declare interface RenderStateOutlines { /** * @ignore * @privateRemarks Ability to turn all clipping outlines on and off based on conditions in the render loop. * Will be overwritten every frame */ readonly on: boolean; /** * Keep outlines enabled while the orthographic camera is moving. * Set to `false` to mirror the pinhole behavior and suppress outlines in-motion. * @default true */ readonly keepOnDuringOrthoMove?: boolean; /** Hide outline on screen, it can still be used for measurement */ readonly hidden: boolean; /** Whether to do outline rendering. */ readonly enabled: boolean; /** Outline thickness, in meters. * @default 0.01 */ readonly linearThickness: number; /** Plane intersection with triangles will also be checked at those offsets. In meters. * Used for laser to hit the surfaces which are very close to the plane, but not exactly intersect it. * @default undefined */ readonly intersectionOffsets: number[] | undefined; /** Outline minimum thickness, in pixels. * @default 3 */ readonly minPixelThickness: number; /** Outline maximum thickness, in pixels. * @default 9 */ readonly maxPixelThickness: number; /** Outline relative size between lines and points. * @default 2 */ readonly relativePointSize: number; /** Outline vertex base object id value. * @default 0x7000_0000 */ readonly vertexObjectIdBase: number; /** Color of outline lines. * @remarks * Due to {@link RenderStateTonemapping | tone mapping} the color displayed on screen will a bit duller. * If you require bright colors, you may "overexpose" them, e.g. `[10,0,0]` for bright red. */ readonly lineColor: RGB; /** Color of outline vertices. * @remarks * Due to {@link RenderStateTonemapping | tone mapping} the color displayed on screen will a bit duller. * If you require bright colors, you may "overexpose" them, e.g. `[10,0,0]` for bright red. */ readonly vertexColor: RGB; /** The outline intersection plane. */ readonly planes: ReadonlyVec4[]; /** Minimum angle to create breaking points from outlines in degrees */ readonly breakingPointAngleThreshold: number; /** Whether to render outline vertices on screen. * When false, vertices are still computed and available for measurement snap, * but are not written to the color buffer. * @default true */ readonly showVertices: boolean; } /** Output image related state. * @category Render State */ export declare interface RenderStateOutput { /** Image pixel width. */ readonly width: number; /** Image pixel height. */ readonly height: number; /** Number of {@link https://en.wikipedia.org/wiki/Multisample_anti-aliasing | MSAA} samples used to anti-alias the output image. * @remarks * This number should be an integer between 1 and 16, inclusive. * The more samples, the better the anti aliasing, but also the more memory and render time. * Most devices have a max cap on this value, in which case that smaller of the two will be used. */ readonly samplesMSAA: number; } /** Pick related render state. * @category Render State */ export declare interface RenderStatePick { /** The opacity/alpha minimum (inclusive) threshold at which to include a pixel in the pick output. * @public * @remarks * A value between 0 and 1, where 0 includes all pixels no matter how transparent and 1 only includes 100% opaque pixels. * The default value is 1. */ readonly opacityThreshold: number; } /** Point cloud related render state. * @remarks * The sizes are cumulative and computed as follows: * ``effective_point_pixel_size = max(1, pixelSize + projectedSizeOf(metricSize + tolerance * toleranceFactor))``. * Metric size is projected as a 3D sphere at the point origo to deterine pixel size. * The term pixel refers to the size of a pixel in the target canvas element, which resolution may differ from that of the render buffer. * @category Render State */ export declare interface RenderStatePointCloud { /** Point size state. */ readonly size: { /** Point size in pixels. */ readonly pixel: number | undefined; /** Max point size in pixels. */ readonly maxPixel: number | undefined; /** Point size in meters. */ readonly metric: number | undefined; /** The scaling factor for applying the tolerance of the current level of detail to point size. * @remarks * Different levels of detail (LOD) will have different point densities. * Taking this difference into account may result in a more uniform point coverage and visually pleasing result. * The tolerance of each LOD reflects the point merging distance threshold in meters used to reduce # points, or 0 for the original level of detail. */ readonly toleranceFactor: number; }; /** Color gradient to use for visualizing deviation and tolerances. * @remarks May define different gradients for negative and positive numbers. classification values between gradent color stops will be interpolated. */ readonly classificationColorGradient: RenderStateColorGradient; /** * The color of points with undefined point visualization value */ readonly undefinedColor?: RGBA; readonly deviation: { /** Color gradient to use for visualizing deviation and tolerances. * @remarks May define different gradients for negative and positive numbers. * deviation index will be mapped to the gradient array */ readonly colorGradients: readonly RenderStateColorGradient[]; }; /** Use pre-computed projected point cloud positions instead of original. * @remarks This is currently used to render an unwrapped 2D variant of tunnels. */ readonly useProjectedPosition: boolean; } /** Quality related render state. * @category Render State */ export declare interface RenderStateQuality { /** * A detail bias factor used to modify the acceptable geometric error, and consequently the amount of geometric detail. * @remarks * The value must be larger than 0. * 1.0 is the baseline value. * Lower values will reduce geometric detail, but also improve performance and memory usage. * Higher values will increase geometric detail, at the cost of performance and memory consumption. * At some point the amount of detail is capped by device specific constraints. */ readonly detail: { /** * Active bias will only work for lowering the current level of detail. It will keep the current nodes in memory but not render. */ readonly activeBias: number; /** * Download bias will affect the downloaded nodes. */ readonly downloadBias: number; }; } /** Static, streamable geometry render state. * @remarks * Any change to this state will trigger a complete reload of the streamable scene. * @category Render State */ export declare interface RenderStateScene { /** Base url whence the scene was downloaded. */ readonly url: string; /** The scene configuration. */ readonly config: SceneConfig; /** Flags for whether to hide/filter various kinds of geometry. */ readonly hide?: RenderStateStaticGeometryKinds; /** Optional custom URL builder for file requests. * May return either a URL or a Promise of URL — the SDK awaits the result * before each fetch so consumers can mint fresh signed URLs per request. */ readonly urlBuilder?: (baseUrl: string, filePath: string) => URL | Promise; } /** Flags for what types of geometry to render or not. * @category Render State */ export declare interface RenderStateStaticGeometryKinds { /** Whether to render terrain geometry. */ readonly terrain?: boolean; /** Whether to render (non-terrain) triangles. */ readonly triangles?: boolean; /** Whether to render lines. */ readonly lines?: boolean; /** Whether to render point (clouds). */ readonly points?: boolean; /** Whether to render document geometry, e.g. rendered PDF. */ readonly documents?: boolean; } /** Terrain render state. * @category Render State */ export declare interface RenderStateTerrain { /** Elevation gradient color curve. * @remarks * Elevations are defined as in meters above/below sea level (using negative values for sub sea terrain). */ readonly elevationGradient: RenderStateColorGradient; /** Flag for whether to draw terrain as background. */ readonly asBackground: boolean; /** Flag for whether to render terrain double sided (back-face culling off). */ readonly doubleSided: boolean; } /** PBR Material texture reference * @category Render View */ export declare interface RenderStateTextureReference { /** Texture URL. */ readonly url: string; } /** Tone mapping related render state. * @remarks * Internally, the output image is rendered in a {@link https://en.wikipedia.org/wiki/High_dynamic_range | HDRI} format. * Before it can be displayed onto a regular screen, * it needs to be {@link https://en.wikipedia.org/wiki/Tone_mapping tone mapped} and truncated into a displayable format. * Currently we use {@link https://github.com/TheRealMJP/BakingLab/blob/master/BakingLab/ACES.hlsl | ACES filmic tone map approximation} for this. * @category Render State */ export declare interface RenderStateTonemapping { /** Camera light exposure as stops of power of 2. * @remarks * Negative values darkens the image, while positive ones brightens it. * @defaultValue 0.0 */ readonly exposure: number; /** Debug/diagnostics option to display internal render buffers. * @defaultValue TonemappingMode.color */ readonly mode: TonemappingMode; } /** Toon shader related outline. * @remarks * Toon shader is a deliberate misnomer of what is commonly referred to as {@link https://roystan.net/articles/outline-shader/ outline shader}. * It is a post-effect that is applied on the output pixels to help visualize geometric edges and contours. * Enabling it comes at a potentially significant performance penalty, depending on your device. * It should thus be used sparingly, preferably only on idle frames, i.e. while the camera is not moving. * @category Render State */ export declare interface RenderStateToonOutline { /** * @ignore * @privateRemarks Ability to turn the "toon" outlines on and off based on conditions in the render loop. * Will be overwritten every frame */ readonly on: boolean; /** Whether to do render "toon" outlines or not. */ readonly enabled: boolean; /** Color to use for edges and contours. */ readonly color: RGB; /** Creates an outline around each object in addition to edges, * this can manually be disabled as it will create a lot of noise on scenes with a lot of z-fighting . */ readonly outlineObjects: boolean; } /** Triangle related render state. * @category Render State */ export declare interface RenderStateTriangles { /** Flag for whether to force render triangles double sided (back-face culling off). */ readonly doubleSided: boolean; } /** Render frame performance and resource usage statistics. */ export declare interface RenderStatistics { /** Estimated # bytes used by WebGL buffers for this frame. */ readonly bufferBytes: number; /** Estimated # bytes uses by WebGL textures for this frame. */ readonly textureBytes: number; /** Approximate bytes per pixel used by currently allocated render buffers (depends on MSAA). */ readonly bytesPerPixel: number; /** # of points drawn in this frame. */ readonly points: number; /** # of lines drawn in this frame. */ readonly lines: number; /** # of triangles drawn in this frame. */ readonly triangles: number; /** # of draw calls in this frame. */ readonly drawCalls: number; /** # of primitives (points+lines+triangles) drawn by static geometry for this frame. */ readonly primitives: number; /** Time spent in the main thread. */ readonly cpuTime: { /** # CPU milliseconds spent rendering. */ readonly draw: number; }; /** Time spent in the GPU. */ readonly gpuTime: { /** # GPU milliseconds spent rendering, if supported by driver. */ readonly draw: number | undefined; }; /** Effective interval in milliseconds since last frame was drawn. */ readonly frameInterval: number; } /** * A WebGL resource tracking helper class. * @remarks * Resource bins are used to track allocation of WebGL resources and assist with automatic disposal. * @category Render Module */ declare class ResourceBin { /** The underlying WebGL2 rendering context. */ readonly gl: WebGL2RenderingContext; /** The name of the resource bin. */ readonly name: string; private readonly collection; private readonly resourceMap; private readonly refMap; /* Excluded from this release type: __constructor */ get resourceInfo(): IterableIterator; get size(): number; createBuffer(params: BufferParams): WebGLBuffer; createFrameBuffer(params: FrameBufferParams): WebGLFramebuffer; createProgram(params: ProgramParams): WebGLProgram; createProgramAsync(params: ProgramAsyncParams): { readonly program: WebGLProgram; readonly vertex: WebGLShader; readonly fragment: WebGLShader; }; createRenderBuffer(params: RenderbufferParams): WebGLRenderbuffer; createSampler(params: SamplerParams): WebGLSampler; createTexture(params: TextureParams): WebGLTexture; createTransformFeedback(): WebGLTransformFeedback; createVertexArray(params: VertexArrayParams): WebGLVertexArrayObject; private add; subordinate(owner: WebGLVertexArrayObject | WebGLFramebuffer, ...resources: readonly (WebGLResource | null)[]): void; delete(...resources: readonly (WebGLResource | null)[]): void; addReference(resource: WebGLResource | null): number | undefined; removeReference(resource: WebGLResource | null): number | undefined; private del; deleteAll(): void; dispose(): void; } declare interface ResourceInfo { readonly kind: ResourceKind; readonly target?: ResourceTarget; readonly byteSize?: number; readonly tag?: string; } declare type ResourceKind = keyof typeof resourceKinds; declare enum resourceKinds { Buffer = "Buffer", Framebuffer = "Framebuffer", Program = "Program", Query = "Query", Renderbuffer = "Renderbuffer", Sampler = "Sampler", Shader = "Shader", Sync = "Sync", TransformFeedback = "TransformFeedback", Texture = "Texture", VertexArray = "VertexArray" } /* Excluded from this release type: Resources */ declare type ResourceTarget = BufferTargetString | TextureTargetString | "FRAMEBUFFER"; export declare type ResourceType = "webgl2_bin" | "brep" | "db" | ""; /** Color, expressed as a tuple of red, green and blue with values between 0.0 and 1.0. */ export declare type RGB = readonly [red: number, green: number, blue: number]; /** Color with alpha opacity, expressed as a tuple of red, green, blue and alpha with values between 0.0 and 1.0. */ export declare type RGBA = readonly [ red: number, green: number, blue: number, alpha: number ]; declare type RGBA_2 = readonly [r: number, g: number, b: number, a: number]; declare interface RGBA_U8 { readonly length: number; readonly red: U8; readonly green: U8; readonly blue: U8; readonly alpha: U8; } declare interface RGBA_U8_2 { readonly length: number; readonly red: U8; readonly green: U8; readonly blue: U8; readonly alpha: U8; } declare interface RGBA_U8_3 { readonly length: number; readonly red: U8; readonly green: U8; readonly blue: U8; readonly alpha: U8; } /** Options for RGBA + alpha color transformation. * @remarks * All input values are between 0 and 1. * @category Render State */ export declare interface RGBAOptions { /** Red color adjustment. */ readonly red: number | LinearTransform; /** Green color adjustment. */ readonly green: number | LinearTransform; /** Blue color adjustment. */ readonly blue: number | LinearTransform; /** Opacity/alpha adjustment. */ readonly opacity: number | LinearTransform; } /** 5x4 row-major matrix for color/opacity transform. * @remarks * This matrix defines the linear transformation that is applied to the original RGBA color before rendering. * The fifth column is multiplied by a constant 1, making it useful for translation. * The resulting colors are computed thus: * ``` * output_red = r*m[0] + g*m[1] + b*m[2] + a*m[3] + m[4] * output_green = r*m[5] + g*m[6] + b*m[7] + a*m[8] + m[9] * output_blue = r*m[10] + g*m[11] + b*m[12] + a*m[13] + m[14] * output_alpha = r*m[15] + g*m[16] + b*m[17] + a*m[18] + m[19] * ``` * All input values are between 0 and 1 and output value will be clamped to this range. * @category Render State */ export declare type RGBATransform = FixedSizeArray<20, number>; /** * Module for handling road spesific parametric data. */ export declare class RoadModule extends BaseModule { getAlignment(objectId: ObjectId_2): Promise; getHorizontalDrawItem(alignment: Alignment, curvatureColors?: Map, context?: DrawContext_2): HorizontalAlignment; private getSegmentMidPointAndNormal; private getLabelDirection3D; updateHorizontalDrawItem(alignment: HorizontalAlignment, context?: DrawContext_2): void; getStationsDrawObject(alignment: Alignment, interval: number, start?: number, elevation?: boolean, slopes?: boolean): StationsDrawObject; updateStationsDrawObject(stations: StationsDrawObject, context?: DrawContext_2): void; getStationSegment(alignment: Alignment, station: number, type: "horizontal" | "vertical"): StationSegment | undefined; getStationSectionDrawObject(alignment: Alignment, stationStart: number, stationEnd: number, settings?: { curvature?: number; kind?: CurvatureKind; length?: boolean; slope?: boolean; elevation?: boolean; }, context?: DrawContext_2): StationSegmentDrawObject | undefined; updateSectionDrawObject(segment: StationSegmentDrawObject, context?: DrawContext_2): void; getStationInfoAtPoint(alignment: Alignment, point: ReadonlyVec3): StationInfo | undefined; getStationDrawObject(info: StationInfo, elevation?: boolean, context?: DrawContext_2): StationDrawObject; updateStationDrawObject(drawObject: StationDrawObject, context?: DrawContext_2): void; getPointAtStation(alignment: Alignment, station: number): ReadonlyVec3; } /* Excluded from this release type: RootNodes */ /** Retuns a quaternion computed for the given direction. * Will compute rotation with Y as the up vector unless direction is Y or snapToAxis is given * @param dir Direction vector. * @param snapToAxis Snap to custom rotation, uses Y as up otherwise * @returns Rotation computed for the given direction and snap axis. * @category Camera Controllers */ export declare function rotationFromDirection(dir: ReadonlyVec3, snapToAxis?: quat): quat; declare interface SamplerParams { readonly minificationFilter?: MinFilterString; readonly magnificationFilter?: MagFilterString; readonly minLOD?: number; readonly maxLOD?: number; readonly compareFunction?: CompareFuncString; readonly compareMode?: CompareModeString; readonly wrap?: readonly [WrapString, WrapString] | readonly [WrapString, WrapString, WrapString]; } /** Scene Configuration * @category Render State */ export declare interface SceneConfig { /** Scene kind. */ readonly kind: "octree"; /** Scene id. */ readonly id: string; /** Binary format version. */ readonly version: string; /** Up vector, in world space. */ readonly up?: ReadonlyVec3; /** Weighted center point of scene, in world space. */ readonly center: ReadonlyVec3; /** Offset used to geo reference scene, in world space. */ readonly offset: ReadonlyVec3; /** Scene bounding sphere, in world space. */ readonly boundingSphere: BoundingSphere; /** Scene bounding box, in world space. */ readonly aabb: AABB; /** Byte size of root node. */ readonly rootByteSize: number; /** Maximum object ID value in the scene. */ readonly numObjects: number; /** Total # of materials in scene. */ readonly numMaterials: number; /** Scene material properties. */ readonly materialProperties: MaterialProperties; /** Model to world space transformation matrix. */ readonly modelWorldMatrix?: ReadonlyMat4; /** List of geometry type subtrees within this scene. */ readonly subtrees?: ("" | "terrain" | "triangles" | "lines" | "points" | "documents")[]; /** * Optional point cloud attributes. * @deprecated This is no longer in use. For binary format 2.3 and above use numPointDeviations and hasPointIntensity */ readonly variants?: ("deviation" | "intensity")[]; /** Number of deviations in scene, undefined if none. */ readonly numPointDeviations?: number; /** True if scene has classifaction, false/undefiene if not. */ readonly hasPointClassification?: boolean; /** True if scene has Intensity, false/undefiene if not. */ readonly hasPointIntensity?: boolean; /** Binary root node meta information */ readonly root: Base64String; } export declare interface SceneIndex { readonly version: "1.0"; readonly render: { readonly webgl2: string; }; readonly offline?: { readonly manifest: string; }; readonly measure?: { readonly brepLut: string; }; readonly data?: { readonly jsonLut: string; readonly json: string; }; } /** A file manifest for a scene. * @remarks * A fundamental assumption here is that the file names in the manifest are hashes of the actual content, i.e. same name = same content. * If this condition is not met, synchronization will not work! */ declare class SceneManifest { /** A map of manifest filenames and their respective byte sizes. */ private readonly _glfiles; private readonly _brepfiles; private readonly _dbfiles; get glFiles(): IterableIterator; get brepFiles(): IterableIterator; get dbFiles(): IterableIterator; get allFiles(): IterableIterator; /** The total byte size of all the files in this manifest. */ readonly totalByteSize: number; /** The number of files. */ readonly numFiles: number; /** * @param data The entries of this manifest. */ constructor(data: SceneManifestData | undefined); } /** A collection of scene manifest entry tuples, used to construct a scene manifest. */ declare interface SceneManifestData { readonly webgl2_bin?: readonly SceneManifestEntry[]; readonly brep?: readonly SceneManifestEntry[]; readonly db?: readonly SceneManifestEntry[]; } /** An scene manifest entry tuple, consisting of [filename/hash, byteSize]. */ declare type SceneManifestEntry = readonly [name: string, size: number]; declare type Schema = ReturnType; declare type Schema_2 = ReturnType; declare type Schema_3 = ReturnType; /* Excluded from this release type: schemaVersion */ export declare class ScreenSpaceConversions { readonly drawContext: DrawContext; constructor(drawContext: DrawContext); /** Check if world space point is inside the current view. * @param point World space point that will be checked. * @returns True if the point is inside the view false otherwise. */ isInView(point: ReadonlyVec3): boolean; /** Makes a converter for world space points to on screen space points. * Function is correct only for the current settings/frame. * Same as `worldSpaceToScreenSpace` but returns a function, which is often more convenient. * @param width optional pixel width, use canvas width if not given. * @param height optional pixel height, use canvas height if not given. * @param round round pixel values or not, `true` if not given. * @param clipFarPlane optional, if true then points that are beyond the far plane are clipped. * @returns Function to convert points from screen to world space. * Can return undefined if point is outside screen space. */ worldSpaceToScreenSpaceConverter({ width, height, camera, round, clipFarPlane, }?: { width?: number; height?: number; camera?: Camera; round?: boolean; clipFarPlane?: boolean; }): (p: ReadonlyVec3) => vec2 | undefined; /** Converts world space points to on screen space points. * @param points World space points that will be projected to screen space. * @param width optional pixel width, use canvas width if not given. * @param height optional pixel height, use canvas heigth if not given. * @param round round pixel values or not, `true` if not given. * @param clipFarPlane optional, if true then points that are beyond the far plane are clipped. * @returns Screen space points regadless if they are within the current canvas size * or undefined if point is outside screen space. */ worldSpaceToScreenSpace(points: ReadonlyVec3[], opts?: { width?: number; height?: number; camera?: Camera; round?: boolean; clipFarPlanes?: boolean; }): (vec2 | undefined)[]; /** Converts world space points to view space points. * @param points World space points that will be projected to view space. * @returns View space points regadless if they are within the current canvas size. * Coordinates are in [0, 1] range. */ worldSpaceToViewSpace(points: ReadonlyVec3[]): ReadonlyVec2[]; /** * Convert 2D pixel point to 3D positions. * @param points Screen points in points that will be projected to world space. * @returns Corresponding 3D positions at the view plane in world space. */ screenSpaceToWorldSpace(points: ReadonlyVec2[], drawContext?: DrawContext): ReadonlyVec3[]; } /** * Calculate the intersection point between ray and plane * @public * @param segment segment as an array with start and end point * @param plane choose if planes under clipping or outlines should be used * @returns vector of the intersection point, undefined if plane and segment never intersects */ export declare function segmentPlaneIntersection(segment: [ReadonlyVec3, ReadonlyVec3], plane: ReadonlyVec4): IndexedCollection | undefined; declare type ShaderAttributeType = ShaderTypeFloat | ShaderTypeInt | ShaderTypeUint; declare interface ShaderDefaultPrecisions { readonly float: ShaderPrecision; readonly int: ShaderPrecision; readonly sampler2D: ShaderPrecision; readonly samplerCube: ShaderPrecision; readonly sampler3D: ShaderPrecision; readonly samplerCubeShadow: ShaderPrecision; readonly sampler2DShadow: ShaderPrecision; readonly sampler2DArray: ShaderPrecision; readonly sampler2DArrayShadow: ShaderPrecision; readonly isampler2D: ShaderPrecision; readonly isampler3D: ShaderPrecision; readonly isamplerCube: ShaderPrecision; readonly isampler2DArray: ShaderPrecision; readonly usampler2D: ShaderPrecision; readonly usampler3D: ShaderPrecision; readonly usamplerCube: ShaderPrecision; readonly usampler2DArray: ShaderPrecision; } declare interface ShaderDefine { readonly name: string; readonly value?: string; } declare interface ShaderExtension { readonly name: ShaderExtensionName | string; readonly behaviour: "enable" | "require" | "warn" | "disable"; } declare type ShaderExtensionName = "GL_ANGLE_multi_draw"; declare interface ShaderHeaderParams { readonly version: "300 es"; readonly extensions: readonly ShaderExtension[]; readonly defaultPrecisions: Partial; readonly flags: readonly string[]; readonly defines: readonly ShaderDefine[]; readonly commonChunk: string; } /** Standard module glsl shader imports. * @category Render Module */ declare type ShaderImports = typeof shaders; /* Excluded from this release type: ShaderMode */ /* Excluded from this release type: ShaderPass */ declare type ShaderPrecision = "high" | "medium" | "low"; /* Excluded from this release type: shaders */ declare type ShaderTypeFloat = "FLOAT" | "FLOAT_VEC2" | "FLOAT_VEC3" | "FLOAT_VEC4" | "FLOAT_MAT2" | "FLOAT_MAT3" | "FLOAT_MAT4" | "FLOAT_MAT2x3" | "FLOAT_MAT2x4" | "FLOAT_MAT3x2" | "FLOAT_MAT3x4" | "FLOAT_MAT4x2" | "FLOAT_MAT4x3"; declare type ShaderTypeInt = "INT" | "INT_VEC2" | "INT_VEC3" | "INT_VEC4"; declare type ShaderTypeUint = "UNSIGNED_INT" | "UNSIGNED_INT_VEC2" | "UNSIGNED_INT_VEC3" | "UNSIGNED_INT_VEC4"; declare interface ShellData { readonly faces: readonly Index[]; readonly snappingPoints?: readonly Index[]; readonly volume?: number; } declare interface Size2D { readonly width: T; readonly height: T; } declare interface Size2DArray { readonly width: T; readonly height: T; readonly depth: number; } declare interface Size3D { readonly width: T; readonly height: T; readonly depth: T; } export declare type SlopeSegment = { horizontalIndexFrom: number; horizontalIndexTo: number; verticalAlignmentIndex: number; slope: number; }; declare interface SnappingPoints { readonly points: number[]; readonly aabb: AABB3; } /** * Tolerance for picking and snapping to parametric objects, numbers are distance in meters * 0 can be used to ignore certain types when picking or snapping */ export declare interface SnapTolerance { segment?: number; edge?: number; face?: number; point?: number; edgeMidpoint?: number; arcCenter?: number; } declare interface SolidData { outerShell: Index; innerShells?: readonly Index[]; readonly aabb: { readonly min: ReadonlyVec3; readonly max: ReadonlyVec3; }; } /** Vassbakk's super special flight controller. * @category Camera Controllers */ export declare class SpecialFlightController extends FlightController { readonly pick: PickContext; kind: "special"; constructor(input: ControllerInput, pick: PickContext, conversions: ScreenSpaceConversions, _params?: FlightControllerParams); getTransformations(): CameraTransformations; } declare interface SphereData { readonly kind: "sphere"; readonly transform: FixedSizeArray_2; readonly coefficients: FixedSizeArray_2; readonly radius: number; } export declare interface StationDrawObject { info: DrawObject; direction: DrawPart; } export declare interface StationInfo { station: number; point: ReadonlyVec3; direction: ReadonlyVec3; } export declare interface StationsDrawObject { stationInfo: DrawPart; stationInfoProfiles: number[]; stationLines: DrawPart[]; stationMinorLines: DrawPart[]; } export declare interface StationSegment { start: number; end: number; curvature?: number; kind?: CurvatureKind; } export declare interface StationSegmentDrawObject { segment: DrawPart; stations: DrawPart; labels?: DrawPart; } export declare interface StationSegmentInfo { startStation: number; endStation: number; startPoint: ReadonlyVec3; endPoint: ReadonlyVec3; startIndex: number; endIndex: number; slope?: number; length?: number; } declare interface SubMesh { readonly length: number; readonly childIndex: U8; readonly objectId: U32; readonly materialIndex: U8; readonly primitiveType: EnumArray; readonly materialType: EnumArray; readonly attributes: EnumArray; readonly numDeviations: U8; readonly vertices: VertexRange; readonly primitiveVertexIndices: VertexIndexRange; readonly edgeVertexIndices: VertexIndexRange; readonly cornerVertexIndices: VertexIndexRange; readonly textures: TextureInfoRange; readonly pointSizeExp?: I8; } declare interface SubMesh_2 { readonly length: number; readonly childIndex: U8; readonly objectId: U32; readonly materialIndex: U8; readonly primitiveType: EnumArray; readonly materialType: EnumArray; readonly attributes: EnumArray; readonly numDeviations: U8; readonly vertices: VertexRange_2; readonly primitiveVertexIndices: VertexIndexRange_2; readonly edgeVertexIndices: VertexIndexRange_2; readonly cornerVertexIndices: VertexIndexRange_2; readonly textures: TextureInfoRange_2; } declare interface SubMesh_3 { readonly length: number; readonly childIndex: U8; readonly objectId: U32; readonly materialIndex: U8; readonly primitiveType: EnumArray; readonly materialType: EnumArray; readonly attributes: EnumArray; readonly numDeviations: U8; readonly vertices: VertexRange_3; readonly primitiveVertexIndices: VertexIndexRange_3; readonly edgeVertexIndices: VertexIndexRange_3; readonly cornerVertexIndices: VertexIndexRange_3; readonly textures: TextureInfoRange_3; } declare interface SubMeshProjection { readonly length: number; readonly objectId: U32; readonly primitiveType: EnumArray; readonly attributes: EnumArray; readonly numPointFactors: U8; readonly numIndices: U32; readonly numVertices: U32; readonly numTextureBytes: U32; } declare interface SubMeshProjection_2 { readonly length: number; readonly objectId: U32; readonly primitiveType: EnumArray; readonly attributes: EnumArray; readonly numDeviations: U8; readonly numIndices: U32; readonly numVertices: U32; readonly numTextureBytes: U32; } declare interface SubMeshProjection_3 { readonly length: number; readonly objectId: U32; readonly primitiveType: EnumArray; readonly attributes: EnumArray; readonly numDeviations: U8; readonly numIndices: U32; readonly numVertices: U32; readonly numTextureBytes: U32; } declare interface SubMeshProjectionRange { readonly start: U32; readonly count: U32; } declare interface SubMeshProjectionRange_2 { readonly start: U32; readonly count: U32; } declare interface SubMeshProjectionRange_3 { readonly start: U32; readonly count: U32; } declare type SurfaceData = PlaneData | CylinderData | ConeData | SphereData | TorusData | NurbsSurfaceData; declare type SurfaceKind = "plane" | "sphere" | "cylinder" | "cone" | "torus" | "nurbs"; /** Text template for formatting text, represents a single string */ export declare type TextTemplate = (string | { /** Value in the base unit (e.g. always meters for length) with full available precision */ value: number; /** Unit type of the value */ unitType: UnitType; /** * Optional amount of decimals that should be used to format number in the base unit. * Since it represents precision of the value - it can be potentially used for other units as well. * */ decimals?: number; })[]; /** PBR Material texture description * @category Render View */ export declare interface TextureDescription extends RenderStateTextureReference, PBRMaterialInfo { /** Display name of texture. */ readonly name: string; /** Texture tags. */ readonly tags: readonly string[]; /** Thumbnail URL. */ readonly thumnbnailURL?: string; } declare type TextureImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas; declare interface TextureInfo { readonly length: number; readonly semantic: EnumArray; readonly transform: Float3x3; readonly pixelRange: PixelRange; } declare interface TextureInfo_2 { readonly length: number; readonly semantic: EnumArray; readonly transform: Float3x3_2; readonly pixelRange: PixelRange_2; } declare interface TextureInfo_3 { readonly length: number; readonly semantic: EnumArray; readonly transform: Float3x3_3; readonly pixelRange: PixelRange_3; } declare interface TextureInfoRange { readonly start: U8; readonly count: U8; } declare interface TextureInfoRange_2 { readonly start: U8; readonly count: U8; } declare interface TextureInfoRange_3 { readonly start: U8; readonly count: U8; } declare type TextureParams = TextureParams2DUncompressedImage | TextureParams2DUncompressed | TextureParams2DCompressed | TextureParams2DUncompressedMipMapped | TextureParams2DCompressedMipMapped | TextureParamsCubeUncompressed | TextureParamsCubeCompressed | TextureParamsCubeUncompressedMipMapped | TextureParamsCubeCompressedMipMapped | TextureParams3DUncompressed | TextureParams3DCompressed | TextureParams3DUncompressedMipMapped | TextureParams3DCompressedMipMapped | TextureParams2DArrayUncompressed | TextureParams2DArrayCompressed | TextureParams2DArrayUncompressedMipMapped | TextureParams2DArrayCompressedMipMapped; declare interface TextureParams2DArrayCompressed extends Compressed, Size2DArray { readonly kind: "TEXTURE_2D_ARRAY"; readonly image: BufferSource; } declare interface TextureParams2DArrayCompressedMipMapped extends Compressed, Size2DArray { readonly kind: "TEXTURE_2D_ARRAY"; readonly mipMaps: readonly BufferSource[]; } declare type TextureParams2DArrayUncompressed = Uncompressed & Size2DArray & GenMipMap & { readonly kind: "TEXTURE_2D_ARRAY"; readonly image: BufferSource | null; }; declare type TextureParams2DArrayUncompressedMipMapped = Uncompressed & Size2DArray & { readonly kind: "TEXTURE_2D_ARRAY"; readonly mipMaps: number | readonly (BufferSource | null)[]; }; declare interface TextureParams2DCompressed extends Compressed, Size2D { readonly kind: "TEXTURE_2D"; readonly image: BufferSource; } declare interface TextureParams2DCompressedMipMapped extends Compressed, Size2D { readonly kind: "TEXTURE_2D"; readonly mipMaps: readonly BufferSource[]; } declare type TextureParams2DUncompressed = Uncompressed & Size2D & GenMipMap & { readonly kind: "TEXTURE_2D"; readonly image: BufferSource | TextureImageSource | null; }; declare type TextureParams2DUncompressedImage = Uncompressed & Partial & GenMipMap & { readonly kind: "TEXTURE_2D"; readonly image: TextureImageSource; }; declare type TextureParams2DUncompressedMipMapped = Uncompressed & Size2D & GenMipMap & { readonly kind: "TEXTURE_2D"; readonly mipMaps: number | readonly (BufferSource | null)[]; }; declare interface TextureParams3DCompressed extends Compressed, Size3D { readonly kind: "TEXTURE_3D"; readonly image: BufferSource; } declare interface TextureParams3DCompressedMipMapped extends Compressed, Size3D { readonly kind: "TEXTURE_3D"; readonly mipMaps: readonly BufferSource[]; } declare type TextureParams3DUncompressed = Uncompressed & Size3D & GenMipMap & { readonly kind: "TEXTURE_3D"; readonly image: BufferSource | null; }; declare type TextureParams3DUncompressedMipMapped = Uncompressed & Size3D & { readonly kind: "TEXTURE_3D"; readonly mipMaps: number | readonly (BufferSource | null)[]; }; declare interface TextureParamsCubeCompressed extends Compressed, Size2D { readonly kind: "TEXTURE_CUBE_MAP"; readonly image: CubeImages; } declare interface TextureParamsCubeCompressedMipMapped extends Compressed, Size2D { readonly kind: "TEXTURE_CUBE_MAP"; readonly mipMaps: readonly CubeImages[]; } declare type TextureParamsCubeUncompressed = Uncompressed & Size2D & GenMipMap & { readonly kind: "TEXTURE_CUBE_MAP"; readonly image: CubeImages | null; }; declare type TextureParamsCubeUncompressedMipMapped = Uncompressed & Size2D & { readonly kind: "TEXTURE_CUBE_MAP"; readonly mipMaps: number | readonly (CubeImages | null)[]; }; declare const enum TextureSemantic { baseColor = 0 } declare const enum TextureSemantic_2 { baseColor = 0 } declare const enum TextureSemantic_3 { baseColor = 0 } declare const TextureSemantic_4: typeof Current.TextureSemantic; declare type TextureSemantic_4 = Current.TextureSemantic | Previous.TextureSemantic | LTS.TextureSemantic; /** Texture slot assignment return value. * @see {@link View.assignTextureSlot} */ export declare interface TextureSlot { readonly index: ActiveTextureIndex; readonly existed: boolean; } declare type TextureTargetString = TextureParams["kind"]; /** Used to visualize internal render buffers. * @defaultValue `TonemappingMode.color`. * @category Render State */ export declare enum TonemappingMode { /** Render the regular color output using HDR tone-mapping. */ color = 0, /** Visualize the normal buffer. */ normal = 1, /** Visualize the normal buffer. */ depth = 2, /** Visualize the object id/index buffer. */ objectId = 3, /** Visualize the deviation buffer, if any. */ deviation = 4, /** Visualize the z-buffer. */ zbuffer = 5 } declare interface TorusData { readonly kind: "torus"; readonly transform: FixedSizeArray_2; readonly coefficients: number[]; readonly majorRadius: number; readonly minorRadius: number; } /** A single touch input contact point. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Touch} for more details. * @category Camera Controllers */ export declare interface TouchContactPoint { /** The touch identifier. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Touch/identifier} */ readonly id: number; /** The touch client x coordinate. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Touch/clientX} */ readonly x: number; /** The touch client y coordinate. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Touch/clientY} */ readonly y: number; } declare interface Triangle { readonly length: number; readonly topologyFlags?: U8; } declare interface Triangle_2 { readonly length: number; readonly topologyFlags?: U8; } declare interface Triangle_3 { readonly length: number; readonly topologyFlags?: U8; } declare interface Triangulation { readonly indices: readonly Index[]; readonly vertices: readonly number[]; } declare type U32 = Uint32Array; declare type U8 = Uint8Array; declare type Uncompressed = UncompressedTextureFormatType; declare type UncompressedTextureFormatType = { internalFormat: "R8"; type: "UNSIGNED_BYTE"; } | { internalFormat: "R8_SNORM"; type: "BYTE"; } | { internalFormat: "R16F"; type: "HALF_FLOAT" | "FLOAT"; } | { internalFormat: "R32F"; type: "FLOAT"; } | { internalFormat: "R8UI"; type: "UNSIGNED_BYTE"; } | { internalFormat: "R8I"; type: "BYTE"; } | { internalFormat: "R16UI"; type: "UNSIGNED_SHORT"; } | { internalFormat: "R16I"; type: "SHORT"; } | { internalFormat: "R32UI"; type: "UNSIGNED_INT"; } | { internalFormat: "R32I"; type: "INT"; } | { internalFormat: "RG8"; type: "UNSIGNED_BYTE"; } | { internalFormat: "RG8_SNORM"; type: "BYTE"; } | { internalFormat: "RG16F"; type: "HALF_FLOAT" | "FLOAT"; } | { internalFormat: "RG32F"; type: "FLOAT"; } | { internalFormat: "RG8UI"; type: "UNSIGNED_BYTE"; } | { internalFormat: "RG8I"; type: "BYTE"; } | { internalFormat: "RG16UI"; type: "UNSIGNED_SHORT"; } | { internalFormat: "RG16I"; type: "SHORT"; } | { internalFormat: "RG32UI"; type: "UNSIGNED_INT"; } | { internalFormat: "RG32I"; type: "INT"; } | { internalFormat: "RGB8"; type: "UNSIGNED_BYTE"; } | { internalFormat: "SRGB8"; type: "UNSIGNED_BYTE"; } | { internalFormat: "RGB565"; type: "UNSIGNED_BYTE" | "UNSIGNED_SHORT_5_6_5"; } | { internalFormat: "RGB8_SNORM"; type: "BYTE"; } | { internalFormat: "R11F_G11F_B10F"; type: "UNSIGNED_INT_10F_11F_11F_REV" | "HALF_FLOAT" | "FLOAT"; } | { internalFormat: "RGB9_E5"; type: "UNSIGNED_INT_5_9_9_9_REV" | "HALF_FLOAT" | "FLOAT"; } | { internalFormat: "RGB16F"; type: "HALF_FLOAT" | "FLOAT"; } | { internalFormat: "RGB32F"; type: "FLOAT"; } | { internalFormat: "RGB8UI"; type: "UNSIGNED_BYTE"; } | { internalFormat: "RGB8I"; type: "BYTE"; } | { internalFormat: "RGB16UI"; type: "UNSIGNED_SHORT"; } | { internalFormat: "RGB16I"; type: "SHORT"; } | { internalFormat: "RGB32UI"; type: "UNSIGNED_INT"; } | { internalFormat: "RGB32I"; type: "INT"; } | { internalFormat: "RGBA8"; type: "UNSIGNED_BYTE"; } | { internalFormat: "SRGB8_ALPHA8"; type: "UNSIGNED_BYTE"; } | { internalFormat: "RGBA8_SNORM"; type: "BYTE"; } | { internalFormat: "RGB5_A1"; type: "UNSIGNED_BYTE" | "UNSIGNED_SHORT_5_5_5_1" | "UNSIGNED_INT_2_10_10_10_REV"; } | { internalFormat: "RGBA4"; type: "UNSIGNED_BYTE" | "UNSIGNED_SHORT_4_4_4_4"; } | { internalFormat: "RGB10_A2"; type: "UNSIGNED_INT_2_10_10_10_REV"; } | { internalFormat: "RGBA16F"; type: "HALF_FLOAT" | "FLOAT"; } | { internalFormat: "RGBA32F"; type: "FLOAT"; } | { internalFormat: "RGBA8UI"; type: "UNSIGNED_BYTE"; } | { internalFormat: "RGBA8I"; type: "BYTE"; } | { internalFormat: "RGB10_A2UI"; type: "UNSIGNED_INT_2_10_10_10_REV"; } | { internalFormat: "RGBA16UI"; type: "UNSIGNED_SHORT"; } | { internalFormat: "RGBA16I"; type: "SHORT"; } | { internalFormat: "RGBA32I"; type: "INT"; } | { internalFormat: "RGBA32UI"; type: "UNSIGNED_INT"; } | { internalFormat: "DEPTH_COMPONENT16"; type: "UNSIGNED_SHORT"; } | { internalFormat: "DEPTH_COMPONENT24"; type: "UNSIGNED_INT"; } | { internalFormat: "DEPTH_COMPONENT32F"; type: "FLOAT"; } | { internalFormat: "DEPTH24_STENCIL8"; type: "UNSIGNED_INT_24_8"; } | { internalFormat: "DEPTH32F_STENCIL8"; type: "FLOAT_32_UNSIGNED_INT_24_8_REV"; }; /* Excluded from this release type: Uniforms */ declare interface UniformsProxy { readonly buffer: ArrayBuffer; readonly dirtyRange: DirtyRange; readonly values: { [index: string]: boolean | number | ArrayLike; }; } declare const UNIT_TYPE: { readonly length: "length"; readonly angle: "angle"; }; export declare type UnitType = (typeof UNIT_TYPE)[keyof typeof UNIT_TYPE]; /** * Validate render state changes. * @param newState The new render state to validate. * @param changes The changes that was applied to the baseline state to produce this state. * @returns Array of validation errors, if any. * @remarks * This function performs some basic validation of the state changes, focusing on value ranges and states that would generate run-time exceptions. * @category Render State */ export declare function validateRenderState(newState: RenderState, changes: RenderStateChanges): readonly Error[]; declare const version = "2.3"; declare const version_2 = "2.2"; declare const version_3 = "2.1"; declare interface Vertex { readonly length: number; readonly position16?: Int16_3; readonly position32?: Int32_3; readonly normal?: Int8_3; readonly color?: RGBA_U8; readonly texCoord?: Half2; readonly projectedPos16?: Int16_3; readonly projectedPos32?: Int32_3; readonly pointIntensity?: F16; readonly pointClassification?: F16; readonly pointDeviation0?: F16; readonly pointDeviation1?: F16; readonly pointDeviation2?: F16; readonly pointDeviation3?: F16; readonly pointDeviation4?: F16; readonly pointDeviation5?: F16; } declare interface Vertex_2 { readonly length: number; readonly position16?: Int16_3_2; readonly position32?: Int32_3_2; readonly normal?: Int8_3_2; readonly color?: RGBA_U8_2; readonly texCoord?: Half2_2; readonly projectedPos16?: Int16_3_2; readonly projectedPos32?: Int32_3_2; readonly deviations: Deviations; } declare interface Vertex_3 { readonly length: number; readonly position: Int16_3_3; readonly normal?: Int8_3_3; readonly color?: RGBA_U8_3; readonly texCoord?: Half2_3; readonly projectedPos?: Int16_3_3; readonly deviations: Deviations_2; } declare interface VertexArrayParams { readonly attributes: readonly (VertexAttribute | null)[]; readonly indices?: WebGLBuffer; } declare type VertexAttribNames = keyof typeof VertexAttributesEnum; declare type VertexAttribute = VertexAttributeFloat | VertexAttributeFloatNormalized | VertexAttributeInt | VertexAttributeUint; declare interface VertexAttributeCommon { readonly buffer: WebGLBuffer; readonly componentCount?: 1 | 2 | 3 | 4; readonly byteStride?: number; readonly byteOffset?: number; readonly divisor?: number; } /* Excluded from this release type: VertexAttributeData */ declare interface VertexAttributeFloat extends VertexAttributeCommon { readonly kind: ShaderTypeFloat; readonly componentType?: ComponentType; readonly normalized?: false; } declare interface VertexAttributeFloatNormalized extends VertexAttributeCommon { readonly kind: ShaderTypeFloat; readonly componentType?: ComponentTypeInt | ComponentTypeUint; readonly normalized: true; } declare interface VertexAttributeInt extends VertexAttributeCommon { readonly kind: ShaderTypeInt; readonly componentType?: ComponentTypeInt; readonly normalized?: undefined; } declare type VertexAttributes = { readonly [P in VertexAttribNames]: T | null; }; declare const enum VertexAttributesEnum { position = 0, normal = 1, material = 2, objectId = 3, texCoord0 = 4, color0 = 5, projectedPos = 6, pointFactors0 = 7, pointFactors1 = 8, highlight = 9 } /* Excluded from this release type: VertexAttributeUint */ declare interface VertexData { position: ReadonlyVec3; } declare interface VertexIndexRange { readonly start: U32; readonly count: U32; } declare interface VertexIndexRange_2 { readonly start: U32; readonly count: U32; } declare interface VertexIndexRange_3 { readonly start: U32; readonly count: U32; } declare interface VertexRange { readonly start: U32; readonly count: U32; } declare interface VertexRange_2 { readonly start: U32; readonly count: U32; } declare interface VertexRange_3 { readonly start: U32; readonly count: U32; } export declare type VerticalPointOfCurvature = { station: number; height: number; kind: CurvatureKind; parameter?: number; }; export declare class View> implements Disposable { /** The HTMLCanvasElement used for rendering. */ readonly canvas: HTMLCanvasElement; static readonly terrainMaxId = 99; static readonly maxHighlightGroups = 250; /** Available camera controller types. */ controllers: CameraControllerTypes; private _renderContext; private _run; private _deviceProfile; private _initCore3DPromise; private _stateChanges; private _activeController; private _statistics; private _measureView; private _dataContext; private _offline; private _drawContext2d; private _screenSpaceConversions; private readonly _resizeObserver; /* Excluded from this release type: renderStateGL */ /* Excluded from this release type: renderStateCad */ /* Excluded from this release type: prevRenderStateCad */ /** Optional custom URL builder for file requests (FAS/Procore specific). * * May return either a URL synchronously or a Promise that resolves to a URL. * Async support enables consumers to mint fresh signed URLs per request * (e.g. Procore signed FAS URLs that expire after 24h) without restarting * the view. See `doc/MIGRATION_URLBUILDER.md`. */ private readonly urlBuilder?; private resolutionModifier; private baseRenderResolution; private drsHighInterval; private drsLowInterval; private lastDrsAdjustTime; private lastDetailAdjustTime; private resolutionTier; private currentActiveDetailBias; private currentDownloadDetailBias; private lastDetailChangeAfterUpdate; private baseSceneUrl; /** * @param canvas The HtmlCanvasElement used for rendering. * @param deviceProfile The device profile describing the host device's GPU performance characteristics and limitations. * @param options.listenToDocumentEvents Listen to keydown and keyup on document level when true, otherwise just on canvas. Default is `true`. * @param options.showWatermark Show company watermark. Default is `true`. * @param options.webglContextAttributes WebGL context attribute overrides. * @remarks * Your browser must run in a {@link https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts | secure} * and {@link https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts | cross-origin isolated } context. * @deprecated Use {@link View.create} instead. */ constructor( /** The HTMLCanvasElement used for rendering. */ canvas: HTMLCanvasElement, deviceProfile: DeviceProfile, controllersFactory?: CameraControllersFactory, { listenToDocumentEvents, showWatermark, webglContextAttributes, urlBuilder, }?: ViewCreateOptions); /** * @param canvas The HtmlCanvasElement used for rendering. * @param deviceProfile The device profile describing the host device's GPU performance characteristics and limitations. * @param options.listenToDocumentEvents Listen to keydown and keyup on document level when true, otherwise just on canvas. Default is `true`. * @param options.showWatermark Show company watermark. Default is `true`. * @param options.webglContextAttributes WebGL context attribute overrides. * @remarks * Your browser must run in a {@link https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts | secure} * and {@link https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts | cross-origin isolated } context. */ static create>( /** The HTMLCanvasElement used for rendering. */ canvas: HTMLCanvasElement, deviceProfile: DeviceProfile, controllersFactory?: CameraControllersFactory, opts?: ViewCreateOptions): Promise>; /** Dispose of the view's GPU resources. */ [Symbol.dispose](): void; /** Dispose of the view's GPU resources. */ dispose(): void; /** * Get the current measure view, or undefined if no scene has been loaded or has no measurement data. * @see {@link loadSceneFromURL}. */ get measure(): MeasureView | undefined; /** * Get the current data context, or undefined if no scene has been loaded or has no meta data. * @see {@link loadSceneFromURL}. */ get data(): DataContext | undefined; /** * Get the current offline context, or undefined if no scene has been loaded. * @see {@link loadSceneFromURL}. */ get offline(): OfflineContext | undefined; get activeController(): BaseController; get renderContext(): RenderContext | undefined; get renderState(): RenderState; get prevRenderState(): RenderState | undefined; get statistics(): { readonly render: RenderStatistics; readonly view: ViewStatistics; } | undefined; /** * The current device profile. * @remarks * Setting a new device profile will force a recreation of the entire render context and should generally be avoided. * Valid cases for doing so might be users manually overriding the GPU profile of their device, or for testing/diagnostics purposes. */ get deviceProfile(): DeviceProfile; /** * Update the active device profile live (without recreating the WebGL context). * @param profile New device profile. * @returns true if something affecting rendering changed. */ updateDeviceProfile(profile: DeviceProfile): boolean; /** * Convert between different spaces like world, view and screen. */ get convert(): ScreenSpaceConversions; /** * Manage offline storage. * Forwards an OfflineUrlBuilder adapter when the View has a custom urlBuilder * (e.g. Procore); standalone Views use default Novorender CDN behavior. * @returns An offline view state context used for offline storage management UI. */ getOfflineViewState(): Promise; /** Determine if camera is looking straight down. */ isTopDown(): boolean; /** * The scene is considered resolved when it is done loading all nodes for the current render state. * @returns if the scene is currently resolved */ isSceneResolved(): boolean; /** * Convert 2D pixel position to 3D position. * @param x Pixel x coordinate, in CSS pixels. * @param y Pixel y coordinate, in CSS pixels. * @returns Corresponding 3D position at the view plane in world space, or undefined if there is no active render context. * @deprecated use view.convert.screenSpaceToWorldSpace instead */ worldPositionFromPixelPosition(x: number, y: number): IndexedCollection | undefined; /** * Retrieve list of available background/IBL environments. * @public * @param indexUrl * The absolute url of the index.json file. * @returns A promise of a list of environments. */ static availableEnvironments(indexUrl: URL): Promise; /** @deprecated Use static {@link View.availableEnvironments} instead. */ availableEnvironments(indexUrl: URL): Promise; /** * Retrieve list of network requests for given environment(s) for cache/offline purposes. * @param environments The environment description objects. * @remarks * The returned requests are suitable for [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll). */ static environmentRequests(...environments: readonly EnvironmentDescription[]): readonly Request[]; /** * Retrieve list of available textures. * @public * @param indexUrl * The absolute url of the index.json file. * @returns A promise of a list of environments. */ availableTextures(indexUrl: URL): Promise; /** * Retrieve list of network requests for given texture(s) for cache/offline purposes. * @param environments The texture description objects. * @remarks * The returned requests are suitable for [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache/addAll). */ static textureRequests(...textures: readonly TextureDescription[]): readonly Request[]; /** * Load a scene. * @public * @param baseUrl The absolute base url to the folder containing the scenes with optional sas-key, e.g. `https://blobs.novorender.com/?sv=...`. * @param sceneId The scene id/guid. * @param version The hash of the desired scene version. * @param abortSignal Optional abort controller. * @param offlineOnly When `true`, read from OPFS only and throw * {@link OfflineFileNotFoundError} on miss -- no network attempt. For hosts * that already detected offline state (e.g. Procore mobile). Omit/false * keeps the default network-first-with-OPFS-fallback behavior. * @remarks * The url typically contains the scene id as the latter part of the path, i.e. `https://...//`. */ loadScene(baseUrl: URL, sceneId: string, version: string, abortSignal?: AbortSignal, offlineOnly?: boolean): Promise; /** * Builds asset URL for the given file path synchronously. * * @param {string} path - Relative file path (e.g. `webgl2_bin/config.json`). * @throws {Error} If baseSceneUrl is not initialized yet (`loadScene` not called yet). * @throws {Error} If the configured `urlBuilder` returned a `Promise`. * In that case call {@link buildAssetUrlAsync} instead. * @returns {URL} The complete URL object for the file. */ buildAssetUrl(path: string): URL; /** * Builds asset URL for the given file path; awaits async `urlBuilder` when present. * * Always-safe variant of {@link buildAssetUrl}. Use this when the * configured `urlBuilder` may return a `Promise` (e.g. for backends * that mint short-lived signed URLs per request). * * @param {string} path - Relative file path (e.g. `webgl2_bin/config.json`). * @throws {Error} If baseSceneUrl is not initialized yet (`loadScene` not called yet). * @returns {Promise} The complete URL object for the file. */ buildAssetUrlAsync(path: string): Promise; /** * Inspect the deviations that is on screen * @public * @param settings Deviation settings, * @returns Spaced out labels prioritizing the smallest or highest deviation values based on settings. * Also returns a line trough the points if it is able to project the points on a line and the option is given. */ inspectDeviations(settings: DeviationInspectionSettings): Promise; /** * Create list of laser intersections based on information already on screen * @public * @param laserPosition position where to calculate intersections, * @param onlyOnOutlines only intersect with outlines rendered to screen, drawing outlines must be enabled to work * @param xDir optional x direction of the laser * @param yDir optional y direction of the laser * @param zDir optional z direction of the laser * @param autoAlign if set to true the laser will try to align to the closest intersection line. * @returns list of intersections (right, left, up ,down, zUp, zDown) * the lists will either contain a single intersection or none, the zDown will always be the laser position. */ screenSpaceLaser({ laserPosition, onlyOnOutlines, xDir, yDir, zDir, autoAlign, }: { laserPosition: ReadonlyVec3; onlyOnOutlines: boolean; xDir?: ReadonlyVec3; yDir?: ReadonlyVec3; zDir?: ReadonlyVec3; autoAlign?: boolean; }): Intersection | undefined; /** * Create a list of intersections between the x and y axis through the tracer position * @public * @param laserPosition position where to calculate intersections, * @param planeType choose if planes under clipping or outlines should be used * @param planeIndex The index of the plane where tracer should be placed, based on the list in render state * @param rotation rotation of the lasers in the plane, if undefined then x,y will be used * @param autoAlign Auto align the lasers to the geometry, "model" will try to align to the highest number of lines it will intersect with * while "closest" will align to the closest line it intersects with * @returns list of intersections (right, left, up ,down) * results will be ordered from closest to furthest from the tracer point */ outlineLaser(laserPosition: ReadonlyVec3, planeType: "clipping" | "outline", planeIndex: number, rotation?: number, autoAlign?: "model" | "closest"): Intersection | undefined; /** * Get current outline drawable objects. * * @param planeType choose if planes under clipping or outlines should be used * @param planeIndex the index of the plane to look up * @param drawContext Option to convert the 2d positions to another draw context * @returns Outlines as drawable objects for the 2d egnine. */ getOutlineDrawObjects(planeType: "clipping" | "outline", planeIndex: number, drawContext?: DrawContext, settings?: LinesDrawSetting, filter?: Set): DrawProduct[]; /** * Find bounding rectangle on the given plane for the selected objects, converted to world coordinates. * * @param planeType choose if planes under clipping or outlines should be used * @param planeIndex the index of the plane to look up * @param objectIds set of object IDs to check * @returns bounding rectangle of all the selected object ID vertices lying on the give plane. * Bounds are calculated in plane coordinates and returned in world coordinates */ getObjectsOutlinePlaneBoundingRectInWorld(planeType: "clipping" | "outline", planeIndex: number, objectIds: Set): AABB | undefined; /** * Select outline point based on the proximity to the input point. * @param position Input position, outline points will be tested againts this. * @param threshold Threshold in meters, if no points are within this proxmitiy of the input point undefined will be returned * @public * @returns returns the closest point to the input position. */ selectOutlinePoint(position: ReadonlyVec3, threshold: number): IndexedCollection | undefined; /** * Get all object ids currently on screen * @public * @returns returns a set of all object ids on the screen */ getOutlineObjectsOnScreen(): Set; /** * For each point find an edge nearby: * - If point is close to an edge of object with the same objectId - return that edge direction. * - If point is close to another triangle - return cross product of that triangle's normal and the point's normal. * Function can be used to find edge directions for points on the surface of a mesh e.g. to have nice laser line endings. * @param points points to query, each point should contain a position, normal and objectId * @param tolerance maximum distance to the edge or other triangle * @returns array of edge directions or nulls, same size as points */ getNonParametricEdgeDirAtPoints(points: { pos: ReadonlyVec3; normal: ReadonlyVec3; }[], tolerance: number): Promise<(ReadonlyVec3 | null)[] | undefined>; getNormalAtPosition(position: ReadonlyVec3, objectId: number, tolerance: number): vec3 | undefined; threePointLaser(request: LaserIntersectionRequest): LaserIntersectionResult | undefined; /** * Query parametric measure entity for the given coordinates * @param x Center x coordinate in css pixels. * @param y Center y coordinate in css pixels. * @param options Extra options. * @returns Parametric measure entity, if non exists in the current location, the poisiton will be retuned. */ pickMeasureEntity(x: number, y: number, options?: PickOptions): Promise; /** * Query object and geometry information for given view coordinate. * @param x Center x coordinate in css pixels. * @param y Center y coordinate in css pixels. * @param options Extra options. * @returns The sample within the sample disc that is closest to the camera, if any. */ pick(x: number, y: number, options?: PickOptions): Promise; /** * Scan a rectangular region of the Picking Buffer (Select Box). * @param x0 Top-left x coordinate in CSS pixels. * @param y0 Top-left y coordinate in CSS pixels. * @param x1 Bottom-right x coordinate in CSS pixels. * @param y1 Bottom-right y coordinate in CSS pixels. * @returns A Set of unique object IDs contained/intersected by the Select Box. * @remarks * This function reads all pixels from the picking buffer within the specified rectangular region * and returns all unique object IDs found. This is useful for implementing selection box functionality * where you want to select all objects within a 2D screen-space rectangle. * * Note that terrain objects (objectId <= {@link View.terrainMaxId}) are included in the results. * You may want to filter these out if needed. * @example * ```typescript * // Get all object IDs in a rectangle from (100,100) to (200,200) * const objectIds = await view.selectBox(100, 100, 200, 200); * console.log(`Found ${objectIds.size} unique objects in selection box`); * ``` */ selectBox(x0: number, y0: number, x1: number, y1: number): Promise>; /** * Count how many pixels each object covers in the Picking Buffer. * @param options See {@link ObjectPixelCountsOptions}. * @returns A map of objectId to the number of (sampled) pixels it covers. * @remarks * This function reads pixels from the picking buffer (optionally within the given rectangle) and counts the * number of pixels belonging to each object. Terrain objects (objectId <= {@link View.terrainMaxId}) and reserved object IDs are * excluded from the result, so only real objects are counted. * When `dx`/`dy` are > 1 the returned counts are subsampled; multiply by `dx * dy` to estimate full-resolution coverage. * @example * ```typescript * // Count pixels per object across the whole view * const counts = await view.objectPixelCounts(); * for (const [objectId, pixels] of counts) { * console.log(`Object ${objectId} covers ${pixels} pixels`); * } * // On a high-DPI device, sample every other pixel for ~4x less work * const approx = await view.objectPixelCounts({ dx: 2, dy: 2 }); * ``` */ objectPixelCounts(options?: ObjectPixelCountsOptions): Promise>; /** * Switch to a new kind of camera controller. * @param kind The type of camera controller to switch to. * @param initialState Optional initial state for the new camera controller. Undefined properties will be copied/adapted from the current render state. * @param options Switch options. * @template T Kind of camera controller. * @returns The new camera controller. * @remarks * The function will also set the {@link RenderStateCamera.kind | camera projection model}. */ switchCameraController(kind: T, initialState?: CameraControllerInitialValues, options?: CameraControllerOptions): Promise; /** * Start the main render loop for the view. * @param abortSignal Signal to abort any pending downloads and exit render loop. * @remarks * This method will not exit until you signal the abortSignal. */ run(abortSignal?: AbortSignal): Promise; /** Signal the render loop to exit. * @see {@link run}. * @deprecated Use {@link run} `abortSignal` instead. */ exit(): void; /* Excluded from this release type: capture */ /** Accumulate render state changes. * @param changes The changes to apply to the current view render state. * @remarks * These changes will be applied and a single call to the {@link modifyRenderState} function just prior to rendering each frame. */ modifyRenderState(changes: RenderStateChanges): void; /** * Validate render state changes made since last rendered frame. * @param changes The render state changes to validate, or undefined to validate changes applied via {@link View.modifyRenderState} since last rendered frame. * @returns An array of validation errors, if any. * @see {@link View.modifyRenderState} * @remarks * Validation is useful for catching potential bugs and problems early. * It should not be performed in production code, however, since it is non-trivial in terms of performance, particularly on large sets of dynamic objects. */ validateRenderState(changes?: RenderStateChanges): readonly Error[]; /** * Override this in a derived class to modify render state just prior to rendering. * @param time The frame render timestamp in millisecond. * @virtual */ animate?(time: number): void; /** * Override this in a derived class to handle render state validation. * @param newState The new render state about to be rendered * @param changes The changes that went into the new render state. * @virtual */ validate?(newState: RenderState, changes: RenderStateChanges): void; /** * Override this in a derived class for custom rendering of e.g. 2D content, such as text and lines etc. * @param isIdleFrame If this frame is an idle frame, a frame with more visual features and higher resolution, * delayed triggered when camera stopped movinbg. * @param cameraMoved Was the camera moving or not during the current frame. * @virtual */ render?(params: { isIdleFrame: boolean; cameraMoved: boolean; }): void; /** * Helper function for assigning an index to the specified texture reference. * @param texture Texture reference to assign index to. * @param addCB Optional callback to be called if the texture reference * @returns A valid texture index slot and a flag indictating whether the slot existed or not. * @remarks * This function check if the reference object already exists in the current render state and if so, return the existing index. * If not, it will find the first available slot that currently has no references, i.e. no highlight groups referring to it. * In the latter case, it will update the render state to reflect the new texture reference. * If the maximum amount of textures {@link MaxActiveTextures} are exceeded, this function will throw an exception. */ assignTextureSlot(texture: RenderStateTextureReference): TextureSlot; /** * Wait for promises spawned in the constructor to settle. * Particularly it allows to catch errors during canvas initialization. * @returns A promise which resolves when the view is ready to be used. */ private waitForReadiness; /** * Callback function to update render context. * @param context A new render context. * @remarks * A new render context may be set each time the underlying webgl context is lost and restored, * or when certain state changes are made that forces a recreation of the context, such as setting a new {@link deviceProfile}. * @virtual */ protected readonly setRenderContext: (context: RenderContext) => void; private get currentRenderState(); private useDeviceProfile; private resize; private recalcBaseRenderResolution; private applyChanges; private createRenderState; private dynamicDetailAdjustment; private dynamicQualityAdjustment; private dynamicResolutionScaling; } export declare interface ViewCreateOptions { listenToDocumentEvents?: boolean; showWatermark?: boolean; webglContextAttributes?: WebGLContextAttributes; /** * Optional custom URL builder for constructing file URLs. * If provided, this function will be used instead of default path-append behavior. * * ⚠️ **IMPORTANT - Procore/FAS Specific:** * This option is specifically designed for Procore File Access Service (FAS) integration. * When provided, it automatically enables FAS-specific URL format (`?file=`) for both: * - Rendering scene files (uses your custom urlBuilder function) * - Measurement/BREP files (hardcoded to use ?file= query parameter format) * * If you need a truly generic URL builder for non-FAS backends, this limitation * should be noted. The measure subsystem will assume FAS format when urlBuilder is present. * * @param baseUrl - The base URL (may contain query params like signatures) * @param filePath - The relative file path to append/encode * @returns The complete URL object for the file, either synchronously or as a Promise. * @remarks * Async return is supported so consumers can mint a fresh URL per request * (e.g. for short-lived Procore signed FAS URLs). The SDK will `await` the * result before each fetch, so consumers do not need to cache or pre-resolve. * @example * // Synchronous (legacy) — Procore FAS query-param format: * urlBuilder: (baseUrl, filePath) => { * const url = new URL(baseUrl); * url.searchParams.set('file', filePath); * return url; * } * @example * // Asynchronous — fetch a fresh signed URL for each file request: * urlBuilder: async (baseUrl, filePath) => { * const signed = await mySignedUrlService.get(filePath); * return new URL(signed); * } */ urlBuilder?: (baseUrl: string, filePath: string) => URL | Promise; } /** The 6 planes of a {@link https://en.wikipedia.org/wiki/Viewing_frustum | view frustum}, defined in world space. * @remarks * Planes are defined as 4D {@link https://en.wikipedia.org/wiki/Half-space_(geometry) | half-space} vectors. * Points are inside the halfspace when the dot product of the half-space vector and a 4D variant of the point with w=1 is negative. * * `inside = dot(vec4(point, 1.), plane) < 0.;` * @category Render State */ export declare interface ViewFrustum { /** The left screen edge plane of the frustum */ readonly left: ReadonlyVec4; /** The right screen edge plane of the frustum */ readonly right: ReadonlyVec4; /** The top screen edge plane of the frustum */ readonly top: ReadonlyVec4; /** The bottom screen edge plane of the frustum */ readonly bottom: ReadonlyVec4; /** The camera's near clipping plane. */ readonly near: ReadonlyVec4; /** The camera's far clipping plane. */ readonly far: ReadonlyVec4; /** A plane coincident with camera position and parallel to screen/image plane in world space. */ readonly image: ReadonlyVec4; /** All tuple of all planes used for {@link https://en.wikipedia.org/wiki/Hidden-surface_determination#Viewing-frustum_culling | culling}. */ readonly planes: readonly [ left: ReadonlyVec4, right: ReadonlyVec4, top: ReadonlyVec4, bottom: ReadonlyVec4, near: ReadonlyVec4, far: ReadonlyVec4 ]; } /** View related render statistics. * @category Render View */ export declare interface ViewStatistics { /** Effective resolution factor. */ readonly resolution: number; /** Effective detail bias factor. */ readonly detailBias: number; /** Effective frames per second, if available. */ readonly fps?: number; } /* Excluded from this release type: Visibility */ declare type WebGLResource = WebGLBuffer | WebGLFramebuffer | WebGLProgram | WebGLQuery | WebGLRenderbuffer | WebGLSampler | WebGLShader | WebGLSync | WebGLTransformFeedback | WebGLTexture | WebGLTransformFeedback | WebGLVertexArrayObject; declare type WrapString = "CLAMP_TO_EDGE" | "MIRRORED_REPEAT" | "REPEAT"; export { }