import { Box3, Segment } from '../utils/math3d'; import { RpcSafeClient } from './rpcSafeClient'; import { Vim } from './vim'; /** * Interface defining camera control operations in the 3D viewer * @interface */ export interface ICamera { /** * Frames all Vim models in the viewer to fit within the camera view * @param {number} [blendTime=0.5] - Animation duration in seconds * @returns {Promise} Promise resolving to the final camera position segment */ frameAll(blendTime?: number): Promise; /** * Frames a specified bounding box in the viewer * @param {Box3} box - The 3D bounding box to frame * @param {number} [blendTime=0.5] - Animation duration in seconds * @returns {Promise} Promise resolving to the final camera position segment */ frameBox(box: Box3, blendTime?: number): Promise; /** * Frames specified nodes of a Vim model in the camera view * @param {Vim} vim - The target Vim model * @param {number[] | 'all'} nodes - Array of node indices or 'all' for entire model * @param {number} [blendTime=0.5] - Animation duration in seconds * @returns {Promise} Promise resolving to the final camera position segment */ frameVim(vim: Vim, nodes: number[] | 'all', blendTime?: number): Promise; /** * Saves the current camera position for later restoration * @param {Segment} [segment] - Optional specific camera position to save */ save(segment?: Segment): void; /** * Controls the rendering state of the viewer * @param {boolean} value - True to pause, false to resume rendering */ pause(value: boolean): void; /** * Restores the camera to its previously saved position * Initially that will be the first call to a Frame method * @param {number} [blendTime=0.5] - Animation duration in seconds */ restoreSavedPosition(blendTime?: number): void; } /** * Implements camera control operations for the 3D viewer * @class */ export declare class Camera implements ICamera { private _rpc; private _lastPosition; private _interval; private _defaultBlendTime; private _savedPosition; /** * Creates a new Camera instance * @param rpc - RPC client for camera communication */ constructor(rpc: RpcSafeClient); /** * Saves the current camera position for later restoration * @param segment - Optional segment to save as the camera position */ save(segment?: Segment): Promise; /** * Resets the camera to the last saved position */ restoreSavedPosition(blendTime?: number): void; /** * Restores the camera to its last tracked position * @param blendTime - Duration of the camera animation in seconds */ restoreLastPosition(blendTime?: number): void; /** * Handles camera initialization when connection is established */ onConnect(): void; /** * Starts tracking camera position at regular intervals */ startTracking(): void; /** * Stops tracking camera position */ stopTracking(): void; /** * Updates the stored camera position * @private */ private update; /** * Pauses or resumes rendering * @param value - True to pause rendering, false to resume */ pause(value: boolean): void; /** * Frames all vims in the viewer to fit within the camera view * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5) * @returns Promise that resolves when the framing animation is complete */ frameAll(blendTime?: number): Promise; /** * Frames a specific bounding box in the viewer * @param box - The 3D bounding box to frame in the camera view * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5) */ frameBox(box: Box3, blendTime?: number): Promise; /** * Frames specific nodes of a Vim model in the camera view * @param vim - The Vim model containing the nodes to frame * @param nodes - Array of node indices to frame, or 'all' to frame the entire model * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5) * @returns Promise that resolves when the framing animation is complete */ frameVim(vim: Vim, nodes: number[] | 'all', blendTime?: number): Promise; }