import { Box3 } from 'three'; import { Components } from '@thatopen/components'; import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js'; import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer.js'; import { DataMap } from '@thatopen/fragments'; import { DataMap as DataMap_2 } from '@thatopen/components'; import { DataSet } from '@thatopen/fragments'; import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'; import { Font } from 'three/examples/jsm/loaders/FontLoader.js'; import * as FRAGS from '@thatopen/fragments'; import { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass.js'; import { GTAOPass } from 'three/examples/jsm/postprocessing/GTAOPass.js'; import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial.js'; import * as OBC from '@thatopen/components'; import { Pass } from 'three/examples/jsm/postprocessing/Pass.js'; import { SimpleRenderer } from '@thatopen/components'; import type { TechnicalDrawing } from '@thatopen/components'; import * as THREE from 'three'; import { Vector3 } from 'three'; /** Represents an angle defined by three points in 3D space: a start point, a vertex (center), and an end point. */ export declare class Angle { /** Unique identifier for this angle instance. */ id: string; /** The first point of the angle. */ start: THREE.Vector3; /** The vertex (center) of the angle where the two rays meet. */ vertex: THREE.Vector3; /** The second point of the angle. */ end: THREE.Vector3; private _units; /** The unit system used for displaying the angle value. */ set units(value: "deg" | "rad"); get units(): "deg" | "rad"; private _rounding; /** The number of decimal places used when computing {@link value}. */ set rounding(value: number); get rounding(): number; /** * The angle is computed as the angle between the vectors (vertex -> start) and (vertex -> end). */ constructor(start?: THREE.Vector3, vertex?: THREE.Vector3, end?: THREE.Vector3); /** The angle in radians, without unit conversion or rounding. Returns 0 when either ray has zero length. */ get rawValue(): number; /** The angle converted to the current {@link units} and rounded to {@link rounding} decimal places. */ get value(): number; /** Creates a deep copy of this angle, preserving all points, units, and rounding. */ clone(): Angle; } export declare class AngleAnnotationsTool extends DrawingTool { private _editState; private _lastCursor; private _previewLabelGroup; private _awaitingPreviewLabel; private readonly _hitPlaneMat; /** The underlying AngleDimensions system — always available. */ readonly system: OBC.AngleAnnotations; constructor(components: OBC.Components); private readonly _onDelete; private readonly _onCommit; private readonly _onUpdate; private readonly _onMachineStateChanged; get state(): OBC.AngleAnnotationState; get isIdle(): boolean; send(msg: Parameters[0]): void; protected _onCancel(): void; onDrawingChange(drawing: OBC.TechnicalDrawing | null, fonts: FontManager | null): void; onActivate(): void; onDeactivate(): void; onPointerClick(cursor: DrawingPointerEvent): void; onPointerMove(e: DrawingPointerEvent): void; dispose(): void; protected _systemPick(ray: THREE.Ray): string | null; protected _systemDelete(drawing: OBC.TechnicalDrawing, uuids: string[]): void; protected _onDeselect(): void; private _createLabel; private _updateLabel; private _positionLabel; private _updatePreviewLabel; private _clearPreviewLabel; private _updateAwaitingPreviewLabel; private _clearAwaitingPreviewLabel; protected _onSelect(uuid: string): void; protected _getHandlePositions(uuid: string): THREE.Vector3[]; } /** * A measurement tool to measure angles between 3 points in 3D and display a visual arc with the numeric angle value. */ export declare class AngleMeasurement extends Measurement { static uuid: "2c88a142-2378-422e-b26a-bb2710841813"; private _visuals; private _temp; /** The list of available measurement modes. */ modes: AngleMeasurerModes[number][]; private _mode; /** The current measurement mode. Changing the mode cancels any in-progress creation. */ get mode(): AngleMeasurerModes[number]; set mode(value: AngleMeasurerModes[number]); constructor(components: OBC.Components); private initHandlers; /** {@link OBC.Createable.create}. Requires 3 successive calls (start, vertex, end) to complete an angle. */ create: () => Promise; /** {@link OBC.Createable.endCreation}. Finalizes the current angle after the third point is set. */ endCreation: () => void; /** {@link OBC.Createable.cancelCreation}. Cancels the in-progress angle and disposes preview visuals. */ cancelCreation: () => void; /** {@link OBC.Createable.delete}. Deletes the angle measurement under the cursor via raycasting. */ delete: () => void; /** {@link OBC.Disposable.dispose}. */ dispose(): void; private initFirstPreview; private upgradeToAnglePreview; private updatePreview; private disposeFirstPreview; private disposeAllPreview; private createAngleVisual; private updateAngleVisual; private disposeVisual; private createEndpointMark; private formatAngle; private createBoundingBox; private updateBoundingBox; private static createArcGeometry; private static getArcMidpoint; } /** The available measurement modes for the angle measurer. */ declare type AngleMeasurerModes = ["free"]; declare class AOPass extends GTAOPass { private _fragments; private _hiddenMaterials; constructor(fragments: OBC.FragmentsManager, scene: THREE.Scene, camera: THREE.Camera, width: number, height: number); render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget, deltaTime: number, maskActive: boolean): void; private _hideLodMaterials; private _restoreLodMaterials; } export declare class Area { id: string; readonly points: DataSet; tolerance: number; private _plane; get plane(): THREE.Plane | null; private get _coordinateSystem(); get points2D(): THREE.Vector2[] | null; get center(): THREE.Vector3 | null; get value(): number; get rawValue(): number; get boundingBox(): THREE.Box3 | null; get perimeter(): number; private _rounding; set rounding(value: number); get rounding(): number; private _units; set units(value: "m2" | "cm2" | "mm2" | "km2"); get units(): "m2" | "cm2" | "mm2" | "km2"; constructor(points?: THREE.Vector3[]); isPointInPlane(point: THREE.Vector3): boolean; clone(): Area; computePlane(): THREE.Plane | null; convertPointTo2D(point: THREE.Vector3): THREE.Vector2 | null; convertPointTo3D(point2D: THREE.Vector2): THREE.Vector3 | null; } /** * AreaMeasurement allows users to measure and interact with areas in a 3D environment. This class provides functionality for creating, updating, and deleting area measurements, as well as managing their visual representation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/AreaMeasurement). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/AreaMeasurement). */ export declare class AreaMeasurement extends Measurement { static uuid: "09b78c1f-0ff1-4630-a818-ceda3d878c75"; /** * The tolerance value used for picking operations in area measurement. * This value determines the precision or sensitivity when selecting or interacting * with measurement areas. A smaller value increases precision, while a larger value * allows for more leniency in selection. * * @default 0.1 */ pickTolerance: number; /** * Represents the tolerance value used for area measurement calculations. * This value defines the acceptable margin of error for a point in the shape to be added to the area element. * * @default 0.005 */ tolerance: number; /** * The possible modes in which a measurement of this type may be created. */ modes: AreaMeasurerModes[number][]; private _mode; get mode(): AreaMeasurerModes[number]; /** * Represents the current measurement mode being used. */ set mode(value: AreaMeasurerModes[number]); private _temp; private _lineToAreaMap; constructor(components: OBC.Components); private initHandlers; private computeLineElements; private updatePreview; create: () => Promise; endCreation: () => void; cancelCreation: () => void; private addLineElementsFromPointsForArea; delete: () => void; } /** * Represents the modes available for measuring areas. `free`: Allows freeform area measurement without constraints. `square`: Restricts area measurement to square shapes. */ declare type AreaMeasurerModes = ["free", "square", "face"]; declare class BasePass extends Pass { scene: THREE.Scene; camera: THREE.Camera; overrideMaterial: THREE.Material | null; clearColor: THREE.Color | null; clearAlpha: number | null; clearDepth: boolean; needsSwap: boolean; isolatedMaterials: THREE.Material[]; private _oldClearColor; constructor(scene: THREE.Scene, camera: THREE.Camera, overrideMaterial?: null, clearColor?: null, clearAlpha?: null); render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget): void; } export declare class BlockAnnotationsTool extends DrawingTool { private _editState; private _lastCursor; /** Name of the block definition to place on next click. */ activeBlock: string | null; /** Rotation in radians applied to each new placement. */ activeRotation: number; /** Uniform scale applied to each new placement. */ activeScale: number; private readonly _rotateMat; private readonly _scaleMat; private readonly _handleNormalMats; private _connectorLine; private readonly _connectorMat; private _feedbackGroup; private _feedbackText; private _previewGroup; private _previewActiveBlock; private readonly _previewLineMat; private readonly _previewMeshMat; /** The underlying DrawingBlocks system — always available. */ readonly system: OBC.BlockAnnotations; constructor(components: OBC.Components); private readonly _onDelete; private readonly _onUpdate; get state(): EditState_2; send(_msg: { type: "CLICK"; point: THREE.Vector3; }): void; protected _onCancel(): void; onDrawingChange(drawing: OBC.TechnicalDrawing | null, fonts: FontManager | null): void; onActivate(): void; onDeactivate(): void; onPointerClick(cursor: DrawingPointerEvent): void; onPointerMove(e: DrawingPointerEvent): void; dispose(): void; readonly translatable = true; protected _systemPick(ray: THREE.Ray): string | null; protected _systemDelete(drawing: OBC.TechnicalDrawing, uuids: string[]): void; protected _onDeselect(): void; private _translateUuids; private readonly _translateOrigins; private _translateDragStart; translateStart(uuids: string[], origin: THREE.Vector3): void; translateUpdate(point: THREE.Vector3): void; translateEnd(): void; translateCancel(): void; protected _buildHandle(idx: number): THREE.Mesh; protected _setHoveredHandle(idx: number | null): void; protected _createHandles(uuid: string, container: THREE.Object3D): void; protected _refreshHandles(uuid: string): void; protected _clearHandles(): void; protected _getHandlePositions(uuid: string): THREE.Vector3[]; private _createConnector; private _updateConnector; private _clearConnector; private _updateFeedback; private _clearFeedback; private _updatePreview; private _clearPreview; protected _onSelect(uuid: string): void; } export declare class CalloutAnnotationsTool extends DrawingTool { private _editState; private _lastCursor; private _textEditUuid; /** The underlying CalloutAnnotations system — always available. */ readonly system: OBC.CalloutAnnotations; /** * Fired when the state machine pauses for text entry — either for a new * annotation (`isEdit: false`) or when the text handle of a selected * annotation is clicked (`isEdit: true`). The consumer should display an * input and call {@link submitText} with the result. */ readonly onEnterText: OBC.Event<{ isEdit: boolean; currentText: string; }>; constructor(components: OBC.Components); private readonly _onDelete; private readonly _onCommit; private readonly _onUpdate; private readonly _onMachineStateChanged; get state(): OBC.CalloutAnnotationState; get isIdle(): boolean; /** * Submit text for the current text-entry operation. * Call this after receiving an {@link onEnterText} event. * - If `isEdit` was true: updates the existing annotation's text. * - If `isEdit` was false: advances the state machine to commit the new annotation. */ submitText(text: string): void; send(msg: Parameters[0]): void; protected _onCancel(): void; onDrawingChange(drawing: OBC.TechnicalDrawing | null, fonts: FontManager | null): void; onActivate(): void; onDeactivate(): void; onPointerClick(cursor: DrawingPointerEvent): void; onPointerMove(e: DrawingPointerEvent): void; dispose(): void; readonly translatable = true; protected _systemPick(ray: THREE.Ray): string | null; protected _systemDelete(drawing: OBC.TechnicalDrawing, uuids: string[]): void; protected _onDeselect(): void; private _translateUuids; private readonly _translateOrigins; private _translateDragStart; translateStart(uuids: string[], origin: THREE.Vector3): void; translateUpdate(point: THREE.Vector3): void; translateEnd(): void; translateCancel(): void; private _createLabel; private _updateLabel; protected _onSelect(uuid: string): void; protected _getHandlePositions(uuid: string): THREE.Vector3[]; } /** * This component is used to navigate and visualize cross sections of a 3D model. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/CivilNavigators). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/CivilCrossSectionNavigator). */ export declare class CivilCrossSectionNavigator extends OBC.Component implements OBC.Disposable { /** * A unique identifier for the component. This UUID is used to register the component within the Components system. */ static readonly uuid: "96b2c87e-d90b-4639-8257-8f01136fe324"; /** {@link OBC.Component.enabled} */ enabled: boolean; /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; private _world; private _flip; private _plane?; private _point; private _edgeMeshes; private _sectionVisible; private _sectionOffset; edgeMaterial: LineMaterial; /** * A property representing the plane used for cross section visualization. */ get plane(): OBC.SimplePlane; /** * A property representing the plane used for cross section visualization. */ set plane(plane: OBC.SimplePlane); get sectionVisible(): boolean; set sectionVisible(visible: boolean); /** * A getter for the 3D world. * @returns The 3D world. */ get world(): OBC.World | null; /** * A setter for the 3D world. * @param world - The new 3D world. */ set world(world: OBC.World | null); constructor(components: OBC.Components); get flip(): boolean; set flip(flip: boolean); dispose(): void; /** * Sets the cross section plane based on the given curve mesh and point. * * @param point - The point on the curve mesh where the cross section should be created. * @param normal - The normal of the plane. * * @throws Will throw an error if the world or plane is not set before calling this method. * @throws Will throw an error if the geometry is not indexed. * * @returns {Promise} */ set(point: THREE.Vector3, normal: THREE.Vector3): Promise; update(): Promise; private generateModelSection; private clearMeshes; } export declare enum CivilMarkerType { SELECT = "select", HOVER = "hover" } declare class CivilNavigator implements OBC.Disposable { /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; alignments: THREE.Group[]; components: OBC.Components; /** * Event triggered when a marker (point) on a curve changes. * Provides information about the alignment, percentage, type of marker, and the curve. */ readonly onMarkerChange: OBC.Event<{ alignment: THREE.Group; curve: THREE.Line; point: THREE.Vector3; normal: THREE.Vector3; }>; /** {@link OBC.Component.enabled} */ enabled: boolean; highlightMaterial: LineMaterial; increments: number; screenDistanceLimit: number; fadeInTime: number; private _mouseMarkers?; private _highlighted; private _stationPoints; private readonly _originalHighlightMaterialId; private _world; private _raycaster; private _stationLabelColor; private _stationLabelBackgroundColor; private _stationPointerColor; private _stationPointerBackgroundColor; /** * Getter for the world property. * Returns the current world instance. * @returns {OBC.World | null} The current world instance or null if not set. */ get world(): OBC.World | null; /** * Setter for the world property. * Sets the world instance and initializes the component. * @param {OBC.World | null} world - The new world instance or null to clear the current world. */ set world(world: OBC.World | null); get stationLabelColor(): THREE.Color; set stationLabelColor(color: THREE.Color); get stationLabelBackgroundColor(): THREE.Color; set stationLabelBackgroundColor(color: THREE.Color); get stationPointerColor(): THREE.Color; set stationPointerColor(color: THREE.Color); get stationPointerBackgroundColor(): THREE.Color; set stationPointerBackgroundColor(color: THREE.Color); constructor(components: OBC.Components, highlightMaterial: LineMaterial); dispose(): void; updateAlignments(): void; setMarkerAtPoint(point: CivilPoint, type: "select" | "hover"): void; highlight(alignment: THREE.Group, removePrevious?: boolean): void; clearHighlight(alignments?: Iterable>): void; createStations(alignment: THREE.Group): void; clearStations(ids?: Iterable): void; updateStations(): void; getCursorValue(): string; setCursorValue(value: string, type: "select" | "hover"): void; private isLabelClipped; private clearLabels; private newCivilLabel; private setupEvents; private _pointerDown; private _pointerDownTime; private onPointerDown; private onPointerUp; private onMouseMove; private setMarkerToMouse; private updateMarkerValue; private getFormattedStation; private getLabel; private getPoint; } /** * This component provides functionality for navigating and interacting with civil engineering data in a 3D environment. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/CivilNavigators). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/CivilNavigators). * */ export declare class CivilNavigators extends OBC.Component implements OBC.Disposable { /** * A unique identifier for the component. * This UUID is used to register the component within the Components system. */ static readonly uuid: "0a59c09e-2b49-474a-9320-99f51f40f182"; /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; list: Map; /** {@link OBC.Component.enabled} */ enabled: boolean; highlightMaterial: LineMaterial; private _increments; private _screenDistanceLimit; private _fadeInTime; private _stationLabelColor; private _stationLabelBackgroundColor; private _stationPointerColor; private _stationPointerBackgroundColor; get increments(): number; set increments(value: number); get screenDistanceLimit(): number; set screenDistanceLimit(value: number); get fadeInTime(): number; set fadeInTime(value: number); get stationLabelColor(): THREE.Color; set stationLabelColor(color: THREE.Color); get stationLabelBackgroundColor(): THREE.Color; set stationLabelBackgroundColor(color: THREE.Color); get stationPointerColor(): THREE.Color; set stationPointerColor(color: THREE.Color); get stationPointerBackgroundColor(): THREE.Color; set stationPointerBackgroundColor(color: THREE.Color); constructor(components: OBC.Components); create(id: string): CivilNavigator; delete(id: string): void; dispose(): void; updateAlignments(): void; } export declare interface CivilPoint { point: THREE.Vector3; normal: THREE.Vector3; curve: THREE.Line; alignment: THREE.Group; } /** * This component provides functionality for navigating and interacting with civil engineering data in a 3D environment. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/CivilNavigators). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/CivilRaycaster). * */ export declare class CivilRaycaster { alignments: THREE.Group[]; /** {@link OBC.Component.enabled} */ enabled: boolean; world: OBC.World | null; private _raycastable; private _components; constructor(components: OBC.Components); update(): void; dispose(): void; castRay(): CivilPoint | null; } export declare class CivilUtils { static alignmentPercentageToPoint(alignment: THREE.Group, percentage: number): CivilPoint | null; static curvePercentageToPoint(alignment: THREE.Group, curve: THREE.Object3D, percentage: number): CivilPoint | null; static alignmentLength(alignment: THREE.Group): any; static curveLength(curve: THREE.Object3D): any; static curvePointToAlignmentPercentage(alignment: THREE.Group, point: THREE.Vector3, targetCurve: THREE.Object3D): number | null; static isPointbetweenTwoOthers(pA: THREE.Vector3, pB: THREE.Vector3, pToCheck: THREE.Vector3): boolean; } /** * The `ClipEdges` class is responsible for managing and rendering clipped edges and fills in a ThreeJS scene based on specified styles and models. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/ClipStyler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/ClipEdges). */ export declare class ClipEdges implements OBC.Disposable { private _components; private _modelStyleGeometries; /** * Detach functions for any Clipper plane add/remove listeners we * registered. Populated when local-clipping mode is on, so the * per-material `clippingPlanes` lists stay in sync with the live * Clipper state. Cleared on `dispose`. */ private _clipperUnlisten; readonly onDisposed: OBC.Event; /** * The ThreeJS group that holds all the edges and fills together */ readonly three: THREE.Group; /** * A readonly property representing the ThreeJS plane used to created the edges and fills. */ readonly plane: THREE.Plane; readonly items: DataMap; /** * The world in which the edges and fills will be placed. */ world: OBC.World | null; private _visible; /** * Sets the visibility of the object in the scene. * When set to `true`, the object is added to the scene if the `world` property is defined. * When set to `false`, the object is removed from its parent. */ set visible(value: boolean); get visible(): boolean; constructor(components: OBC.Components, plane: THREE.Plane); private setupEvents; /** * Recomputes each section mesh's `material.clippingPlanes` to * `(all clipper planes) - (this.plane)`. Cheap (a couple of array * pushes per material); called whenever the Clipper plane list * changes so existing sections stay in sync. */ private refreshClippingPlanes; private getStyleMeshes; private updateMeshes; private create; /** * Updates the clip edges based on the provided groups and their associated styles and data. * If no groups are specified, all items will be updated. * * @param groups - An optional array of group names to filter which items should be updated. * @returns A promise that resolves when the update process is complete. */ update(groups?: string[]): Promise; /** {@link OBC.Disposable.dispose} */ dispose(): void; } /** * Configuration for creating ClipEdges. */ export declare interface ClipEdgesCreationConfig { /** * If true, updates the ClipEdges based on the plane update. */ link?: boolean; /** * The unique name of the ClipEdges. */ id?: string; /** * The world in which the ClipEdges are going to be added. */ world?: OBC.World; /** * A record of groups from the classifier to style based on the style name set. */ items?: Record; } /** * Represents the style configuration for clip edges items. */ export declare interface ClipEdgesItemStyle { /** * The name of the style from the ClipStyler to apply. */ style: string; /** * Optional classifier intersection input. If not set, all items cut will be styled. */ data?: OBC.ClassifierIntersectionInput; } /** * Represents the style configuration for clipping edges, including materials for lines and fills. */ export declare interface ClipStyle { linesMaterial?: LineMaterial; fillsMaterial?: THREE.Material; } /** * A component that can style Clipping Planes by adding edges and fills. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/ClipStyler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/ClipStyler). */ export declare class ClipStyler extends OBC.Component implements OBC.Disposable { /** * A unique identifier for the component. * This UUID is used to register the component within the Components system. */ static readonly uuid: "24dfc306-a3c4-410f-8071-babc4afa5e4d"; /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; /** {@link OBC.Component.enabled} */ enabled: boolean; /** * Represents the current world instance used by the ClipStyler. * This can be an instance of `OBC.World` or `null` if no world is set. * You can still specify other world during the ClipEdges creation. */ world: OBC.World | null; readonly styles: FRAGS.DataMap; readonly list: FRAGS.DataMap; private _visible; /** * Gets the visibility state of the edges. */ get visible(): boolean; /** * Sets the visibility state of the edges. * @param {boolean} active - The new visibility state. */ set visible(active: boolean); constructor(components: OBC.Components); private setEvents; private setEdgesConfig; /** * Creates a new instance of `ClipEdges` using the specified plane and optional configuration. * * @param plane - The `THREE.Plane` object used to define the clipping plane. * @param config - Optional configuration for the edges creation. * @returns A new instance of `ClipEdges` initialized with the specified plane and configuration. * @remarks The given plane won't be copied during the ClipEdges creation. */ create(plane: THREE.Plane, config?: ClipEdgesCreationConfig): ClipEdges; /** * Creates and configures clip edges from a given view. * * This method generates clip edges based on the provided view's plane and optional configuration. * If the `link` option in the configuration is enabled (default is `true`), the clip edges are * dynamically linked to the view's lifecycle events, ensuring proper disposal, updates, and visibility * synchronization with the view's state. * * @param view - The view object from which the clip edges are created. * @param config - Optional configuration for clip edge creation. * @returns The created clip edges object, configured and optionally linked to the view's lifecycle. */ createFromView(view: OBC.View, config?: ClipEdgesCreationConfig): ClipEdges; /** * Creates and returns styled edges from a clipping plane identified by its ID. * Optionally, a configuration object can be provided to customize the creation process. * * @param id - The unique identifier of the clipping plane to create edges from. * @param config - Optional configuration for edge creation, including visibility and linking behavior. * * @returns The created edges styled from the clipping plane. * * @remarks * - If `config.link` is `true` (default), the edges will automatically update when the clipping plane's dragging ends * and will be disposed of when the clipping plane is disposed. */ createFromClipping(id: string, config?: ClipEdgesCreationConfig): ClipEdges; /** {@link OBC.Disposable.dispose} */ dispose(): void; } /** * Interface representing the data required to create a dimension line. */ export declare interface DimensionData { /** * The 3D line representing the dimension. */ line: Line; startNormal?: THREE.Vector3; endNormal?: THREE.Vector3; /** * The material to be used for the line of the dimension. */ lineMaterial: THREE.LineBasicMaterial; /** * The HTML element to be used as the endpoint marker for the dimension line. */ endpointElement: HTMLElement; } /** * A class representing a simple dimension line in a 3D space. */ export declare class DimensionLine { /** * The label for the dimension line. */ label: Mark; /** * The bounding box for the dimension line. */ boundingBox: THREE.Mesh, THREE.Material | THREE.Material[], THREE.Object3DEventMap>; /** * The world in which the dimension line exists. */ world: OBC.World; private _components; private _units; /** * The units used for the dimension line. */ set units(value: "mm" | "cm" | "m" | "km"); get units(): "mm" | "cm" | "m" | "km"; /** * The number of decimals to show in the label. */ private _rounding; set rounding(value: number); get rounding(): number; startNormal: THREE.Vector3 | null; readonly line: Line; readonly rectangleComponentLines: Line[]; readonly projectionComponentLines: Line[]; private _visible; private readonly _root; private _endpoints; readonly lineElement: THREE.Line; readonly rectangleDimensions: DataSet; readonly projectionDimensions: DataSet; /** * Updates the dimension line's appearance based on its state. * @param {boolean} isSelected - Whether the dimension line is selected. */ isSelected: boolean; /** * Getter for the visibility of the dimension line. */ get visible(): boolean; /** * Setter for the visibility of the dimension line. * @param {boolean} value - The new visibility state. */ set visible(value: boolean); /** * Setter for the end point of the dimension line. * Updates the line geometry and position of the end point marker. * @param {THREE.Vector3} point - The new end point. */ set end(point: THREE.Vector3); /** * Setter for the start point of the dimension line. * Updates the line geometry and position of the start point marker. * @param {THREE.Vector3} point - The new start point. */ set start(point: THREE.Vector3); constructor(components: OBC.Components, world: OBC.World, data: DimensionData, rounding?: number, // Default rounding precision units?: "mm" | "cm" | "m" | "km"); applyPlanesVisibility(planes: THREE.Plane[]): void; private setupEvents; /** * Disposes of the dimension line and its associated resources. * This method should be called when the dimension line is no longer needed. * It removes the dimension line from the world, destroys its components, and frees up memory. */ dispose(): void; /** * Creates a bounding box for the dimension line. * The bounding box is a 3D box that encloses the dimension line. * It is used for collision detection and visibility culling. * The bounding box is initially invisible and can be toggled using the `toggleBoundingBox` method. */ createBoundingBox(): void; private _latestRectangularInversion; invertRectangularDimensions(): void; displayRectangularDimensions(): void; displayProjectionDimensions(): void; private _endpointElement; set endpointElement(value: HTMLElement); get endpointElement(): HTMLElement; private createEndpoints; private updateProjectionComponents; private updateRectangleComponents; updateLabel(): void; private updateGeometry; update(): void; private _material; set material(value: THREE.LineBasicMaterial); get material(): THREE.LineBasicMaterial; private _componentsMaterial; private createLine; private newText; valueFormatter: ((value: number) => string) | null; private getTextContent; set color(color: THREE.Color); } /** 2-D distance between two Vector3s on the XZ plane (ignores Y). */ export declare function dist2D(a: THREE.Vector3, b: THREE.Vector3): number; /** * Alias exposed on {@link DrawingEditor.cursor} — same shape as {@link DrawingPointerEvent}. */ export declare type DrawingCursor = DrawingPointerEvent; /** Front component that centralises all interaction for {@link OBC.TechnicalDrawing}. */ export declare class DrawingEditor extends OBC.Component { static readonly uuid: "b3e5c7a9-1f2d-4e8b-9c0a-5d7f3b1e2c4a"; enabled: boolean; /** Manages font loading and text mesh creation for all built-in tools. */ readonly fonts: FontManager; /** Last known drawing-local cursor state, updated on every mousemove on the active source. */ cursor: DrawingCursor; readonly onDrawingMouseMove: OBC.Event; /** Fires when {@link activeDrawing} is set to a new drawing. */ readonly onActiveDrawingChange: OBC.Event; /** Fires whenever the multi-selection set changes (item added, removed, or cleared). */ readonly onMultiSelectionChange: OBC.Event; /** Fires with the name of the property that changed (`"activeDrawing"` or `"activeTool"`). */ readonly onStateChanged: OBC.Event<("activeDrawing" | "activeTool")[]>; private _drawing; private _activeTool; private _activeToolClass; /** Tool singleton instances keyed by tool class constructor. */ private readonly _toolInstances; /** The currently active interaction source, if any. */ private _activeSource; private _nullModeTool; private readonly _multiSel; private _multiDragOrigin; private readonly _raycaster; private readonly _drawingPlane; private _snapMarker; private _snapMarkerMat; private _hoverHighlight; private _hoverHighlightMat; private readonly _onMouseMove; private readonly _onMouseLeave; /** * Responsibilities: * - **Coordinate pipeline** — converts mousemove to drawing-local space + snap internally. * - **Tool routing** — forwards pointer move and click events to the active {@link DrawingTool}. * - **Labels** — creates and positions text meshes for all built-in systems. * - **Snap / hover visuals** — snap marker and hover highlight managed internally. * * ```ts * const editor = components.get(DrawingEditor); * await editor.fonts.load("https://thatopen.github.io/engine_components/resources/fonts/PlusJakartaSans-Medium.ttf"); * * editor.activeDrawing = drawing; * editor.setSource(world); * * editor.activeTool = LinearAnnotationsTool; * const dimTool = editor.use(LinearAnnotationsTool); * * canvas.addEventListener("click", () => editor.step()); * document.addEventListener("keydown", (e) => { if (e.key === "Escape") editor.cancel(); }); * ``` */ constructor(components: OBC.Components); /** The currently active drawing, or null if none has been set. */ get activeDrawing(): OBC.TechnicalDrawing | null; /** * Sets the active drawing and notifies all known tools via {@link DrawingTool.onDrawingChange}. * The active tool is deactivated first (cancelling any in-progress placement), then * all tools receive the new drawing, and the active tool is reactivated. * * ```ts * editor.activeDrawing = drawing; * ``` */ set activeDrawing(drawing: OBC.TechnicalDrawing | null); /** * Registers an interaction source for the editor. * * - Pass an {@link OBC.World} to use the world renderer's canvas (3D source). * The previous world source, if any, is automatically removed first. * - Pass an `HTMLElement` + a {@link OBC.DrawingViewport} to register a * paper-space viewport element as a source. * * ```ts * editor.setSource(world); // 3D canvas * editor.setSource(vpEl, drawing.viewports.get(id)); // paper-space * ``` */ setSource(source: OBC.World | HTMLElement, viewport?: OBC.DrawingViewport): void; /** * Removes a previously registered source element, stopping all mouse * tracking on it. Call this when leaving paper-space edit mode. */ clearSource(canvas: HTMLElement): void; /** * Sets the active pointer tool by tool class. * Pass `null` to deactivate all tools. * * ```ts * editor.activeTool = LinearAnnotationsTool; * ``` */ set activeTool(ToolClass: ToolConstructor | null); /** * Returns the singleton tool instance for the given class, creating it if needed. * Mirrors the `TechnicalDrawings.use()` pattern. * * ```ts * const dimTool = editor.use(LinearAnnotationsTool); * dimTool.system.styles.set("thick", { ... }); * ``` */ use(ToolClass: new (...args: any[]) => T): T; /** * Returns the system instance for the active drawing. * Use this for system-level operations (styles, list, clear, update, events). * * ```ts * const dims = editor.system(OBC.LinearAnnotations); * dims.styles.set("bold", { ... }); * ``` */ system>(SystemClass: new (components: OBC.Components) => T): T; /** * Triggers the primary click action on the active tool at the current cursor position. * Replaces per-tool click wiring in the consumer: * * ```ts * canvas.addEventListener("click", () => editor.step()); * ``` */ step(): void; /** * Cancels any in-progress operation on the active tool and restores original state. */ cancel(): void; /** * Deletes the currently selected annotation on the active tool, if any. */ delete(): void; /** Hides snap marker and hover highlight. */ clearHover(): void; /** Total number of items currently multi-selected across all tools. */ get multiSelCount(): number; /** True when all selected tools support free translation (and at least one item is selected). */ get isMultiTranslatable(): boolean; /** True when a multi-drag is currently in progress. */ get isMultiDragging(): boolean; /** * Attempts to pick any annotation from registered tools at the given ray. * Returns the first match `{ tool, uuid }`, or null if nothing is hit. */ pickAny(ray: THREE.Ray): { tool: DrawingTool; uuid: string; } | null; /** * Adds or removes an item from the multi-selection. * Only translatable tools can be added — non-translatable hits are silently ignored. */ toggleMultiSelect(tool: DrawingTool, uuid: string): void; /** Removes all items from the multi-selection and restores their original materials. */ clearMultiSelect(): void; /** Deletes all multi-selected items from their respective systems. */ deleteMultiSelected(): void; /** Starts a group translation drag. `origin` — drawing-local point where the drag started. */ beginMultiDrag(origin: THREE.Vector3): void; /** Updates the group translation drag. `point` is the current drawing-local cursor position. */ updateMultiDrag(point: THREE.Vector3): void; /** Commits the current group translation. */ endMultiDrag(): void; /** Cancels the current group translation and restores original positions. */ cancelMultiDrag(): void; private _nullModeClick; private _createOrGetTool; private _computePointerEvent; private _getDrawingLocalPoint; private _resolveSnap; private _createVisuals; private _removeVisuals; private _updateSnapMarker; } /** A processed pointer event in drawing local space. */ export declare interface DrawingPointerEvent { /** Drawing-local position — snapped if a snap candidate was found. */ point: THREE.Vector3; /** Snap result, or null if no geometry was under the cursor. */ snap: SnapResult | null; /** World-space ray — needed for pick() / pickHandle() calls. */ ray: THREE.Ray; } /** Base class for all drawing tools. */ export declare abstract class DrawingTool { protected readonly _components: Components; /** * Provides built-in selection tracking: stores original materials, applies a * highlight on selection, and restores them on deselect or geometry rebuild. * Subclasses call `_applySelection(group)`, `_restoreSelection()`, and * `_disposeSelection()` — they do not manage the underlying material state directly. * * Lifecycle: * - **Label subscription** (`attachToDrawing` / `detachFromDrawing`): always active. * - **Pointer routing** (`onActivate` / `onDeactivate` / `onPointerMove`): only the active tool. */ constructor(components: Components); /** Named placement strategies for this tool. Keyed by mode name. */ readonly modes: DataMap_2>; /** Key of the currently active placement mode. Defaults to `"default"`. */ activeMode: string; /** Register a named placement mode. */ registerMode(key: string, mode: PlacementMode): void; /** Switch the active placement mode. No-op if the key is not registered. */ setMode(key: string): void; protected readonly _selectionLineMat: THREE.LineBasicMaterial; protected readonly _selectionMeshMat: THREE.MeshBasicMaterial; private _selectedGroup; protected _selectedUuid: string | null; /** UUID of the currently selected annotation, or null if none is selected. */ get selectedUuid(): string | null; /** True when the cursor is hovering over a handle of the selected annotation. */ get isHandleHovered(): boolean; /** * Called by {@link DrawingEditor} whenever the active drawing changes. * Tools should re-subscribe to drawing-specific state (labels, existing * annotations) and store `drawing` / `fonts` for later use. * Passing `null` for both signals that no drawing is currently active. */ onDrawingChange(_drawing: TechnicalDrawing | null, _fonts: FontManager | null): void; /** Called when this tool becomes the active pointer tool. */ abstract onActivate(): void; /** * Called when this tool is no longer the active pointer tool. * Must restore any in-progress drag/placement to a clean state. */ abstract onDeactivate(): void; /** Called every mousemove on the active source — used for live drag feedback. */ abstract onPointerMove(e: DrawingPointerEvent): void; abstract dispose(): void; /** * Returns true when no placement or edit drag is in progress. * Override in subclasses to also check tool-specific edit state. */ get isIdle(): boolean; /** * Cancels any in-progress placement or drag, then deselects. * Override `_onCancel` in subclasses for tool-specific revert logic. */ cancel(): void; /** Called by `cancel()` before deselecting. Override to revert in-progress drags and clear previews. */ protected _onCancel(): void; /** * Selects the annotation with the given uuid without going through placement. * Used by {@link DrawingEditor} in null-mode pick. No-op by default; override in * tools that support single selection. */ select(uuid: string): void; deselect(): void; /** * Called by {@link DrawingEditor.step} — the primary click action at the * current cursor position. No-op by default; override to handle placement. */ onPointerClick(_e: DrawingPointerEvent): void; /** * Delete the currently selected annotation (if any). * No-op by default; override in tools that support selection. */ delete(): void; /** * Traverses `group`, saves each object's original material in `userData._selOrigMat`, * and applies the selection highlight. Hit planes are skipped. * Call from the tool's select/reselect logic. */ protected _applySelection(group: THREE.Group): void; /** * Restores all original materials saved by `_applySelection` and clears tracking. * Call from deselect logic. */ protected _restoreSelection(): void; /** * Clears selection tracking state without restoring materials. * Use in `_onUpdate` before reapplying selection so that materials already * updated by a system redraw are preserved as the new "original" state. */ protected _clearSelectionState(): void; /** Disposes selection and multi-highlight materials. Call from the tool's `dispose()`. */ protected _disposeSelection(): void; /** * Returns `true` when the label for `uuid` must be recreated — i.e. when the * text content, color, or font size has changed since the last render. * Call at the top of each tool's `_updateLabel` before deciding to recreate * or just reposition. */ protected _labelNeedsRecreation(uuid: string, newText: string, style: { color: number; fontSize: number; }): boolean; /** * Raycasts against label hit planes in `_labelGroups`. * Returns the uuid of the closest hit, or null if none. */ protected _pickLabelUuid(ray: THREE.Ray): string | null; /** * Removes any tool-created label group (THREE.Group with userData.isDimension) * from `container` and disposes its text geometry. * Call from `_createLabel` before adding a new label to avoid duplicates. */ protected _removeExistingLabel(container: THREE.Object3D): void; protected static readonly HANDLE_RADIUS = 0.055; protected static readonly HANDLE_SEGMENTS = 16; protected readonly _handleMat: THREE.MeshBasicMaterial; protected readonly _handleHoverMat: THREE.MeshBasicMaterial; protected readonly _handleObjects: THREE.Mesh[]; protected _hoveredHandleIdx: number | null; /** * Returns the drawing-local positions for this tool's handles for the given uuid. * Override in subclasses that support selection handles. */ protected _getHandlePositions(_uuid: string): THREE.Vector3[]; /** * Creates a single handle mesh for the given index. * Override in subclasses to return custom geometry or material per handle. * The default implementation creates a blue filled circle. */ protected _buildHandle(_idx: number): THREE.Mesh; /** * Creates one handle per position returned by `_getHandlePositions` * and adds them to `container`. Shape and material come from `_buildHandle`. */ protected _createHandles(uuid: string, container: THREE.Object3D): void; /** Updates handle positions in-place after the underlying annotation changes. */ protected _refreshHandles(uuid: string): void; /** Removes all handle meshes from the scene and clears tracking. */ protected _clearHandles(): void; /** Swaps handle material to highlight the hovered one. */ protected _setHoveredHandle(idx: number | null): void; /** Clears handles and disposes handle materials. Call from the tool's `dispose()`. */ protected _disposeHandles(): void; /** Active drawing this tool is attached to, or null if none. */ protected _drawing: TechnicalDrawing | null; /** Font manager for text label rendering, or null if none. */ protected _fonts: FontManager | null; /** Tracks label groups by annotation uuid for cleanup and picking. */ protected readonly _labelGroups: Map>; /** Returns the uuid of the annotation under `ray` using the tool's system. Implement as `return this.system.pick(ray)`. */ protected abstract _systemPick(ray: THREE.Ray): string | null; /** Deletes the given uuids from the tool's system. Implement as `this.system.delete(drawing, uuids)`. */ protected abstract _systemDelete(drawing: TechnicalDrawing, uuids: string[]): void; /** * Selects the annotation with the given uuid. * Cancels any in-progress placement, applies the selection highlight, * creates handles, then calls `_onSelect` so the tool can set its edit state. */ protected _select(uuid: string): void; /** Called by `_select()`. Override to set tool-specific edit state. */ protected _onSelect(_uuid: string): void; /** Applies the selection highlight to the annotation group for the given uuid. */ protected _applySelectionMaterial(uuid: string): void; /** Resets pick-state to idle. Override `_onDeselect` to also reset edit state. */ protected _deselect(): void; /** Called by `_deselect()`. Override to reset tool-specific edit state. */ protected _onDeselect(): void; /** * Handles annotation deletion: disposes label geometry, removes from * `_labelGroups`, and deselects if the deleted uuid was selected. * Pass as the callback to `system.onDelete`. */ protected _handleDelete(uuids: string[]): void; /** * When true, this tool supports free-form translation via * `translateStart` / `translateUpdate` / `translateEnd` / `translateCancel`. * LinearAnnotations and AngleAnnotations leave this false because they * reference specific geometry lines and cannot be freely repositioned. */ readonly translatable: boolean; /** Returns the uuid of the annotation under the given ray, or null if none. */ pick(ray: THREE.Ray): string | null; /** Applies multi-selection highlight colour (0x44aaff) to the given uuids. */ highlightItems(uuids: string[]): void; unhighlightItems(uuids: string[]): void; deleteItems(uuids: string[]): void; /** * Begins a group translation drag. * `uuids` — the items to move. `origin` — drawing-local grab point. */ translateStart(_uuids: string[], _origin: THREE.Vector3): void; /** Updates the group translation drag. `point` is the current drawing-local cursor. */ translateUpdate(_point: THREE.Vector3): void; /** Commits the current group translation. */ translateEnd(): void; /** Cancels the current group translation and restores original positions. */ translateCancel(): void; protected readonly _multiHighlightLineMat: THREE.LineBasicMaterial; protected readonly _multiHighlightMeshMat: THREE.MeshBasicMaterial; private readonly _multiHighlighted; /** Applies multi-highlight to the given group, saving original materials in userData. */ protected _applyMultiHighlight(uuid: string, group: THREE.Group): void; /** Restores original materials for a specific multi-highlighted uuid. */ protected _restoreMultiHighlight(uuid: string): void; /** * Re-applies multi-highlight to `group` if `uuid` is currently multi-highlighted. * Call from `_onUpdate` handlers in tools whose systems reset materials on redraw. */ protected _reapplyMultiHighlight(uuid: string, group: THREE.Group): void; } declare class EdgeDetectionPass extends Pass { private _edgeMaterial; private _combineMaterial; private _fsQuad; private _edgeRenderTarget; private _vertexColorRenderTarget; private _fragments; private _renderer; private _overrideMaterial; private _depthBiasStrength; private _mode; /** * When enabled, invisible materials still produce edges, * giving an X-ray effect where hidden geometry is shown as outlines. */ xray: boolean; get mode(): EdgeDetectionPassMode; set mode(value: EdgeDetectionPassMode); get width(): number; set width(value: number); get color(): THREE.Color; set color(value: THREE.Color); get depthBiasStrength(): number; set depthBiasStrength(value: number); constructor(renderer: OBC.BaseRenderer, fragments: OBC.FragmentsManager, width?: number); setSize(width: number, height: number): void; setWidth(width: number): void; render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget): void; dispose(): void; private setMaterialToMesh; } /** * The mode of the edge detection pass. */ export declare enum EdgeDetectionPassMode { /** * Looks good, including LODs, but less performant. */ DEFAULT = 0, /** * Doesn't include LODs, but much more performant. */ GLOBAL = 1 } declare type EditState = { kind: "idle"; } | { kind: "selected"; uuid: string; } | { kind: "dragging"; uuid: string; originalPosition: THREE.Vector3; dragStart: THREE.Vector3; }; declare type EditState_2 = { kind: "idle"; } | { kind: "selected"; uuid: string; } | { kind: "draggingPosition"; uuid: string; original: THREE.Vector3; } | { kind: "draggingRotation"; uuid: string; center: THREE.Vector3; originalRotation: number; } | { kind: "draggingScale"; uuid: string; center: THREE.Vector3; originalScale: number; }; declare class ExcludedObjectsPass extends Pass { materialToExclude: THREE.MeshBasicMaterial; private _excludedMaterials; private _originalMaterials; private _renderer; private _world; private _fsQuad; private _combineMaterial; private _excludedRenderTarget; constructor(renderer: OBC.BaseRenderer, world: OBC.World); /** * Add materials to be excluded from postproduction */ addExcludedMaterial(material: THREE.Material): void; /** * Remove materials from the excluded list */ removeExcludedMaterial(material: THREE.Material): void; /** * Clear all excluded materials */ clearExcludedMaterials(): void; /** * Get the list of excluded materials */ get excludedMaterials(): THREE.Material[]; setSize(width: number, height: number): void; render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget): void; private _substituteMaterials; private _restoreMaterials; dispose(): void; } /** Manages font loading and creates Three.js text meshes for annotation labels. */ export declare class FontManager { font: Font | null; /** * Owned by {@link DrawingEditor} and shared across all built-in tools. */ constructor(); load(url: string): Promise; /** * Creates a text mesh in the XZ plane (rotation.x = -π/2). * Returns null if the font is not yet loaded. */ createTextMesh(text: string, fontSize: number, color: number, opacity?: number): THREE.Mesh | null; getBBox(mesh: THREE.Mesh): THREE.Box3; } /** * A postprocessing pass that applies a gloss effect to the rendered scene. The gloss effect makes surfaces appear more reflective based on their angle relative to the camera view. */ export declare class GlossPass extends Pass { resolution: THREE.Vector2; renderScene: THREE.Scene; renderCamera: THREE.Camera; fsQuad: FullScreenQuad; glossOverrideMaterial: THREE.ShaderMaterial; glossBuffer: THREE.WebGLRenderTarget; private _glossEnabled; get glossEnabled(): boolean; set glossEnabled(active: boolean); get minGloss(): number; set minGloss(value: number); get maxGloss(): number; set maxGloss(value: number); get glossExponent(): number; set glossExponent(value: number); get fresnelExponent(): number; set fresnelExponent(value: number); get glossFactor(): number; set glossFactor(value: number); get fresnelFactor(): number; set fresnelFactor(value: number); constructor(resolution: THREE.Vector2, world: OBC.World); dispose(): void; setSize(width: number, height: number): void; render(renderer: THREE.WebGLRenderer, writeBuffer: any, readBuffer: any): void; get vertexShader(): string; get fragmentShader(): string; createGlossMaterial(): THREE.ShaderMaterial; private newRenderTarget; } /** * A class to provide a graphical marker for picking vertices in a 3D scene. */ export declare class GraphicVertexPicker implements OBC.Disposable { /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; /** The marker used to indicate the picked vertex. */ marker: Mark | null; private _world; set world(value: OBC.World | null); get world(): OBC.World | null; /** * Pointermove handler that drives cursor-tracking. Stored on the * instance so we can detach when the world changes. */ private _pointerMoveHandler; /** * @deprecated Sync mode is gone; this property has no effect and * is retained only to avoid breaking existing setters. Both * values route through the same fast async pick. */ mode: GraphicVertexPickerMode; maxDistance: number; private _pickerSize; get pickerSize(): number; set pickerSize(value: number); private _enabled; set enabled(value: boolean); get enabled(): boolean; private _components; static baseSnappingStyle: Partial; static snappingStyles: Record>; constructor(components: OBC.Components); /** {@link OBC.Disposable.onDisposed} */ dispose(): void; /** * Retrieves the picked vertex from the world and updates the * marker's position. If no vertex is picked, the marker is hidden. * * @param config - optional world override and snap classes * @returns the pick result (matches `castRay`'s shape) or `null` * if nothing was hit. */ get(config?: { world?: OBC.World; snappingClasses?: FRAGS.SnappingClass[]; }): Promise> | null>; private applyMarkerSize; /** * Pixels of cursor motion the user must travel before the marker * leaves the snap point and resumes cursor-tracking. Without this, * the very next pointermove after a successful snap would yank * the marker back to the cursor and the snap would be invisible. * Tuned for "the user can see they snapped, but a real intentional * move breaks it". */ stickyRadiusPx: number; /** Most recent cursor in NDC. Used to project the marker to the * cursor's screen position between picks. */ private _lastNdc; /** Most recent cursor in viewport client pixels — anchors the * snap-sticky window in screen units. */ private _lastClient; private _ndcWorld; private _cursorRafScheduled; /** * Cursor client-pixel coords at the moment of the most recent * snap. While set, the pointermove handler holds the marker at the * snap point until the cursor leaves a radius of * {@link stickyRadiusPx} around this position. Cleared on a * no-snap pick. */ private _snapStickyClient; private attachCursorTracking; private detachCursorTracking; /** * Project the latest cursor NDC to a world-space point on a plane * perpendicular to the camera's forward direction at z = 0.5 in * NDC, then copy it into the marker. The CSS2DRenderer projects * that point back to roughly the same screen location, so the * marker visually tracks the mouse. The exact distance from the * camera is irrelevant for screen position because the projection * is invariant under that scaling. */ private syncMarkerToCursor; } /** * @deprecated Sync mode is gone — picks are fast enough through the * unified GPU-pick / SnapResolver path that the synchronous-three.js- * meshes workaround is no longer needed. The enum is kept for type * compatibility with existing imports; both values now resolve to * the same fast path. */ export declare enum GraphicVertexPickerMode { DEFAULT = 0, SYNCHRONOUS = 1 } /** * This component allows highlighting and selecting fragments in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/Highlighter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/Highlighter). */ export declare class Highlighter extends OBC.Component implements OBC.Disposable, OBC.Eventable { /** * A unique identifier for the component. * This UUID is used to register the component within the Components system. */ static readonly uuid: "cb8a76f2-654a-4b50-80c6-66fd83cafd77"; /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; /** {@link OBC.Updateable.onBeforeUpdate} */ readonly onBeforeUpdate: OBC.Event; /** {@link OBC.Updateable.onAfterUpdate} */ readonly onAfterUpdate: OBC.Event; /** Event triggered when the Highlighter is setup. */ readonly onSetup: OBC.Event; /** Indicates whether the Highlighter is setup. */ isSetup: boolean; /** {@link OBC.Component.enabled} */ enabled: boolean; /** Stores the events triggered by the Highlighter. */ events: HighlightEvents; /** Determines the multiple selection behavior. */ multiple: "none" | "shiftKey" | "ctrlKey"; /** Zoom factor applied when zooming to selection. */ zoomFactor: number; /** Indicates whether to zoom to the selection when highlighting. */ zoomToSelection: boolean; /** Stores the backup color before selection. */ backupColor: THREE.Color | null; /** Stores the current selection. */ selection: { [selectionID: string]: OBC.ModelIdMap; }; /** Stores the configuration options for the Highlighter. */ config: Required; /** Stores the styles used for highlighting selections. If null, the highlighter won't color geometries (useful for selection without coloring). */ readonly styles: DataMap | null>; /** Styles with auto toggle will be unselected when selected twice. */ autoToggle: Set; /** Position of the mouse on mouseDown. */ private mouseDownPosition; /** Threshhold on how much the mouse have to move until its considered movement */ mouseMoveThreshold: number; /** If defined, only the specified elements will be selected by the specified style. */ selectable: { [name: string]: OBC.ModelIdMap; }; /** Manager to easily toggle and reset all events. */ eventManager: OBC.EventManager; private _mouseState; constructor(components: OBC.Components); private setStyleEvents; /** {@link Disposable.dispose} */ dispose(): Promise; /** * Adds a new selection with the given name and color. * Throws an error if a selection with the same name already exists. * * @param name - The name of the new selection. * @param color - The color to be used for highlighting the selection. * * @throws Will throw an error if a selection with the same name already exists. * @deprecated Use highlighter.styles.set() instead */ add(style: FRAGS.MaterialDefinition & { customId: string; }): void; add(customId: string): void; /** * Removes the specified selection. * * @param name - The name of the new selection. * @deprecated use highlighter.styles.delete */ remove(name: string): Promise; /** * Highlights a fragment based on a raycast from the mouse position. * * @param name - The name of the selection. * @param removePrevious - Whether to remove previous highlights. * @param zoomToSelection - Whether to zoom to the highlighted selection. * @param exclude - Fragments to exclude from the highlight. * * @returns The highlighted fragment and its ID, or null if no fragment was highlighted. * * @throws Will throw an error if the world or a required component is not found. * @throws Will throw an error if the selection does not exist. * @throws Will throw an error if the fragment or its geometry is not found. * @throws Will throw an error if the item ID is not found. * @throws Will throw an error if the fragment does not belong to a FragmentsGroup. */ highlight(name: string, removePrevious?: boolean, zoomToSelection?: boolean, exclude?: OBC.ModelIdMap | null): Promise; private _fromHighlight; /** * Highlights a fragment based on a given fragment ID map. * * @param name - The name of the selection. * @param modelIdMap - The fragment ID map to highlight. * @param removePrevious - Whether to remove previous highlights. * @param zoomToSelection - Whether to zoom to the highlighted selection. * @param exclude - Fragments to exclude from the highlight. * @param fillMesh - The fill mesh to also highlight, if any. * @param isPicking - Whether this function is called when picking with the mouse. * * @returns Promise that resolves when the highlighting is complete. * * @throws Will throw an error if the selection does not exist. * @throws Will throw an error if the fragment or its geometry is not found. * @throws Will throw an error if the item ID is not found. * @throws Will throw an error if the fragment does not belong to a FragmentsGroup. */ highlightByID(name: string, modelIdMap: OBC.ModelIdMap, removePrevious?: boolean, zoomToSelection?: boolean, exclude?: OBC.ModelIdMap | null, isPicking?: boolean): Promise; /** * Updates the colors of highlighted fragments based on the current selection and styles. * @returns Resolves when all highlight updates and core state updates are completed. */ updateColors(): Promise; private updateStyleMap; /** * Retrieves a map of model IDs to element IDs, excluding elements that are also present in the selection map * specified by `this.config.selectName`. Optionally filters the results based on a provided filter map. * * @param style - The style name to retrieve the selection from. * @param filter - An optional map of model IDs to element IDs used to further filter the results. If provided, * only elements present in this filter will be included in the result. * @returns A map of model IDs to element IDs, excluding selected elements and optionally filtered elements. * Returns `null` if the resulting map is empty. * @throws Error - If the specified style does not exist in the selection. */ private getMapWithoutSelection; /** * Clears the selection for the given name or all selections if no name is provided. * * @param name - The name of the selection to clear. If not provided, clears all selections. * @param filter - The only items to unselect. If not provided, all items will be unselected. * */ clear(name?: string, _filter?: OBC.ModelIdMap): Promise; /** * Sets up the Highlighter with the provided configuration. * * @param config - Optional configuration for the Highlighter. * If not provided, the Highlighter will use the default configuration. * * @throws Will throw an error if the world or a required component is not found. * @throws Will throw an error if the selection already exists. * @throws Will throw an error if the fragment or its geometry is not found. * @throws Will throw an error if the item ID is not found. * @throws Will throw an error if the fragment does not belong to a FragmentsGroup. */ setup(config?: Partial): void; private zoomSelection; private restorePreviousColors; private setupEvents; private onMouseDown; private debounceTimeout; private onMouseUp; private onMouseMove; } /** * Interface defining the configuration options for the Highlighter class. */ export declare interface HighlighterConfig { /** Name of the selection event. */ selectName: string; /** Toggles the select functionality. */ selectEnabled: boolean; /** * Color used for selection. * @deprecated use selectMaterialDefinition instead * */ selectionColor: THREE.Color | null; /** Whether to automatically highlight fragments on click. */ autoHighlightOnClick: boolean; /** The world in which the highlighter operates. */ world: OBC.World | null; selectMaterialDefinition: Omit | null; /** Whether to automatically update fragments when highlighting. */ autoUpdateFragments: boolean; } /** * Interface defining the events that the Highlighter class can trigger. Each highlighter has its own set of events, identified by the highlighter name. */ export declare interface HighlightEvents { [highlighterName: string]: { /** Event triggered before a fragment is highlighted, giving the last selection. */ onBeforeHighlight: OBC.Event; /** Event triggered when a fragment is highlighted. */ onHighlight: OBC.Event; /** Event triggered when a fragment is cleared. */ onClear: OBC.Event; }; } /** * The `Hoverer` component applies a material overlay to whichever * fragment item is under the cursor. It identifies the hovered item * via the GPU-readback picker (no worker raycast) and visualizes it by * attaching small proxy meshes that share the source tiles' geometry * attributes — no `Mesher.get`, no fresh `BufferGeometry` per hover, no * GPU memory allocation per item. * * Per-hover cost when the chunks cache is warm: one picker render + * 4-byte readback + a couple of proxy attach/detach calls. First hover * on a new item adds one worker round-trip for the chunks query; the * result is cached forever (until the model unloads). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/Hoverer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/Hoverer). */ export declare class Hoverer extends OBC.Component implements OBC.Disposable { static uuid: "26fbd870-b1b2-4b71-b747-4063d484de1b"; readonly onHoverStarted: OBC.Event; readonly onHoverEnded: OBC.Event; readonly onDisposed: OBC.Event; /** * Cursor-input mode. See {@link HovererMode}. Defaults to * `MOUSE_MOVE` — picking is fast enough that there's no reason to * wait for the cursor to settle. */ mode: HovererMode; /** * When `true`, fade the hover material's opacity in and out over * {@link fadeDuration}. When `false`, the visualization pops in and * out instantly with no animation. */ fade: boolean; /** Fade animation duration in milliseconds. Ignored when {@link fade} is `false`. */ fadeDuration: number; /** * Internal key for stashing the material's max opacity on its * `userData`, so the fade animation can scale to whatever ceiling * the user configured. */ private HOVERER_OPACITY_KEY; /** * Settle window for {@link HovererMode.MOUSE_STOP} mode. Hardcoded * because it's a definition-of-stopped threshold, not a user-facing * latency knob; tweaking it doesn't make hover faster, only * jitter-vs-responsiveness within the same mode. Apps that care * about "instant" should use {@link HovererMode.MOUSE_MOVE}. */ private static readonly MOUSE_STOP_SETTLE_MS; /** * Hysteresis on null picks: how many consecutive `getItemAt` * returning `null` we tolerate before declaring "no item under * cursor" and starting the unhover. * * Pixel-precise GPU picking can briefly miss an item at sub-pixel * sample boundaries even while the cursor is still visually on it. * Without this, the brief miss tears the hover down and the next * frame's successful pick rebuilds it, producing a blink. At 60Hz * `MOUSE_MOVE`, two missed frames is ~33 ms — invisible to the * user, enough to absorb the typical jitter. */ private static readonly NULL_PICK_TOLERANCE; private _world; set world(value: OBC.World | null); get world(): OBC.World | null; private _enabled; set enabled(value: boolean); get enabled(): boolean; /** * Material applied to the hover proxies. Defaults to a translucent * white overlay that draws on top of the source geometry. Setting a * new material caches its `opacity` as the fade animation peak and * disposes the previous one. */ private _material; set material(value: THREE.Material); get material(): THREE.Material; /** * Currently-attached proxy meshes. Each shares its tile's * `geometry.attributes` and `index`; their wrapper `BufferGeometry` * carries `geometry.groups` covering only the hovered item's slices. */ private _proxies; /** * Last-hovered item, or `null` when the cursor is over empty space. * Used to skip work when the cursor stays on the same item across * mousemoves. */ private _current; /** * Cache of `getItemDrawChunks` results, keyed by model id then local * id. The chunks query is the only worker call the Hoverer makes per * never-before-seen item; once cached, hovering the same item again * stays pure main thread. * * Cleared per-model when the fragment model is removed from the * manager (see {@link setupFragmentListeners}). */ private _chunksCache; private _fadeAnimation; /** * Generation counter incremented every time the hovered item * changes. The async chunks fetch checks this against the value it * captured at start; if they don't match, a newer hover has * superseded this one and the result is discarded. */ private _hoverGen; /** * Settle timer for {@link HovererMode.MOUSE_STOP}: cleared on every * mousemove and re-armed for {@link MOUSE_STOP_SETTLE_MS} ms. Fires * once the cursor pauses, kicks off one hover detection. */ private _settleTimer; /** * RAF gate for {@link HovererMode.MOUSE_MOVE}: set when a mousemove * has scheduled a hover for the next animation frame, so additional * mousemoves coalesce into a single call. Caps detection at * 60 picks/sec regardless of mousemove rate. */ private _moveScheduled; /** * In-flight guard for {@link HovererMode.MOUSE_MOVE}: prevents a new * hover detection from starting while a previous one is still * awaiting the picker, so a slow render can't pile up behind a * flurry of mousemoves. */ private _moveInflight; /** * Consecutive null-pick counter. Reset on any successful pick. * When it exceeds {@link NULL_PICK_TOLERANCE} we treat the cursor * as truly off-item and run the unhover. */ private _nullPicks; /** * True while the user is actively dragging the camera (orbit, * pan). Set on `controlstart`, cleared on `controlend`. Listening * to camera-controls' user-input events directly (rather than * watching `update` or the camera matrix) means the Hoverer * resumes the moment the user releases the mouse — without * waiting for damping inertia to fully decay, which the previous * matrix-equality gate suffered from. */ private _dragging; /** * True while wheel events are arriving at the canvas. Camera- * controls doesn't surface a wheel-start / wheel-end event pair, * so we debounce on the canvas-level `wheel` event: every wheel * pulse keeps this `true`; a brief idle window * ({@link WHEEL_IDLE_MS}) flips it back to `false`. Like * `_dragging`, this is independent of damping — picks resume as * soon as the user stops scrolling. */ private _wheeling; private _wheelIdleTimer; private static readonly WHEEL_IDLE_MS; /** Listeners stashed so we can detach on world-change / disable. */ private _onCtrlStart; private _onCtrlEnd; private _onWheel; constructor(components: OBC.Components); /** * Manually detach the current hover visualization. The next * mousemove will identify a fresh item and re-attach. */ clear(): void; /** {@link Disposable.dispose} */ dispose(): void; /** * Run a single hover detection at the current mouse position. Public * so callers can drive it manually if they're not using the * automatic mousemove listener. */ hover(): Promise; private beginUnhover; private attachForCurrent; private getOrFetchChunks; /** * Build a single proxy mesh for one tile + its outlined chunks. * Aliases the source geometry's attributes/index, so the proxy * carries no GPU memory of its own. Material is wrapped in a * one-element array because three only honours `geometry.groups` * when the mesh's material is `Material[]`. */ private buildProxy; /** * Detach every active proxy. The proxy `BufferGeometry` is **not** * disposed: its attributes and index are aliased from the source * tile's geometry, and `BufferGeometry.dispose()` would tell three's * `WebGLAttributes` to free the GPU buffers, breaking the source * tile. We let the wrapper itself be GC'd. */ private detachAll; private cancelTimers; private setupEvents; private setupFragmentListeners; private onMouseMove; private onMouseLeave; private animate; } /** * How the Hoverer reacts to cursor input. * * - {@link HovererMode.MOUSE_STOP}: hover detection runs once the * cursor has settled briefly. Matches the classic "wait for the user * to stop moving" feel: less jittery, useful when hover is paired * with a heavy reaction. * - {@link HovererMode.MOUSE_MOVE}: hover detection runs continuously * as the cursor moves, throttled to one pick per animation frame. * Snappier, ideal now that GPU-readback picking is sub-millisecond. */ export declare enum HovererMode { MOUSE_STOP = "mousestop", MOUSE_MOVE = "mousemove" } /** * Interface representing a group of markers. */ export declare interface IGroupedMarkers { /** * Unique identifier for the group of markers. */ key: string; /** * Array of keys of markers that belong to this group. */ markerKeys: string[]; /** * Label of the group of markers. */ label: Mark; } /** * Interface representing a marker object. */ export declare interface IMarker { /** * Unique identifier for the marker. */ key: string; /** * Label of the marker. */ label: Mark; /** * Optional type of the marker. */ type?: string; /** * Indicates whether the marker is merged with other markers. */ merged: boolean; /** * Indicates whether the marker is static and should not be clustered. */ static: boolean; } /** One click → one dimension. Auto-confirms once both endpoints are set. */ export declare const IndividualMode: PlacementMode; export declare class LeaderAnnotationsTool extends DrawingTool { private _editState; private _lastCursor; /** The underlying LeaderAnnotations system — always available. */ readonly system: OBC.LeaderAnnotations; constructor(components: OBC.Components); private readonly _onDelete; private readonly _onCommit; private readonly _onUpdate; private readonly _onMachineStateChanged; get state(): OBC.LeaderAnnotationState; send(msg: Parameters[0]): void; protected _onCancel(): void; onDrawingChange(drawing: OBC.TechnicalDrawing | null, fonts: FontManager | null): void; onActivate(): void; onDeactivate(): void; onPointerClick(cursor: DrawingPointerEvent): void; onPointerMove(e: DrawingPointerEvent): void; dispose(): void; readonly translatable = true; protected _systemPick(ray: THREE.Ray): string | null; protected _systemDelete(drawing: OBC.TechnicalDrawing, uuids: string[]): void; protected _onDeselect(): void; private _translateUuids; private readonly _translateOrigins; private _translateDragStart; translateStart(uuids: string[], origin: THREE.Vector3): void; translateUpdate(point: THREE.Vector3): void; translateEnd(): void; translateCancel(): void; private _createLabel; private _updateLabel; protected _onSelect(uuid: string): void; protected _getHandlePositions(uuid: string): THREE.Vector3[]; } /** * A basic dimension tool to measure distances between 2 points in 3D and display a 3D symbol displaying the numeric value. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/LengthMeasurement). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/LengthMeasurement). */ export declare class LengthMeasurement extends Measurement { static uuid: "2f9bcacf-18a9-4be6-a293-e898eae64ea1"; private _temp; /** Last edge endpoints used to drive the preview in `edge` mode. * When the new pick resolves to the same edge (same endpoints * within a small epsilon), we skip the dimension rebuild that * would otherwise fire every frame and visibly blink. */ private _lastEdgeKey; /** Consecutive null/no-edge picks since the last good one. Used as * a small grace window so a single sub-pixel pick miss doesn't * hide the dimension line and visibly flicker the endpoint * marker. */ private _edgeMissStreak; private static readonly EDGE_MISS_TOLERANCE; /** * The possible modes in which a measurement of this type may be created. */ modes: LengthMeasurerModes[number][]; private _mode; get mode(): LengthMeasurerModes[number]; /** * Represents the current measurement mode being used. */ set mode(value: LengthMeasurerModes[number]); get isDragging(): boolean; constructor(components: OBC.Components); private initHandlers; private initPreview; private updatePreviewLine; create: () => Promise; endCreation: () => void; cancelCreation: () => void; delete: () => void; } /** * Represents the modes available for the length measurement tool. `free`: Allows free-form measurement without constraints. `edge`: Enables measurement constrained to item edges. */ declare type LengthMeasurerModes = ["free", "edge"]; export declare class Line extends THREE.Line3 { id: string; private _units; set units(value: "m" | "cm" | "mm" | "km"); get units(): "m" | "cm" | "mm" | "km"; private _rounding; set rounding(value: number); get rounding(): number; get value(): number; } export declare class LinearAnnotationsTool extends DrawingTool { private _editState; private _lastCursor; private _previewLabelGroup; private _previewLabelText; /** The underlying LinearDimensions system — always available. */ readonly system: OBC.LinearAnnotations; constructor(components: OBC.Components); private readonly _onDelete; private readonly _onCommit; private readonly _onMachineStateChanged; private readonly _onUpdate; /** * Number of points placed in the current placement session. * Useful for implementing placement strategies (e.g. auto-confirm after 2 points). */ get pointsPlaced(): number; /** Current state of the underlying LinearDimensions state machine. */ get state(): OBC.LinearAnnotationState; get isIdle(): boolean; /** * Primary interaction entry point. Intercepts CLICK to handle selection/drag * before forwarding placement messages to the state machine. */ send(msg: Parameters[0]): void; /** Confirm the current placement session. */ confirm(): void; /** * Cancel any in-progress drag or placement, restoring original values. * Called automatically by `onDeactivate`. */ protected _onCancel(): void; onDrawingChange(drawing: OBC.TechnicalDrawing | null, fonts: FontManager | null): void; onActivate(): void; onDeactivate(): void; onPointerClick(cursor: DrawingPointerEvent): void; onPointerMove(e: DrawingPointerEvent): void; dispose(): void; protected _systemPick(ray: THREE.Ray): string | null; protected _systemDelete(drawing: OBC.TechnicalDrawing, uuids: string[]): void; protected _onDeselect(): void; private _createLabel; private _updateLabel; private _clearPreviewLabel; private _updatePreviewLabel; private _positionLabel; protected _onSelect(uuid: string): void; protected _getHandlePositions(uuid: string): THREE.Vector3[]; private _findHandleAtPoint; private _projectToParallel; } declare type LinearDimMsg = Parameters[0]; /** Context passed to every {@link PlacementMode} registered on {@link LinearAnnotationsTool}. */ export declare interface LinearPlacementContext { /** Current state of the LinearDimensions state machine. */ state: LinearAnnotationsTool["state"]; /** Snap result at the current cursor position, or null if no geometry was hit. */ snap: SnapResult | null; /** Drawing-local cursor point — snapped if a snap candidate was found. */ point: THREE.Vector3; /** The line under the cursor, if any. */ line: THREE.Line3 | undefined; /** Number of points placed in the current placement session. */ pointsPlaced: number; /** True when the cursor is hovering over a handle of the selected dimension. */ isHandleHovered: boolean; /** Send a message to the LinearDimensions state machine. */ send(msg: LinearDimMsg): void; } /** Clicking a projection line locks onto both its endpoints at once, then a second click sets the offset distance. */ export declare const LineMode: PlacementMode; /** * Represents a marker in the 3D world. */ export declare class Mark implements OBC.Hideable, OBC.Disposable { /** * The CSS object representing the marker. */ three: CSS2DObject; /** * The world in which the marker exists. */ world: OBC.World; /** * The visibility state of the marker, used for culling (e.g. clipping planes). */ wasVisible: boolean; /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; /** {@link OBC.Hideable.visible} */ set visible(value: boolean); /** {@link OBC.Hideable.visible} */ get visible(): boolean; constructor(world: OBC.World, element?: HTMLElement, parent?: THREE.Object3D); /** * Toggles the visibility of the marker. * * This method changes the `visible` property of the marker to its opposite value. * If the marker is currently visible, it will be hidden, and vice versa. */ toggleVisibility(): void; /** * Never Display marker. * * This method changes the `visible` property of the marker to its false value. * Marker will never displayed. */ notDisplay(): void; /** {@link OBC.Disposable.dispose} */ dispose(): void; } /** * Component for Managing Markers along with creating different types of markers. Every marker is a Simple2DMarker. For every marker that needs to be added, you can use the Manager to add the marker and change its look and feel. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/Marker). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/Marker). */ export declare class Marker extends OBC.Component implements OBC.Disposable { /** * A unique identifier for the component. * This UUID is used to register the component within the Components system. */ static readonly uuid: "4079eb91-79b0-4ede-bcf2-15b837129236"; /** {@link OBC.Disposable.onDisposed} */ readonly onDisposed: OBC.Event; /** {@link OBC.Component.enabled} */ enabled: boolean; /** * The distance threshold for clustering markers. * Markers within this distance will be considered for clustering. * Default value is 50. */ threshold: number; /** * Indicates whether markers should be automatically clustered. * If true, markers will be clustered based on the threshold value. * Default value is true. */ autoCluster: boolean; private static readonly DEFAULT_CLUSTER_STYLES; clusterElementStyles: Partial<{ [key: string]: string | undefined; }>; /** * A Map containing the markers grouped by world UUID. * Each world can have its own set of markers. */ list: Map>; protected clusterLabels: Set; protected currentKeys: Set; protected _color: string; protected _markerKey: number; protected _clusterKey: number; private _worldEvents; private _setupWorlds; /** * Getter for the color property. * Returns the current color of the markers. * * @returns {string} The current color of the markers. */ get color(): string; /** * Setter for the color property. * Updates the color of all the markers to the new value. * * @param {string} value - The new color value for the markers. */ set color(value: string); constructor(components: OBC.Components); /** * Creates a new marker at the specified point in the world. * * @param world - The world where the marker will be created. * @param text - The text content of the marker. * @param point - The 3D position where the marker will be placed. * @param isStatic - Indicates whether the marker should be static and not clustered. * @returns The unique key of the created marker. */ create(world: OBC.World, element: HTMLElement, point: THREE.Vector3, isStatic?: boolean): string | null; /** * Deletes a marker with the specified ID from all worlds. * * @param id - The unique identifier of the marker to be deleted. * * @remarks * This method iterates through all the worlds and their respective markers. * If a marker with the specified ID is found, it disposes of the marker's label * and removes the marker from the world's marker list. * */ delete(id: string): void; /** * Retrieves the list of markers associated with a specific world. * If the list does not exist for the given world, it creates a new one. * * @param world - The world for which the marker list is to be retrieved. * @returns A Map containing the markers associated with the given world. * * @remarks * This method is used to manage markers per world. It ensures that each world has its own set of markers. * If a marker list for the given world does not exist, it creates a new one and associates it with the world. */ getWorldMarkerList(world: OBC.World): Map; /** {@link OBC.Disposable.dispose} */ dispose(type?: string): void; /** * Sets up event listeners for clustering markers in the given world. * * @param world - The world where the event listeners will be set up. * @param enabled - Indicates whether the event listeners should be enabled or disabled. * * @remarks * This method checks if the event listeners are already set up for the given world. * If the event listeners are already set up and the `enabled` parameter is true, the method returns without doing anything. * If the world does not have camera controls, the method returns without doing anything. * * The method then retrieves the event listener for the given world using the `getWorldEvent` method. * It removes the existing event listeners for the "sleep" and "rest" events from the world's camera controls. * * If the `enabled` parameter is true, the method adds the event listener for the "sleep" and "rest" events to the world's camera controls. */ setupEvents(world: OBC.World, enabled: boolean): void; /** * Performs clustering of markers in the given world. * * @param world - The world where clustering will be performed. * */ cluster(world: OBC.World): void; private getWorldEvent; private resetMarkers; private removeMergeMarkers; private getAveragePositionFromLabels; clusterElementFactory: () => HTMLElement; private createClusterElement; private getScreenPosition; private distance; private navigateToCluster; } export declare class MeasureFill { private readonly _root; private _components; private _material; set material(value: THREE.MeshLambertMaterial); get material(): THREE.MeshLambertMaterial; private _visible; set visible(value: boolean); get visible(): boolean; set rounding(value: number); get rounding(): number; set units(value: "m2" | "cm2" | "mm2" | "km2"); get units(): "m2" | "cm2" | "mm2" | "km2"; private _color; set color(color: THREE.Color); get color(): THREE.Color; readonly label: MeasureMark; readonly three: THREE.Mesh, THREE.Material | THREE.Material[], THREE.Object3DEventMap>; world: OBC.World; area: Area; constructor(components: OBC.Components, world: OBC.World, area?: Area); applyPlanesVisibility(planes: THREE.Plane[]): void; private _triggerUpdate; private updateMesh; update(): void; dispose(): void; } export declare class MeasureMark extends Mark { private _value; set value(value: number); get value(): number; private _units; set units(value: string); get units(): string; private _worldUnits; set worldUnits(value: string); get worldUnits(): string; private _color; set color(color: THREE.Color); get color(): THREE.Color; private _textColor; set textColor(color: THREE.Color); get textColor(): THREE.Color; private _rounding; set rounding(value: number); get rounding(): number; get formattedValue(): string; constructor(world: OBC.World); } /** * Abstract class that gives the core elements to create any measurement component. 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/Measurement). */ export declare abstract class Measurement = Record, U extends keyof MeasureToUnitMap = keyof MeasureToUnitMap> extends OBC.Component implements OBC.Createable, OBC.Hideable, OBC.Disposable { list: FRAGS.DataSet; onDisposed: OBC.Event; snappings?: FRAGS.SnappingClass[]; lines: FRAGS.DataSet; fills: FRAGS.DataSet; labels: FRAGS.DataSet; volumes: FRAGS.DataSet; delay: number; /** * When to run the snap pick that drives the preview marker. See * {@link MeasurementPickMode}. Defaults to `MOUSE_MOVE` (pick on * every animation frame the cursor is moving). On big models you * may want `MOUSE_STOP` (pick once after the cursor settles for * {@link delay} ms): the per-pick cost is the same, but you pay * it once per intentional stop rather than once per frame, and * the marker only appears where the user is actually about to * click. The `onPointerStop` event still fires in both modes; in * `MOUSE_STOP` we just align the pick to that same moment. */ pickMode: MeasurementPickMode; abstract modes: string[]; abstract mode: string; protected _world: OBC.World | null; set world(value: OBC.World | null); get world(): OBC.World | null; readonly measureType: U; get unitsList(): string[]; readonly onPointerStop: OBC.Event; readonly onPointerMove: OBC.Event; readonly onStateChanged: OBC.Event; /** * Most recent vertex-picker result for this measurement. Updated by * the per-frame RAF-coalesced pick that drives the snap marker. * Subclasses (e.g. {@link LengthMeasurement}) read this instead of * issuing their own `castRay` so we never do more than one pick per * animation frame regardless of how many subscribers care about * pointer position. */ protected lastPick: any; private pointerStopTimeout; /** RAF coalescing for the snap-marker preview the picker draws on * every move. `pointermove` fires faster than the renderer paints; * more than one pick per frame would just stall on `readPixels`. */ private _markerRafScheduled; /** True while the user is orbiting / panning the camera. We skip * picks while this is set — the cursor is "moving" only relative * to the world, not to anything the user actually wants to snap * to, and picking during a drag wastes work and visually jitters * the marker. */ private _cameraInteracting; /** * Idle window after the last wheel pulse before picks resume. Wheel * zoom doesn't fire `controlstart` / `controlend`, so we debounce * on the canvas-level `wheel` event. Drag suspension is gated by * the user-input pair directly and resumes the moment `controlend` * fires (no debounce, no waiting on damping inertia). */ cameraStopDelay: number; /** Listeners stashed so we can detach on disable / world-change. */ private _onCtrlStart; private _onCtrlEnd; private _onWheel; /** Wheel-idle debounce timer. Re-armed on every wheel pulse. */ private _wheelIdleTimer; /** Pointer-leave handler — hides the marker when the cursor leaves * the canvas (or floats over a UI panel sitting above it). */ private _pointerLeaveHandler; private onMove; private scheduleMarkerUpdate; private onKeydown; private setEvents; readonly onEnabledChange: OBC.Event; private _enabled; set enabled(value: boolean); get enabled(): boolean; static valueFormatter: ((value: number) => string) | null; readonly onVisibilityChange: OBC.Event; private _visible; set visible(value: boolean); get visible(): boolean; private _units; set units(value: MeasureToUnitMap[U]); get units(): MeasureToUnitMap[U]; private _rounding; set rounding(value: number); get rounding(): number; private _linesEndpointElement; set linesEndpointElement(value: HTMLElement); get linesEndpointElement(): HTMLElement; private _linesMaterial; set linesMaterial(value: THREE.LineBasicMaterial); get linesMaterial(): THREE.LineBasicMaterial; private _fillsMaterial; set fillsMaterial(value: THREE.MeshLambertMaterial); get fillsMaterial(): THREE.MeshLambertMaterial; private _volumesMaterial; set volumesMaterial(value: THREE.MeshLambertMaterial); get volumesMaterial(): THREE.MeshLambertMaterial; private _color; set color(value: THREE.Color); get color(): THREE.Color; /** * @deprecated Sync mode is gone — picks are fast enough through * the unified GPU-pick path that the synchronous workaround is no * longer needed. Reading still returns the underlying picker mode * for compatibility, but setting it has no functional effect. */ get pickerMode(): GraphicVertexPickerMode; /** @deprecated See the getter. */ set pickerMode(value: GraphicVertexPickerMode); get snapDistance(): number; set snapDistance(value: number); get pickerSize(): number; set pickerSize(value: number); protected _vertexPicker: GraphicVertexPicker; constructor(components: OBC.Components, measureType: U); create: (_input?: any) => void; endCreation: (_data?: T) => void; cancelCreation: () => void; delete: (_data?: any) => void; dispose(): void; applyPlanesVisibility(planes: THREE.Plane[]): void; protected createLineElement(line: Line, startNormal?: THREE.Vector3 | null): DimensionLine; protected createFillElement(area: Area): MeasureFill; protected createVolumeElement(volume: Volume): MeasureVolume; protected addLineElementsFromPoints(points: THREE.Vector3[]): void; protected getLineBoxes(): THREE.Mesh, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]; protected getFillBoxes(): THREE.Mesh, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]; protected getVolumeBoxes(): Promise, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[][]>; } /** * When the measurement tool runs the snap pick that drives the * preview marker / dimension line. * * - {@link MeasurementPickMode.MOUSE_MOVE}: pick once per animation * frame while the cursor is moving. Snappy feedback; defaults * here. Heavy on big models because every move triggers a pick * (~15 ms GPU readback) plus a snap fetch on first sight of each * new item. * - {@link MeasurementPickMode.MOUSE_STOP}: pick only after the * cursor settles for {@link Measurement.delay} ms. One pick per * stop, regardless of how the user got there. Recommended for * large scenes — the marker only appears where the user actually * pauses, which is also where they're about to click. */ export declare enum MeasurementPickMode { MOUSE_MOVE = "mousemove", MOUSE_STOP = "mousestop" } export declare type MeasurementStateChange = "mode" | "color" | "units" | "rounding" | "visibility" | "enabled"; export declare type MeasureToUnitMap = { length: "mm" | "cm" | "m" | "km"; area: "mm2" | "cm2" | "m2" | "km2"; volume: "mm3" | "cm3" | "m3" | "km3"; angle: "deg" | "rad"; }; /** * Visual representation of a {@link Volume} measurement. * * Items added to the volume are highlighted by **proxy meshes** that * alias each source tile's `BufferGeometry` attributes and `index`, * with `geometry.groups` set to the per-item draw ranges returned by * `FragmentsModel.getItemDrawChunks`. No vertex / normal / index data * is duplicated — a proxy carries no GPU memory of its own beyond a * small `BufferGeometry` wrapper. On a 250k-item model this means the * cost of visualising a measurement is proportional to the number of * items the user has clicked, not the total geometry of the model. * * (Previous implementation materialised one full `THREE.Mesh` per * picked item by deep-copying the tile geometry through `Mesher`, * which dominated memory once a measurement contained more than a * handful of items.) */ declare class MeasureVolume { private _components; private _material; /** * Wrapped in a one-element array because three only honours * `geometry.groups` when the mesh's material is `Material[]`. */ private get materialArray(); set material(value: THREE.MeshLambertMaterial); get material(): THREE.MeshLambertMaterial; private _visible; set visible(value: boolean); get visible(): boolean; set rounding(value: number); get rounding(): number; set units(value: "m3" | "cm3" | "mm3" | "km3"); get units(): "m3" | "cm3" | "mm3" | "km3"; private _color; set color(color: THREE.Color); get color(): THREE.Color; readonly label: MeasureMark; world: OBC.World; volume: Volume; meshes: THREE.Mesh[]; constructor(components: OBC.Components, world: OBC.World, volume?: Volume); applyPlanesVisibility(planes: THREE.Plane[]): void; private updateMesh; /** * Build a single proxy mesh for one tile + its picked draw chunks. * Aliases the source geometry's attributes and index, so the proxy * holds no GPU buffers of its own. Material is wrapped in * `Material[]` because three only honours `geometry.groups` when * the mesh's material is an array. * * Mirrors the Hoverer / Outliner proxy pattern. */ private buildProxy; update(): Promise; private cleanMeshes; dispose(): void; } /** * Mesher is a class that manages the creation and removal of THREE.Mesh objects from fragment data. It allows to efficiently retrieve and remove meshes for specific model items. 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/Mesher). */ export declare class Mesher extends OBC.Component implements OBC.Disposable { static uuid: "ab45d0a7-feea-4afc-927c-80832dae76dd"; enabled: boolean; /** * A map of model IDs to arrays of THREE.BufferGeometry objects. * This is used to store and reuse the geometries generated by the mesher. */ readonly geometries: OBC.ModelIdDataMap<{ geometry: THREE.BufferGeometry; transform: THREE.Matrix4; }[]>; /** * Retrieves meshes for specified model items, optionally applying a material and coordinate system transformation. * * @param modelIdMap - A map of model IDs to an array of local IDs, specifying which items to retrieve meshes for. * @param _config - Optional configuration object. * @param _config.material - Optional material to apply to the meshes. If not provided, the default material is used. * @param _config.applyTransformation - Whether to bring the mesh to its original position or leave it at 0,0,0. Defaults to `true`. * @returns A map of model IDs to a map of local IDs to an array of THREE.Mesh objects. */ get(modelIdMap: OBC.ModelIdMap, _config?: { material?: THREE.Material; coordinate?: boolean; applyTransformation?: boolean; }): Promise, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]>>; private getModelMeshes; /** * Removes the cached geometries by disposing the resources. * This makes the meshes created by the component unusable as the geometry will no longer be present. * * @param modelIds - An optional array of model IDs to remove. If not provided, all meshes will be removed. */ remove(modelIds?: string[]): void; readonly onDisposed: OBC.Event; dispose(full?: boolean): void; getMeshesFromResult(result: OBC.ModelIdDataMap): THREE.Mesh, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]; private createGeometry; private createMesh; } declare interface OutlineGroup { id: number; name: string; /** Container parented to the root scene; ghost meshes live here. */ container: THREE.Group; /** Dedicated material for this group, with its idColor uniform baked in. */ material: THREE.ShaderMaterial; outlineColor: THREE.Color; fillColor: THREE.Color; fillOpacity: number; thickness: number; /** * Higher priority wins at coplanar pixels. Applied as a polygon-offset bias * on the group's material so depth test resolves ties in its favor. */ priority: number; } /** * Per-group visual configuration for the outliner. */ export declare interface OutlineGroupConfig { color?: THREE.Color; fillColor?: THREE.Color; fillOpacity?: number; thickness?: number; /** * Higher priority groups win at coplanar pixels (z-fighting resolution * between groups). Default is 0. Use integer steps; a difference of 1 is * enough to resolve typical coplanar cases. */ priority?: number; } /** * This component allows adding colored outlines with thickness to fragments in * a 3D scene. Supports multiple named outline groups so different selections * can be outlined with different colors / thicknesses at the same time. 📕 * [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/Outliner). 📘 * [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/Outliner). */ export declare class Outliner extends OBC.Component implements OBC.Disposable { private _world?; /** * The world where the outliner operates. */ set world(value: OBC.World | undefined); get world(): OBC.World | undefined; /** * A set of Highlighter styles linked with the default outline group. * @remarks Use this or addItems directly but avoid using both at the same * time to prevent unwanted results. For per-group routing, wire the * Highlighter events manually with a group name: * `highlighter.events.select.onHighlight.add(m => outliner.addItems(m, "my-group"))` */ styles: DataSet; outlinePositions: boolean; private _mesh; private get _points(); /** {@link OBC.Component.enabled} */ get enabled(): boolean; /** {@link OBC.Component.enabled} */ set enabled(value: boolean); /** Outline color for the default group. */ get color(): THREE.Color; set color(value: THREE.Color); /** Thickness for the default group. */ get thickness(): number; set thickness(value: number); /** Fill color for the default group. */ get fillColor(): THREE.Color; set fillColor(value: THREE.Color); /** Fill opacity for the default group. */ get fillOpacity(): number; set fillOpacity(value: number); readonly onDisposed: OBC.Event; /** * A unique identifier for the component. * This UUID is used to register the component within the Components system. */ static readonly uuid: "2fd3bcc5-b3b6-4ded-9f64-f47a02854a10"; private _groups; /** * Per-model unsubscribe handles for the tile lifecycle listeners * registered in {@link bindModelTileEvents}. Run on dispose so we * don't leak references after the Outliner goes away. */ private _tileListeners; constructor(components: OBC.Components); /** * Creates (or reconfigures) a named outline group. Each group renders with * its own outline color, fill and thickness independently of the others. * * @param name - Unique group name. "default" is reserved for the legacy * singular API and cannot be removed. * @param config - Optional visual configuration. */ create(name: string, config?: OutlineGroupConfig): void; /** * Updates an existing group's visual configuration. */ configure(name: string, config: OutlineGroupConfig): void; /** * Removes a group together with all items routed to it. */ remove(name: string): void; /** Returns the names of all currently created groups. */ list(): string[]; /** * Wires a Highlighter style to a specific outline group. Equivalent to * `outliner.styles.add(style)` but routes the items to the given group * instead of the default. */ bindStyle(style: string, group?: string): boolean; /** * Adds items to be outlined in a specific group (defaults to "default"). */ addItems(modelIdMap: OBC.ModelIdMap, group?: string): Promise; /** * Removes items from a specific group (defaults to "default"). */ removeItems(modelIdMap: OBC.ModelIdMap, group?: string): Promise; /** * Updates outline meshes for a given group, or for the default if omitted. * * When `modelIdMap` is provided and differs from the group's current map, * meshes for that delta are appended (existing group meshes stay). */ update(modelIdMap?: OBC.ModelIdMap, group?: string): Promise; /** * Cleans up outlines. Without arguments, clears every group. With a group * name, clears that group only. */ clean(group?: string): void; /** {@link Disposable.dispose} */ dispose(): void; private toPassConfig; private ensureGroup; private setupEvents; private wireStyle; private unwireStyle; private updateFromStyles; /** * Resolves the group's current selection into per-tile index chunks * via {@link FragmentsModel.getItemDrawChunks}, then asks the pass to * attach a proxy per affected tile. Tiles that previously had a proxy * but no longer match the selection are detached. * * Cost is bounded by the number of affected tiles (not selected items) * and by one worker round-trip per model in the selection. Adding * thousands of items costs the same as adding one if they all live in * the same tile, and a few thousand items spread across the model * still hits at most a few hundred tiles. * * Outline color, fill, and thickness come from the pass's group config. * The Outliner only feeds it the geometry slices. */ private updateGroup; /** * Detach every proxy this group has attached and clear the tracking * map. Used by `clean` and `remove`. */ private detachAll; /** * Subscribe to a model's tile lifecycle events so we can refresh * outline proxies when tiles load (LOD swap, viewport change, etc.) * or unload. Idempotent per model id. */ private bindModelTileEvents; private cleanPoints; private updatePoints; private getRenderer; } /** A single placement strategy for a {@link DrawingTool}. */ export declare interface PlacementMode { onClick(ctx: TCtx): void; } declare class Postproduction { invisibleMaterials: Set>; composer?: EffectComposer; readonly onStyleChanged: OBC.Event; private _enabled; private _initialized; private _basePass?; private _aoPass?; private _outputPass?; private _edgeDetectionPass?; private _smaaPass?; private _simpleOutlinePass?; private _excludedObjectsPass?; private _glossPass?; private _style; private _outlinesEnabled; private _glossEnabled; private _smaaEnabled; private _excludedObjectsEnabled; private _components; private _renderer; private _clearColor; defaultAoParameters: { radius: number; distanceExponent: number; thickness: number; scale: number; samples: number; distanceFallOff: number; screenSpaceRadius: boolean; }; get basePass(): BasePass; get enabled(): boolean; set enabled(value: boolean); get aoPass(): AOPass; get outlinePass(): SimpleOutlinePass; get edgesPass(): EdgeDetectionPass; get excludedObjectsPass(): ExcludedObjectsPass; get glossPass(): GlossPass; get outlinesEnabled(): boolean; set outlinesEnabled(value: boolean); get excludedObjectsEnabled(): boolean; set excludedObjectsEnabled(value: boolean); get glossEnabled(): boolean; set glossEnabled(value: boolean); get smaaEnabled(): boolean; set smaaEnabled(value: boolean); get style(): PostproductionAspect; set style(value: PostproductionAspect); constructor(components: OBC.Components, renderer: PostproductionRenderer); update(): void; dispose(): void; setSize(width: number, height: number): void; updateCamera(): void; clear(): void; private initialize; } export declare enum PostproductionAspect { COLOR = 0, PEN = 1, PEN_SHADOWS = 2, COLOR_PEN = 3, COLOR_SHADOWS = 4, COLOR_PEN_SHADOWS = 5 } /** * A class that extends RendererWith2D and adds post-processing capabilities. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/PostproductionRenderer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/PostproductionRenderer). */ export declare class PostproductionRenderer extends RendererWith2D { /** * The default style to use when the mode is MANUAL. */ manualDefaultStyle: PostproductionAspect; /** * Whether the postproduction will temporarily be turned off when the mode is MANUAL to get a more fluid navigation experience. */ turnOffOnManualMode: boolean; /** * The delay in milliseconds to wait before turning the postproduction back on when the mode is MANUAL. */ manualModeDelay: number; private _postproduction?; private _timeout; private _previousStyle; private _previousEnabled; /** * Getter for the postproduction instance. * Throws an error if the postproduction instance is not yet initialized. * * @returns The initialized Postproduction instance. */ get postproduction(): Postproduction; constructor(components: OBC.Components, container: HTMLElement, parameters?: Partial); /** {@link Updateable.update} */ update(): void; /** {@link OBC.Disposable.dispose}. */ dispose(): void; private setStyleWithoutEvent; private setPostproductionSize; } /** * A basic renderer capable of rendering 3D and 2D objects ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D) and [CSS2DObjects](https://threejs.org/docs/#examples/en/renderers/CSS2DRenderer) respectively). */ export declare class RendererWith2D extends SimpleRenderer { /** * This renderer is used to render 2D objects (CSS2DObjects) in a 3D scene. */ three2D: CSS2DRenderer; constructor(components: Components, container: HTMLElement, parameters?: Partial); private setupHtmlRenderer; } /** Keeps the session open after each confirmation so points can be chained. */ export declare const SequentialMode: PlacementMode; /** * Multi-group outline pass. * * Every group has its own material with its id baked into a `idColor` uniform, * and its own container `Group` parented to a single root scene. Ghost meshes * are tagged at assign time (`mesh.material = group.material`) and added to * the group's container; all ghosts across all groups are then rendered into * the mask target in one `renderer.render(rootScene, camera)` call. * * A composite shader reads the mask (center pixel id), applies that group's * fill via a palette texture, then samples the neighborhood within the * group's thickness to paint an inward outline wherever the center is near a * different id. * * Legacy single-outline API (`outlineColor`, `thickness`, `fillColor`, * `fillOpacity`, `scene`) is preserved as a delegate to the "default" group. */ declare class SimpleOutlinePass extends Pass { debugShowMask: boolean; private _world; private _maskTarget; private _rootScene; private _fsQuad; private _debugQuad; private _groups; private _groupsById; /** * Outlined-tile proxies, keyed by source tile mesh. The pass owns the * proxy meshes (and their lightweight `BufferGeometry` wrappers); the * source meshes, their `attributes`, and their `index` belong to * fragments and are never mutated here. */ private _outlinedTiles; private _nextId; private _maxThickness; private _paletteData; private _paletteTexture; constructor(width: number, height: number, world: OBC.World); /** * Creates a named outline group. Each group has its own container, material * (with id baked in) and visual config. No hard cap on active groups beyond * the palette size (255 concurrent). */ addGroup(name: string, config?: Partial>): OutlineGroup; /** * Updates an existing group's visual config. */ configureGroup(name: string, config: Partial>): void; /** * Removes a group. Detaches its ghost meshes (the caller still owns them) * and disposes the group's material. */ removeGroup(name: string): void; hasGroup(name: string): boolean; getGroup(name: string): OutlineGroup | undefined; /** * Attaches a mesh to a group: assigns the group's material and parents the * mesh into the group's container. Creates the group on demand. */ addMeshToGroup(mesh: THREE.Mesh, name: string): void; /** * Attach a tile mesh as an outline target. Creates a proxy mesh that * shares the source's `geometry.attributes` and `index` and draws only * the slices specified by `position[i] / size[i]` (parallel arrays of * index-buffer offsets). * * Calling again with the same tile rebuilds the proxy's groups from * the new chunks; calling with a different `groupName` reparents the * proxy and reassigns its mask material. */ attachOutlinedTile(tile: THREE.Mesh, chunks: { position: ArrayLike; size: ArrayLike; }, groupName?: string): void; /** * Stop outlining a tile. Removes the proxy from its container and * drops our reference to it. We deliberately do NOT call * `proxy.geometry.dispose()`: the proxy's `attributes` and `index` * are aliased from the source, and `BufferGeometry.dispose()` * dispatches a `dispose` event that tells `WebGLAttributes` to free * the GPU buffers of every attached attribute. That would yank the * source tile's GPU buffers too, after which the next source render * tries to re-upload from `attribute.array` and crashes because * fragments deletes the array on first upload to save memory. * * The proxy's tiny BufferGeometry wrapper (just metadata) is left to * GC. Attributes and index belong to fragments. */ detachOutlinedTile(tile: THREE.Mesh): void; hasOutlinedTile(tile: THREE.Mesh): boolean; /** * Container (THREE.Group) where a group's ghost meshes live. Creates the * group on demand. Use {@link addMeshToGroup} when adding ghosts so the * right material gets assigned; this accessor is for introspection. */ getGroupContainer(name: string): THREE.Object3D; /** @deprecated Kept for API compatibility. Use {@link getGroupContainer}. */ getGroupScene(name: string): THREE.Object3D; listGroups(): string[]; /** * @deprecated Previously a `THREE.Scene`. Now the default group's container * (a `THREE.Group`). Use `getGroupContainer(name)` or `addMeshToGroup(mesh, name)`. */ get scene(): THREE.Object3D; get outlineColor(): THREE.Color; set outlineColor(value: THREE.Color); get thickness(): number; set thickness(value: number); get fillColor(): THREE.Color; set fillColor(value: THREE.Color); get fillOpacity(): number; set fillOpacity(value: number); setSize(width: number, height: number): void; render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget): void; dispose(): void; /** * Push the given index chunks into the proxy's `geometry.groups`. * `Infinity` and `0xffffffff` are both treated as "to end of buffer"; * three.js accepts `Infinity` natively, which we pass through. */ private fillProxyGroups; private allocateId; private writePaletteEntry; private clearPaletteEntry; private updateMaxThickness; } export declare class SlopeAnnotationsTool extends DrawingTool { private _editState; private _lastCursor; private _obcRaycaster; private _onNeedsRender; private _castPending; private _castQueued; private _deactivated; private readonly _hitPlaneMat; private _lastPreview; private _previewGroup; private _previewLabelGroup; private readonly _previewLineMat; /** The underlying SlopeAnnotations system — always available. */ readonly system: OBC.SlopeAnnotations; constructor(components: OBC.Components); private readonly _onDelete; private readonly _onCommit; private readonly _onUpdate; get state(): EditState; /** * Registers the world for slope placement raycasting. * * ```ts * slopeTool.addWorld(world, components, () => renderViewports()); * ``` */ addWorld(world: OBC.World, components: OBC.Components, onNeedsRender: () => void): void; send(_msg: { type: "CLICK"; point: THREE.Vector3; }): void; protected _onCancel(): void; onDrawingChange(drawing: OBC.TechnicalDrawing | null, fonts: FontManager | null): void; onActivate(): void; onDeactivate(): void; onPointerClick(cursor: DrawingPointerEvent): void; onPointerMove(e: DrawingPointerEvent): void; dispose(): void; readonly translatable = true; protected _systemPick(ray: THREE.Ray): string | null; protected _systemDelete(drawing: OBC.TechnicalDrawing, uuids: string[]): void; protected _onDeselect(): void; private _translateUuids; private readonly _translateOrigins; private _translateDragStart; translateStart(uuids: string[], origin: THREE.Vector3): void; translateUpdate(point: THREE.Vector3): void; translateEnd(): void; translateCancel(): void; private _triggerCast; private _updateSlopePreview; private _clearSlopePreview; private _clearPreviewLabel; private _createLabel; private _updateLabel; private _positionLabel; protected _onSelect(uuid: string): void; protected _getHandlePositions(uuid: string): THREE.Vector3[]; } export declare interface SnapResult { /** Snapped drawing-local point. */ point: THREE.Vector3; /** Snap kind — "none" means the raw hit point with no vertex/midpoint snap. */ kind: "start" | "end" | "center" | "none"; /** The geometry line that was hit. Required by LinearAnnotations / AngleAnnotations machines. */ line: THREE.Line3; } declare type ToolConstructor = new (components: OBC.Components) => DrawingTool; export declare class Volume { private _components; id: string; readonly onItemsChanged: OBC.Event; private _items; set items(value: OBC.ModelIdMap); get items(): OBC.ModelIdMap; private _units; set units(value: "m3" | "cm3" | "mm3" | "km3"); get units(): "m3" | "cm3" | "mm3" | "km3"; private _rounding; set rounding(value: number); get rounding(): number; getRawValue(): Promise; getValue(): Promise; getCenter(): Promise; constructor(components: OBC.Components); getBox(): Promise; clone(): Volume; } /** * A basic dimension tool to measure volumes and display a 3D symbol with the numeric value. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Front/VolumeMeasurement). 📘 [API](https://docs.thatopen.com/api/@thatopen/components-front/classes/VolumeMeasurement). */ export declare class VolumeMeasurement extends Measurement { static uuid: "01f885ab-ec4e-4e6c-a853-9dfc0d6766ed"; private _temp; readonly onPreviewInitialized: OBC.Event; /** * The possible modes in which a measurement of this type may be created. */ modes: VolumeMeasurerModes[number][]; /** * Volume measurement picks whole items, not points / edges / * surfaces inside them — so snap classes carry no meaning here. * Overriding to `undefined` skips the SnapResolver hop and the * picker just returns the raw GPU-pick hit. */ snappings: undefined; private _mode; get mode(): VolumeMeasurerModes[number]; /** * Represents the current measurement mode being used. */ set mode(value: VolumeMeasurerModes[number]); constructor(components: OBC.Components); private initHandlers; private _previousHovererState; private initPreview; create: () => Promise; endCreation: () => void; cancelCreation: () => void; delete: () => Promise; } /** * Represents the modes available for the volume measurement tool. */ declare type VolumeMeasurerModes = ["free"]; export { }