import * as THREE from "three"; import { DistancePanel, PropertiesPanel, DistanceResponseData, PropertiesResponseData } from "./ui.js"; import type { PickedObject } from "../../rendering/raycast.js"; import type { ViewerLike } from "./tools.js"; interface PanelDragData { x: number | null; y: number | null; clicked: boolean; } declare class Measurement { selectedShapes: PickedObject[]; point1: THREE.Vector3 | null; point2: THREE.Vector3 | null; middlePoint: THREE.Vector3 | null; contextEnabled: boolean; viewer: ViewerLike | null; scene: THREE.Scene | null; panel: DistancePanel | PropertiesPanel | null; panelCenter: THREE.Vector3 | null; panelX: number | null; panelY: number | null; panelShown: boolean; responseData: DistanceResponseData | PropertiesResponseData | null; measurementLineColor: number; connectingLineColor: number; coneLength: number | undefined; panelDragData: PanelDragData; shift: boolean; debug: boolean; constructor(viewer: ViewerLike, panel: DistancePanel | PropertiesPanel); enableContext(): void; disableContext(): void; _hideMeasurement(): void; /** * Response handler for the measure context */ handleResponse(_response?: DistanceResponseData | PropertiesResponseData): void; _createPanel(): void; _makeLines(): void; _updateConnectionLine(): void; /** * Get the maximum number of selected obj this measurement can handle */ _getMaxObjSelected(): number; /** * Wait for the backend to send the data needed to display the real BREP measurement. */ _waitResponse(resolve: (data: DistanceResponseData | PropertiesResponseData) => void, _reject: (reason?: Error) => void): void; /** * Update the measurement panel, if enough shapes have been selected for the current tool, * ask the backend for the real measurement data and display it. */ _updateMeasurement(): void; /** * React to each new selected element in the viewer. */ handleSelection: (selectedObj: PickedObject, shift?: boolean) => void; _mouseup: (e: MouseEvent) => void; _movePanel: () => void; /** * This handler is responsible to update the panel center vector when the user drag the panel on the screen. */ _dragPanel: (e: MouseEvent) => void; removeLastSelectedObj(force?: boolean): void; /** * Adjust the arrow cones scale factor to ensure they keep the same size on the screen. */ _adjustArrowsScaleFactor(zoom: number): void; update(): void; disposeArrows(): void; dispose(): void; } declare class DistanceMeasurement extends Measurement { debug: boolean; constructor(viewer: ViewerLike, debug: boolean); _createPanel(): void; _getMaxObjSelected(): number; _getPoints(): void; _makeLines(): void; _updateConnectionLine(): void; /** * Handle the response from the backend. */ handleResponse(response: DistanceResponseData): void; } declare class PropertiesMeasurement extends Measurement { debug: boolean; constructor(viewer: ViewerLike, debug: boolean); _createPanel(): void; _getMaxObjSelected(): number; _getPoint(): void; _makeLines(): void; _updateConnectionLine(): void; /** * Handle the response from the backend. */ handleResponse(response: PropertiesResponseData): void; } export { DistanceMeasurement, PropertiesMeasurement };