import { GLRenderer, Scene, Operator, Xfo, NumberOperatorInput, XfoOperatorOutput, NumberParameter, XfoParameter, TreeItem, SelectionSet, MultiChoiceParameter, CloneContext, BaseItem, Parameter, ColorParameter, EventEmitter, BaseTool, Rect, ScreenSpaceMaterial, ZeaPointerEvent, XRControllerEvent, VRViewport, XRController, Color, GeomItem, XRPoseEvent, ZeaKeyboardEvent, ZeaMouseEvent, CADAsset, ZeaTouchEvent, Vec3, LinesMaterial, BaseGeom, Cross, Cone, Circle, Sphere, Cuboid, Lines, Ray, ZeaWheelEvent, FlatSurfaceMaterial, GLViewport, Material, MaterialColorParam, Label, BillboardItem, ParameterOwner } from '@zeainc/zea-engine'; interface AppData { renderer?: GLRenderer; scene?: Scene; sceneUnits?: string; selectionManager?: SelectionManager; session?: any; sessionSync?: any; } /** * An operator for aiming items at targets. * * @extends {Operator} */ declare class SelectionGroupXfoOperator extends Operator { currGroupXfo: Xfo; xfoModeInput: NumberOperatorInput; xfoOutput: XfoOperatorOutput; /** * Creates an instance of SelectionGroupXfoOperator. * * @param initialXfoModeParam - Initial XFO Mode, check `INITIAL_XFO_MODES` in `KinematicGroup` documentation * @param globalXfoParam - The GlobalXfo param found on the KinematicKinematicGroup. */ constructor(initialXfoModeParam: NumberParameter, globalXfoParam: XfoParameter); /** * Updates operator inputs(`OperatorInput`) of current `Operator` using the specified `TreeItem`. * * @param item - The tree item being added */ addItem(item: TreeItem): void; /** * Finds and removes the `OperatorInput` of the specified `TreeItem` from current`Operator`. * * @param item - The Bind Xfo calculated from the initial Transforms of the KinematicGroup Members. */ removeItem(item: TreeItem): void; /** * Move the group. When the selection group is manipulated, this method is called. * Here we propagate the delta to each of the selection members. * * @param xfo - The new value being set to the Groups GlobalXfo param. */ backPropagateValue(xfo: Xfo): void; /** * Calculates a new Xfo for the group based on the members. */ evaluate(): void; } /** * A specific type of `SelectionSet` class that contains/handles selection of one or more items from the scene. * * **Option parameter values** * * | Option | type | default | Description | * | --- | --- | --- | --- | * | selectionOutlineColor | `Color` | `new Color('#03e3ac'))` and opacity of `0.1` | See `Color` documentation | * | branchSelectionOutlineColor | `Color` | `new Color('#81f1d5')` and opacity of `0.55` | See `Color` documentation | * * @extends {SelectionSet} */ declare class SelectionGroup extends SelectionSet { initialXfoModeParam: MultiChoiceParameter; selectionGroupXfoOp: SelectionGroupXfoOperator; /** * Creates an instance of SelectionGroup. * * * **Parameters** * @param options - Custom options for selection */ constructor(options?: Record); /** * Returns enum of available xfo modes. * * | Name | Default | * | --- | --- | * | manual | 0 | * | first | 1 | * | average | 2 | * | globalOri | 3 | */ static get INITIAL_XFO_MODES(): { disabled: number; manual: number; first: number; average: number; globalOri: number; }; /** * Constructs a new selection group by copying the values from current one and returns it. * * @return - Cloned selection group. */ clone(context?: CloneContext): BaseItem; /** * * @param item - * @param index - * @private */ bindItem(item: TreeItem, index: number): void; /** * * @param item - * @param index - * @private */ unbindItem(item: TreeItem, index: number): void; } /** * Class representing a xfo handle. Base transformations for objects in the scene * * **Parameters** * * **HighlightColor(`ColorParameter`):** Specifies the highlight color of the handle. * * @extends TreeItem */ declare class XfoHandle extends TreeItem { param: Parameter; highlightColorParam: ColorParameter; /** * Create an axial rotation scene widget. * * @param size - The size value. * @param thickness - The thickness value. */ constructor(size?: number, thickness?: number); /** * Displays handles depending on the specified mode(Move, Rotate, Scale). * If nothing is specified, it hides all of them. * @deprecated * @param visible - The mode of the Xfo parameter */ showHandles(visible: boolean): void; /** * Sets global xfo target parameter. * * @param param - The parameter that will be modified during manipulation */ setTargetParam(param: XfoParameter): void; /** * Sets selectionGroup so this handle can modify the items. * * @param selectionGroup - The SelectionGroup. */ setSelectionGroup(selectionGroup: SelectionGroup): void; } /** * `UndoRedoManager` is a mixture of the [Factory Design Pattern](https://en.wikipedia.org/wiki/Factory_method_pattern) and the actual changes stacks manager. * This is the heart of the Undo/Redo System, letting you navigate through the changes history you've saved. * * **Events** * * **changeAdded:** Triggered when a change is added. * * **changeUpdated:** Triggered when the last change added updates its state. * * **changeUndone:** Triggered when the `undo` method is called, after removing the last change from the stack. * * **changeRedone:** Triggered when the `redo` method is called, after restoring the last change removed from the undo stack. * */ declare class UndoRedoManager extends EventEmitter { __undoStack: Change[]; __redoStack: Change[]; __currChange: Change | null; /** * It doesn't have any parameters, but under the hood it uses [EventsEmitter]() to notify subscribers when something happens. * The implementation is really simple, just initialize it like any other class. */ constructor(); /** * As the name indicates, it empties undo/redo stacks permanently, losing all stored actions. * Right now, before flushing the stacks it calls the `destroy` method on all changes, ensure to at least declare it. */ flush(): void; /** * Receives an instance of a class that extends or has the same structure as `Change` class. * When this action happens, the last added change update notifications will get disconnected. * Which implies that any future updates to changes that are not the last one, would need a new call to the `addChange` method. * Also, resets the redo stack(Calls destroy method when doing it). * * @param change - The change param. */ addChange(change: Change): void; /** * Returns the last change added to the undo stack, but in case it is empty a `null` is returned. * * @return {Change|null} The return value. */ getCurrentChange(): Change | null; /** * @param updateData */ private currChangeUpdated; /** * Rollback the latest action, passing it to the redo stack in case you wanna recover it later on. * Emits the `changeRedone` event, passing the change * @param pushOnRedoStack - The pushOnRedoStack param. */ undo(pushOnRedoStack?: boolean): void; /** * Method to cancel the current change added to the UndoRedoManager. * Reverts the change and discards it. */ cancel(): void; /** * Rollbacks the `undo` action by moving the change from the `redo` stack to the `undo` stack. * Emits the `changeRedone` event, passing the change in the event, if you want to subscribe to it. */ redo(): void; /** * Basically returns a new instance of the derived `Change` class. This is why we need the `name` attribute. * * @param className - The className param. * @return - The return value. */ constructChange(className: string): Change; /** * Checks if a class of an instantiated object is registered in the UndoRedo Factory. * * @param inst - The instance of the Change class. * @return {boolean} - Returns 'true' if the class has been registered. */ static isChangeClassRegistered(inst: Change): boolean; /** * Very simple method that returns the name of the instantiated class, checking first in the registry and returning if found, * if not then checks the `name` attribute declared in constructor. * * @param inst - The instance of the Change class. * @return {string} - The return value. */ static getChangeClassName(inst: Change): string; /** * Registers the class in the UndoRedoManager Factory. * Why do we need to specify the name of the class? * Because when the code is transpiled, the defined class names change, so it won't be known as we declared it anymore. * * @param name - The name param. * @param cls - The cls param. */ static registerChange(name: string, cls: any): void; static getInstance(): UndoRedoManager; } /** * Kind of an abstract class, that represents the mandatory structure of a change classes that are used in the [`UndoRedoManager`](). * * @note If you don't extend this class, ensure to implement all methods specified in here. * @extends {EventEmitter} */ declare class Change extends EventEmitter { name: string; secondaryChanges: Change[]; suppressPrimaryChange: boolean; closed: boolean; /** * Every class that extends from `Change` must contain a global `name` attribute. * It is used by the `UndoRedoManager` factory to re-construct the class of the specific implementation of the `Change` class. * * @param name - The name value. */ constructor(name?: string); addSecondaryChange(secondaryChange: Change): number; setPrimaryChange(primaryChange: Change): void; /** * Called by the `UndoRedoManager` in the `undo` method, and contains the code you wanna run when the undo action is triggered, * of course it depends on what you're doing. * * @note This method needs to be implemented, otherwise it will throw an Error. */ undo(): void; /** * Called by the `UndoRedoManager` in the `redo` method, and is the same as the `undo` method, contains the specific code you wanna run. * * @note This method needs to be implemented, otherwise it will throw an Error. */ redo(): void; /** * Use this method to update the state of your `Change` class. * * @note This method needs to be implemented, otherwise it will throw an Error. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Serializes the `Change` instance as a JSON object, allowing persistence/replication * * @note This method needs to be implemented, otherwise it will return an empty object. * * @param context - The appData param. */ toJSON(context: Record): Record; /** * The counterpart of the `toJSON` method, restoring `Change` instance's state with the specified JSON object. * Each `Change` class must implement the logic for reconstructing itself. * Very often used to restore from persisted/replicated JSON. * * @note This method needs to be implemented, otherwise it will do nothing. * * @param j - The j param. * @param context - The context param. */ fromJSON(j: Record, context: Record): void; /** * Method destined to clean up things that would need to be cleaned manually. * It is executed when flushing the undo/redo stacks or adding a new change to the undo stack, * so it is require in any class that represents a change. * */ destroy(): void; } /** * Represents a `Change` class for storing `Parameter` values. * * **Events** * * **updated:** Triggered when the `ParameterValueChange` value is updated. * * @extends Change */ declare class ParameterValueChange extends Change { param: Parameter; nextValue: any; prevValue: any; supressed: boolean; /** * Creates an instance of ParameterValueChange. * * @param param - The Parameter object that is modified by this change. * @param newValue - The newValue value. */ constructor(param?: Parameter, newValue?: any); /** * Rollbacks the value of the parameter to the previous one, passing it to the redo stack in case you wanna recover it later on. */ undo(): void; /** * Rollbacks the `undo` action by moving the change from the `redo` stack to the `undo` stack * and updating the parameter with the new value. */ redo(): void; /** * Updates the state of the current parameter change value. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Serializes `Parameter` instance value as a JSON object, allowing persistence/replication. * * @param context - The context param. * @return {object} The return value. */ toJSON(context: Record): Record; /** * Restores `Parameter` instance's state with the specified JSON object. * * @param j - The j param. * @param context - The context param. */ fromJSON(j: Record, context: Record): Record; } /** * Represents a `Change` class for storing `Selection` values. * * @extends Change */ declare class SelectionChange extends Change { __selectionManager: SelectionManager; __prevSelection: Set; __newSelection: Set; /** * Creates an instance of SelectionChange. * * @param selectionManager - The selectionManager value. * @param prevSelection - The prevSelection value. * @param newSelection - The newSelection value. */ constructor(selectionManager: SelectionManager, prevSelection: Set, newSelection: Set); /** * Sets the state of selections to the previous list of items selected. */ undo(): void; /** * Restores the state of the selections to the latest the list of items selected. */ redo(): void; /** * Serializes selection values as a JSON object, allowing persistence/replication. * * @param context - The appData param. * @return {object} The return value. */ toJSON(context: Record): Record; /** * Restores selection state from a JSON object. * * @param j - The j param. * @param context - The context param. */ fromJSON(j: Record, context: Record): void; } /** * Class representing a change of visibility state for selected items. * * @extends Change */ declare class SelectionVisibilityChange extends Change { selection: Set; state: boolean; /** * Create a toggle selection visibility. * * @param selection - The selection value. * @param state - The state value. */ constructor(selection: Set, state: boolean); /** * Restores previous visibility status of the selected items */ undo(): void; /** * Recreates previous visibility status of the selected items */ redo(): void; /** * Changes items visibility. * * @param state - The state param. * @private */ _changeItemsVisibility(state: boolean): void; } /** * Class representing an `Add TreeItem` Change. Meaning that this should be called when you add a new `TreeItem` to the scene. * * @extends Change */ declare class TreeItemAddChange extends Change { treeItem: TreeItem; owner: TreeItem; prevSelection: Set; selectionManager: SelectionManager; treeItemIndex: number; /** * Creates an instance of TreeItemAddChange. * * @param treeItem - * @param owner - * @param selectionManager - */ constructor(treeItem: TreeItem, owner: TreeItem, selectionManager: SelectionManager); /** * Removes the newly added TreeItem from its owner. */ undo(): void; /** * Restores undone `TreeItem`. */ redo(): void; /** * Serializes `TreeItem` like instanced class into a JSON object. * * @param context - The context treeItem * @return {object} - JSON object */ toJSON(context: Record): Record; /** * Reconstructs `TreeItem` like parameter from JSON object. * * @param j -The j treeItem * @param context - The context treeItem */ fromJSON(j: Record, context: Record): void; /** * Removes reference of the `TreeItem` from current change. */ destroy(): void; } /** * Class representing a `Move TreeItem` Change(Moving a TreeItem from one parent to another). * * @extends Change */ declare class TreeItemMoveChange extends Change { treeItem: TreeItem; oldOwner: TreeItem; oldOwnerIndex: number; newOwner: TreeItem; /** * Creates an instance of TreeItemMoveChange. * * @param treeItem - The item to move. * @param newOwner - The new owner item. * @memberof TreeItemMoveChange */ constructor(treeItem: TreeItem, newOwner: TreeItem); /** * Inserts back the moved TreeItem in the old owner item(Rollbacks the move action). */ undo(): void; /** * Executes the move action inserting the TreeItem back to the new owner item. */ redo(): void; /** * Returns a JSON object with the specifications of the change(Typically used for replication). * * @param context - The context value * @return {object} - JSON object of the change */ toJSON(context: Record): Record; /** * Restores the Change state from the specified JSON object. * * @param j - The serialized object with the change data. * @param context - The context value */ fromJSON(j: Record, context: Record): void; } /** * Class representing a TreeItems removal Change, * taking into account that it would remove all the specified items ti their children * * @extends Change */ declare class TreeItemsRemoveChange extends Change { private items; private itemOwners; private itemPaths; private itemIndices; /** * Creates an instance of TreeItemsRemoveChange. * * @param items - List of TreeItems * @param appData - The appData value */ constructor(items: Array, appData: AppData); /** * Restores all items removed in the change, reattaching them to their old owners. */ undo(): void; /** * Executes initial change to remove items from their owners. */ redo(): void; /** * Serializes current change data as a JSON object, so this action can be stored/replicated somewhere else. * * @param appData - The appData value * @return {object} - JSON Object representation of current change * @memberof TreeItemsRemoveChange */ toJSON(context?: Record): Record; /** * Restores Change action from a JSON object. * * @param j - The JSON object with Change data. * @param appData - The appData value * @memberof TreeItemsRemoveChange */ fromJSON(j: Record, context: Record): void; } /** * Represents a `Change` class for storing `Parameter` values. * * **Events** * * **updated:** Triggered when the `SelectionXfoChange` value is updated. * * @extends Change */ declare class SelectionXfoChange extends Change { supressed: boolean; treeItems: TreeItem[]; baseXfo: Xfo; localXfos: Xfo[]; prevValues: Xfo[]; newValues: Xfo[]; /** * Creates an instance of SelectionXfoChange. * * @param param - The Parameter object that is modified by this change. * @param newValue - The newValue value. */ constructor(treeItems: TreeItem[], baseXfo: Xfo); setDeltaXfo(delta: Xfo): void; setDone(): void; /** * Rollbacks the value of the parameter to the previous one, passing it to the redo stack in case you wanna recover it later on. */ undo(): void; /** * Rollbacks the `undo` action by moving the change from the `redo` stack to the `undo` stack * and updating the parameter with the new value. */ redo(): void; /** * Updates the state of the current parameter change value. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Serializes `Parameter` instance value as a JSON object, allowing persistence/replication. * * @param context - The context param. * @return {object} The return value. */ toJSON(context: Record): Record; /** * Restores `Parameter` instance's state with the specified JSON object. * * @param j - The j param. * @param context - The context param. */ fromJSON(j: Record, context: Record): void; } /** * Class representing a selection manager * * **Events** * **leadSelectionChanged:** Triggered when selecting one item. * **selectionChanged:** Triggered when the selected objects change. * * @extends {EventEmitter} */ declare class SelectionManager extends EventEmitter { appData: AppData; leadSelection: TreeItem; selectionGroup: SelectionGroup; xfoHandle: XfoHandle; xfoHandleVisible: boolean; renderer: GLRenderer; pickFilter: (treeItem: TreeItem) => TreeItem; pickCB: (treeItem: TreeItem) => void; /** * Creates an instance of SelectionManager. * * @param appData - The options object. * @param [options={}] - The appData value. * enableXfoHandles - enables display Xfo Gizmo handles when items are selected. * selectionOutlineColor - enables highlight color to use to outline selected items. * branchSelectionOutlineColor - enables highlight color to use to outline selected items. */ constructor(appData: AppData, options?: any); /** * Adds specified the renderer to the `SelectionManager` and attaches the `SelectionGroup`. * * @param renderer - The renderer param. */ setRenderer(renderer: GLRenderer): void; /** * Sets initial Xfo mode of the selection group. * * @see `KinematicGroup` class documentation * * @param mode - The Xfo mode */ setXfoMode(mode: number): void; /** * Displays handles depending on the specified mode(Move, Rotate, Scale). * If nothing is specified, it hides all of them. * @deprecated * @param enabled - The mode of the Xfo parameter */ showHandles(enabled: boolean): void; /** * Determines if the Xfo Manipulation handle should be displayed or not. */ updateHandleVisibility(): void; /** * Returns an array with the selected items. * * @return - The return value. */ getSelection(): Set; /** * Sets a new selection of items in the `SelectionManager` * * @param newSelection - The newSelection param * @param [createUndo=true] - The createUndo param */ setSelection(newSelection: Set, createUndo?: boolean, parentChange?: Change): void; /** * @param treeItem - The treeItem value */ private setLeadSelection; /** * The toggleItemSelection method. * * @param treeItem - The treeItem param. * @param replaceSelection - The replaceSelection param. */ toggleItemSelection(treeItem: TreeItem, replaceSelection?: boolean, createUndo?: boolean, parentChange?: Change): void; /** * Clears selection state by removing previous selected items and the Xfo handlers. * * @param createUndo - The createUndo param. * @return {boolean} - The return value. */ clearSelection(createUndo?: boolean, parentChange?: Change): void; /** * Selects the specified items replacing previous selection or concatenating new items to it. * * @param treeItems - The treeItems param. * @param replaceSelection - The replaceSelection param. */ selectItems(treeItems: Set, replaceSelection?: boolean, createUndo?: boolean, parentChange?: Change): void; /** * Deselects the specified items from the selection group. * * @param treeItems - The treeItems param. */ deselectItems(treeItems: Set, createUndo?: boolean, parentChange?: Change): void; /** * The startPickingMode method. * * @param label - The label param. * @param fn - The fn param. * @param filterFn - The filterFn param. * @param count - The count param. */ startPickingMode(fn: (treeItem: TreeItem) => void, filterFn: (treeItem: TreeItem) => TreeItem | null): void; /** * The pickingModeActive method. * * @return {boolean} The return value. */ pickingModeActive(): boolean; /** * The endPickingMode method. */ endPickingMode(): void; /** * The pick method. * @param item - The item param. */ pick(item: TreeItem | Array): void; } /** * Class representing a selection tool. * * @extends BaseTool */ declare class SelectionTool extends BaseTool { private appData; private dragging; private selectionManager; private selectionRectXfo; private rectItem; private pointerDownPos; selectionRect: Rect; selectionRectMat: ScreenSpaceMaterial; selectionFilterFn: (treeItem: TreeItem) => TreeItem | null; /** * Creates an instance of SelectionTool. * * @param appData - The appData value */ constructor(appData: AppData); /** * Activates selection tool. */ activateTool(): void; /** * Deactivates the selection tool. */ deactivateTool(): void; /** * Activates selection tool. */ setSelectionManager(selectionManager: SelectionManager): void; setSelectionFilter(fn: (treeItem: TreeItem) => TreeItem | null): void; /** * * * @param viewport - The viewport value * @param delta - The delta value */ private resizeRect; /** * * * @param event - The event param. * @private */ onPointerDoublePress(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is pressed while the pointer is over the tool. * * @param event - The event param. * @return {boolean} The return value. */ onPointerDown(event: ZeaPointerEvent): void; /** * Event fired when a pointing device is moved while the cursor's hotspot is inside it. * * @param event - The event param. * @return {boolean} The return value. */ onPointerMove(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is released while the pointer is over the tool. * * @param event - The event param. * @return {boolean} The return value. */ onPointerUp(event: ZeaPointerEvent): void; /** * Event fired when a VR controller button is pressed over a tool. * * @param event - The event param. * @return {boolean} The return value. */ onXRControllerButtonDown(event: XRControllerEvent): void; } declare class PointerTool extends BaseTool { protected appData: AppData; protected vrViewport: VRViewport; protected prevCursor: string; pointerController: XRController; pointerThickness: number; pointerColor: Color; private geom; private material; protected defaultRaycastDist: number; raycastDist: number; protected bindControllerId: number; protected pointerGeomItems: GeomItem[]; constructor(appData: AppData); /** * Enables tools usage. This method is called by either the Viewport when a tool is removed, or the ToolManage if it is installed. */ activateTool(): void; /** * The deactivateTool method. */ deactivateTool(): void; protected displayPointers(): void; /** * The deactivateTool method. */ removePointers(): void; protected setPointerLength(length: number, controller: XRController): void; protected checkPointerIntersection(controller: XRController): void; /** * Event fired when a pointing device is moved * * @param event - The event param. */ onPointerMove(event: ZeaPointerEvent): void; } interface UIIntersection { clientX: number; clientY: number; } /** * Class representing a VR UI tool. * * @extends BaseTool */ declare class VRUITool extends PointerTool { private vrUIDOMElement; private controllerUI; private uiOpen; private uiOpenedByMouse; private triggerHeld; private visibilityStates; private uiController; private element; private listenerIds; openUIKeyboardHotkey: string; openUiAngleTolerance: number; /** * Create a VR UI tool. * @param appData - The appData value. * @param vrUIDOMElement - The dom element we will use as the VR UI */ constructor(appData: AppData, vrUIDOMElement: HTMLElement); /** * The getName method. * * @return {string} The return value. */ getName(): string; /** * The activateTool method. */ activateTool(): void; /** * The deactivateTool method. */ deactivateTool(): void; /** * The openUI method. * @param uiController - The uiController param. * @param : VRController - The pointerController param. * @param headXfo - The headXfo param. */ openUI(uiController: XRController, pointerController: XRController): void; private childAdded; private restoreVisibility; /** * The closeUI method. */ closeUI(): void; private calcUIIntersection; private getDOMElementFromPoint; /** * The sendEventToUI method. * @param eventName - The eventName param. * @param args - The args param. * @return The return value. */ sendEventToUI(controller: XRController, element: Element, eventName: string, hit: UIIntersection, args?: Record): void; /** * The onXRControllerButtonDown method. * @param event - The event param. */ onPointerDown(event: XRControllerEvent): void; /** * Event fired when a pointing device button is clicked. * * @param event - The event param. */ onPointerClick(event: ZeaPointerEvent): void; onPointerDoubleClick(event: ZeaPointerEvent): void; /** * The onVRControllerButtonUp method. * @param event - The event param. */ onPointerUp(event: ZeaPointerEvent): void; /** * The onXRPoseChanged method. * @param event - The event param. */ onPointerMove(event: XRPoseEvent): void; /** * Event fired when the user presses down a key on the keyboard. * * @param event - The event param. */ onKeyDown(event: ZeaKeyboardEvent): void; /** * Event fired when the user releases a key on the keyboard. * * @param event - The event param. */ onKeyUp(event: ZeaKeyboardEvent): void; } /** * Class representing a VR hold objects tool. * @extends BaseTool */ declare class VRHoldObjectsTool extends PointerTool { treeWalkSteps: number; smoothFactor: number; private pressedButtonCount; private vrControllers; private heldObjectCount; private heldTreeItems; private highlighteTreeItemIds; private heldTreeItemItemIds; private heldTreeItemItemRefs; private heldTreeItemItemOffsets; private change; private prevUpdateGrabXfos; /** * Create a VR hold objects tool. * @param appData - The appData value. */ constructor(appData: AppData); /** * The computeGrabXfo method. * @param refs - The refs param. * @return {Xfo} The return value. */ computeGrabXfo(refs: number[]): Xfo; /** * The initAction method. */ initAction(): void; /** * Event fired when a pointing device button is pressed * * @param event - The event param. */ onPointerDown(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is released while the pointer is over the tool. * * @param event - The event param. */ onPointerUp(event: ZeaPointerEvent): void; onPointerClick(event: ZeaPointerEvent): void; /** * Event fired when a pointing device is moved * * @param event - The event param. */ onPointerMove(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is double clicked on the tool. * * @param event - The event param. */ onPointerDoublePress(event: ZeaMouseEvent): void; } declare class HandHeldTool extends BaseTool { appData: AppData; cadAsset: CADAsset; toolController: XRController; constructor(assetUrl: string, offsetXfo: Xfo, appData: AppData); /** * Enables tools usage. This method is called by either the Viewport when a tool is removed, or the ToolManage if it is installed. */ activateTool(): void; /** * Disables tool usage. This method is called by either the Viewport when a tool is removed, or the ToolManage if it is installed. */ deactivateTool(): void; /** * Event fired when either the mouse button is pressed, or a touch start event occurs. * * @param event - The event param. */ onPointerDown(event: ZeaPointerEvent): void; /** * Event fired when either the mouse cursor is moved, or a touch point moves. * * @param event - The event param. */ onPointerMove(event: ZeaPointerEvent): void; /** * Event fired when either the mouse button is released, or a touch end event occurs. * * @param event - The event param. */ onPointerUp(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is clicked. * * @param event - The event param. */ onPointerClick(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is double clicked. * * @param event - The event param. */ onPointerDoubleClick(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is held for a long time.. * * @param event - The event param. */ onPointerLongPress(event: ZeaPointerEvent): void; /** * Event fired when a mouse pointer enters the viewport * * @param event - The event param. */ onPointerEnter(event: ZeaPointerEvent): void; /** * Event fired when a mouse pointer leaves the viewport * * @param event - The event param. */ onPointerLeave(event: ZeaPointerEvent): void; /** * Event fired when the user rotates the pointing device wheel. * * @param event - The event param. */ onWheel(event: ZeaPointerEvent): void; /** * Event fired when the user presses down a key on the keyboard. * * @param event - The event param. */ onKeyDown(event: ZeaKeyboardEvent): void; /** * Event fired when the user releases a key on the keyboard. * * @param event - The event param. */ onKeyUp(event: ZeaKeyboardEvent): void; /** * Event fired when one or more touch points have been disrupted in an implementation-specific manner. * * @param event - The event param. */ onTouchCancel(event: ZeaTouchEvent): void; } /** * @extends BaseTool */ declare class ToolManager extends BaseTool { toolStack: BaseTool[]; tools: Record; constructor(); registerTool(toolName: string, tool: BaseTool): void; insertTool(tool: string | BaseTool, index: number): void; removeTool(tool: string | BaseTool): void; pushTool(tool: string | BaseTool): void; popTool(): void; /** * Returns the tool currently at the top of the stack. * @return - the currently active tool. */ activeTool(): BaseTool | undefined; /** * Returns the name of the tool currently at the top of the stack. * @return - the name of the tool. */ activeToolName(): string; /** * Event fired when a pointing device button is pressed while the pointer is over the tool. * * @param event - The event param. */ onPointerDown(event: ZeaMouseEvent): void; /** * Event fired when a pointing device is moved while the cursor's hotspot is inside it. * * @param event - The event param. */ onPointerMove(event: ZeaMouseEvent): void; /** * Event fired when a pointing device button is released while the pointer is over the tool. * * @param event - The event param. */ onPointerUp(event: ZeaMouseEvent): void; /** * Event fired when a pointing device button is released and released in the same location. * * @param event - The event param. */ onPointerClick(event: ZeaMouseEvent): void; /** * Event fired when a pointing device button is double clicked on the tool. * * @param event - The event param. */ onPointerDoubleClick(event: ZeaMouseEvent): void; /** * Event fired when the user rotates the pointing device wheel. * * @param event - The event param. */ onWheel(event: ZeaMouseEvent): void; /** * Event fired when the user presses down a key on the keyboard. * * @param event - The event param. */ onKeyDown(event: ZeaKeyboardEvent): void; /** * Event fired when the user releases a key on the keyboard. * * @param event - The event param. */ onKeyUp(event: ZeaKeyboardEvent): void; } declare class DropUserTool extends PointerTool { private toolManager; private dropAvatar; private floorPlane; faceUserTowardsSceneCenter: boolean; sceneCenter: Vec3; constructor(appData: AppData, toolManager: ToolManager); /** * Enables tools usage. This method is called by either the Viewport when a tool is removed, or the ToolManage if it is installed. */ activateTool(): void; /** * The deactivateTool method. */ deactivateTool(): void; /** * Event fired when a pointing device is moved * * @param event - The event param. */ onPointerMove(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is clicked. * * @param event - The event param. */ onPointerDown(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is double clicked. * * @param event - The event param. */ onPointerDoubleClick(event: ZeaPointerEvent): void; } /** * Class representing a primary create tool. * * @extends BaseTool */ declare class BaseCreateTool extends BaseTool { appData: AppData; /** * Creates an instance of BaseCreateTool. * * @param appData - The appData value. */ constructor(appData: AppData); } /** * Base class for creating geometry tools. * * @extends BaseCreateTool */ declare class CreateGeomTool extends BaseCreateTool { stage: number; removeToolOnRightClick: boolean; parentItem: TreeItem; colorParam: ColorParameter; vrControllerToolTipMat: LinesMaterial; vrControllerToolTip: BaseGeom | Cross; prevCursor: string; constructionPlane: Xfo; private activeController; /** * Create a create geom tool. * * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Adds a geometry icon to the VR Controller * @param controller - The controller object. */ addIconToVRController(controller: XRController): void; controllerAddedHandler(event: { controller: any; }): void; /** * The activateTool method. */ activateTool(): void; /** * The deactivateTool method. */ deactivateTool(): void; private setupConstructionPlane; /** * Transforms the screen position in the viewport to an Xfo object. * * @param event - The event param * @return {Xfo} The return value. */ screenPosToXfo(event: ZeaMouseEvent | ZeaTouchEvent, snapToSurfaceUnderPointer?: boolean): Xfo; /** * Starts the creation of the geometry. * * @param xfo - The xfo param. */ protected createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * The createPoint method. * * @param pt - The pt param. */ protected createPoint(pt: Vec3, event?: ZeaPointerEvent): void; /** * The createMove method. * * @param pt - The pt param. */ protected createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * The createRelease method. * * @param pt - The pt param. */ protected createRelease(pt: Vec3, event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is pressed over the viewport while the tool is activated. * * @param event - The event param. */ onPointerDown(event: ZeaPointerEvent): void; /** * Event fired when a pointing device is moved while the cursor's hotspot is inside the viewport, while tool is activated. * * @param event - The event param. */ onPointerMove(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is released while the pointer is over the viewport, while the tool is activated. * * @param event - The event param. */ onPointerUp(event: ZeaPointerEvent): void; /** * Event fired when the user rotates the pointing device wheel, while the tool is activated. * * @param event - The event param. */ onWheel(event: ZeaPointerEvent): void; /** * Event fired when the user presses a key on the keyboard, while the tool is activated. * * @param event - The event param. */ onKeyPressed(event: ZeaKeyboardEvent): void; /** * Event fired when the user presses down a key on the keyboard, while the tool is activated. * * @param event - The event param. */ onKeyDown(event: ZeaKeyboardEvent): void; /** * Event fired when the user releases a key on the keyboard. * * @param event - The event param. */ onKeyUp(event: ZeaKeyboardEvent): void; /** * Event fired when one or more touch points have been disrupted in an implementation-specific manner inside the viewport, when the tool is activated. * * @param event - The event param. */ onTouchCancel(event: ZeaPointerEvent): void; /** * Event fired when a VR controller button is pressed inside the viewport, when the tool is activated. * * @param event - The event param. */ onXRControllerButtonDown(event: XRControllerEvent): void; /** * The onXRPoseChanged method. * * @param event - The event param. */ onXRPoseChanged(event: XRPoseEvent): void; /** * Event fired when a VR controller button is released inside the viewport, when the tool is activated. * * @param event - The event param. */ onVRControllerButtonUp(event: XRControllerEvent): void; } /** * Class representing a create geom change. * * @extends Change */ declare class CreateGeomChange extends Change { parentItem: TreeItem; geomItem: GeomItem; childIndex: number; xfo: Xfo; color: Color; /** * Create a create circle change. * @param name - The name value. */ constructor(name: string, parentItem: TreeItem, xfo: Xfo, color?: Color); protected createGeomItem(): void; /** * Removes recently created geometry from its parent. */ undo(): void; /** * Restores recently created geometry and adds it to the specified parent tree item. */ redo(): void; /** * Serializes the change as a JSON object. * * @param context - The context value * @return - The serialized change */ toJSON(context?: Record): Record; /** * Restores geometry from using the specified JSON * * @param j - The j param. * @param context - The appData param. */ fromJSON(j: Record, context: Record): void; } /** * Tool for creating a line tool. * * **Events** * * **actionFinished:** Triggered when the creation of the geometry is completed. * * @extends CreateGeomTool */ declare class CreateLineTool extends CreateGeomTool { lineThickness: NumberParameter; change: CreateGeomChange; length: number; xfo: Xfo; /** * Create a create line tool. * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Starts line geometry creation. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updates line structural data. * * @param pt - The pt param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * Finishes Line geometry creation. * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; /** * The onXRControllerButtonDown method. * * @param event - The event param. */ onXRControllerButtonDown(event: XRControllerEvent): void; } declare class CreateMultiLineTool extends CreateGeomTool { change: CreateGeomChange; length: number; inverseXfo: Xfo; vertices: Vec3[]; distanceToSnap: number; pointerVertex: Vec3; tailVertex: Vec3; lastClickTime: number; lastClickPt: Vec3; doubleClickTime: number; doubleClickMaxDistance: number; /** * Create a create line tool. * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Starts line geometry creation. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updates line structural data. * * @param pt - The pt param. * @param event - The event param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; snapToClosestAxis(vertex: Vec3): Vec3; /** * Add vertex or finish Line geometry creation. * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; protected shouldClosePolygon(event: ZeaPointerEvent): boolean; onKeyUp(event: ZeaKeyboardEvent): void; resetTool(): void; /** * The onXRControllerButtonDown method. * * @param event - The event param. */ onXRControllerButtonDown(event: XRControllerEvent): void; } /** * Class representing a create cone change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateConeChange extends CreateGeomChange { cone: Cone; /** * Create a create cone change. * * @param parentItem - The parentItem value. * @param xfo - The xfo value. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color); protected createGeomItem(): void; /** * Updates cone with the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; } /** * Tool for creating a Cone geometry. * * **Events** * * **actionFinished:** Triggered when the creation of the geometry is completed. * * @extends CreateGeomTool */ declare class CreateConeTool extends CreateGeomTool { xfo: Xfo; invXfo: Xfo; change: CreateConeChange; radius: number; height: number; /** * Create a create cone tool. * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Starts the creation of the geometry. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updates Cone geometry structural properties. * * @param pt - The pt param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * Finishes the creation of the Cone. * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; } /** * Class representing a create circle change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateCircleChange extends CreateGeomChange { circle: Circle; /** * Creates an instance of CreateCircleChange. * * @param parentItem - The parentItem value. * @param xfo - The xfo value. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color); protected createGeomItem(): void; /** * Updates circle with the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Serializes change as a JSON object. * * @return - The return value. */ toJSON(): Record; } /** * Tool for creating a circle geometry. * * **Events** * * **actionFinished:** Triggered when the creation of the geometry is completed. * * @extends CreateGeomTool */ declare class CreateCircleTool extends CreateGeomTool { change: CreateCircleChange; xfo: Xfo; radius: number; /** * Create a create circle tool. * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Starts the creation of the geometry. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updates Circle geometry radius. * * @param pt - The pt param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * Finishes geometry creation. * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; } /** * Class representing a create rect change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateRectChange extends CreateGeomChange { rect: Rect; /** * Create a create rect change. * * @param parentItem - The parentItem value. * @param xfo - The xfo value. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color); protected createGeomItem(): void; /** * Updates rectangle with the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; } /** * Tool for creating a rectangle geometry. * * **Events** * * **actionFinished:** Triggered when the creation of the geometry is completed. * * @extends CreateGeomTool */ declare class CreateRectTool extends CreateGeomTool { change: CreateRectChange; xfo: Xfo; invXfo: Xfo; size: number; /** * Create a create rect tool. * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Starts the creation of a rectangle geometry. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updated the rectangle geometry structural properties. * * @param pt - The pt param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * Finishes the creation of a rectangle geometry. * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; } /** * Tool for creating a free hand line. * * **Events** * * **actionFinished:** Triggered when the creation of the geometry is completed. * * @extends CreateLineTool */ declare class CreateFreehandLineTool extends CreateLineTool { private invXfo; private prevPointerPos; drawLineOnSurface: boolean; /** * Create a create freehand line tool. * * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); screenPosToXfo(event: ZeaMouseEvent | ZeaTouchEvent): Xfo; /** * Starts the creation of a free hand line. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updates the free hand line data. * * @param pt - The pt param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * Finishes free hand line creation * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; } /** * Class representing a create sphere change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateSphereChange extends CreateGeomChange { sphere: Sphere; /** * Create a create sphere change. * @param parentItem - The parentItem value. * @param xfo - The xfo value. * @param color - The color of the sphere to create. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color); protected createGeomItem(): void; /** * Updates sphere geometry using the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Serializes sphere geometry as a JSON object. * * @return {object} The return value. */ toJSON(): Record; } /** * Tool for creating Sphere geometries. * * **Events** * * **actionFinished:** Triggered when the creation of the geometry is completed. * * @extends CreateGeomTool */ declare class CreateSphereTool extends CreateGeomTool { change: CreateSphereChange; xfo: Xfo; radius: number; /** * Create a create sphere tool. * * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Starts the creation of the sphere geometry. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updates the sphere geometry structural properties. * * @param pt - The pt param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * Finishes the creation of the sphere geometry. * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; } /** * Class representing a create cuboid change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateCuboidChange extends CreateGeomChange { cuboid: Cuboid; /** * Create a create cuboid change. * * @param parentItem - The parentItem value. * @param xfo - The xfo value. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color); protected createGeomItem(): void; /** * Updates cuboid using the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; } /** * Tool for creating Cuboid geometry. * * **Events** * * **actionFinished:** Triggered when the creation of the geometry is completed. * * @extends CreateGeomTool */ declare class CreateCuboidTool extends CreateGeomTool { change: CreateCuboidChange; xfo: Xfo; invXfo: Xfo; height: number; pt1: Vec3; /** * Create a create cuboid tool. * * @param appData - The appData value. */ constructor(appData: AppData, parentItem: TreeItem); /** * Starts the creation of the cuboid. * * @param xfo - The xfo param. */ createStart(xfo: Xfo, event: ZeaPointerEvent): void; /** * Updates cuboid structural properties. * * @param pt - The pt param. */ createMove(pt: Vec3, event: ZeaPointerEvent): void; /** * Finishes the creation of the cuboid. * * @param pt - The pt param. */ createRelease(pt: Vec3, event: ZeaPointerEvent): void; } /** * Class representing a create freehand line change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateFreehandLineChange extends CreateGeomChange { thickness: number; vertexCount: number; used: number; line: Lines; /** * Create a create freehand line change. * * @param parentItem - The parentItem value. * @param xfo - The xfo value. * @param color - The color value. * @param thickness - The thickness value. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color, thickness?: number); protected createGeomItem(): void; /** * Updates free hand line using the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Serializes change as a JSON object. * * @param context - The appData param. * @return {object} The return value. */ toJSON(context: Record): Record; /** * Restores free hand line from a JSON object. * * @param j - The j param. * @param context - The appData param. */ fromJSON(j: Record, context: Record): void; } /** * Class representing a create line change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateLineChange extends CreateGeomChange { thickness: number; line: Lines; /** * Create a create line change. * * @param parentItem - The parentItem value. * @param xfo - The xfo value. * @param color - The color value. * @param thickness - The thickness value. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color, thickness?: number); protected createGeomItem(): void; /** * Updates Line using the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Restores line geometry using a JSON object. * * @param j - The j param. * @param context - The context param. */ fromJSON(j: Record, context: Record): void; } /** * Class representing a create line change. * * **Events** * * **updated:** Triggered when the change is updated * * @extends CreateGeomChange */ declare class CreateMultiLineChange extends CreateGeomChange { line: Lines; stage: number; vertices: Vec3[]; /** * Create a create line change. * * @param parentItem - The parentItem value. * @param xfo - The xfo value. * @param color - The color value. * @param thickness - The thickness value. */ constructor(parentItem: TreeItem, xfo: Xfo, color: Color); protected createGeomItem(): void; addVertex(pt: Vec3): void; /** * Updates Line using the specified data. * * @param updateData - The updateData param. */ update(updateData: Record): void; /** * Restores line geometry using a JSON object. * * @param j - The j param. * @param context - The context param. */ fromJSON(j: Record, context: Record): void; } declare class DeleteGeomsTool extends PointerTool { private change; private highlightedGeom; private highlightColor; pointerButton: number; constructor(appData: AppData); activateTool(): void; private handleGeometryIntersection; onPointerDown(event: ZeaPointerEvent): void; protected checkPointerIntersection(controller: XRController): void; onPointerMove(event: ZeaPointerEvent): void; onPointerUp(event: ZeaPointerEvent): void; } /** * A Handle is an UI widget that lives in the scene, it translates a series of pointer events into a higher level interaction. * * **Parameters** * * **Color(`ColorParameter`):** Specifies the color of the handle. * * **HighlightColor(`ColorParameter`):** Specifies the highlight color of the handle. * * @extends TreeItem */ declare class Handle extends TreeItem { gizmoRay: Ray; activeController: any; captured: boolean; colorParam: ColorParameter; highlightColorParam: ColorParameter; grabPos: Vec3; holdPos: Vec3; holdDist: number; value: number | Vec3 | number[]; delta: number | Vec3 | number[]; releasePos: Vec3; /** * Creates an instance of Handle. * * @param name - The name value. */ constructor(name?: string); /** * highlight the handle to indicate it is under the mouse. */ highlight(): void; /** * Removes the highlight from the handle once the mouse moves away. */ unhighlight(): void; /** * Returns the manipulation plane of the handle, denoting a start and a direction. * * @return {Ray} The return value. */ getManipulationPlane(): Ray; /** * Event fired when a pointing device is initially moved within the space of the handle. * * @param event - The event param. */ onPointerEnter(event: ZeaPointerEvent): void; /** * Event fired when a pointing device moves outside of the space of the handle. * * @param event - The event param. */ onPointerLeave(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is pressed while the pointer is over the handle element. * * @param event - The event param. */ onPointerDown(event: ZeaPointerEvent): void; /** * Event fired when a pointing device is moved while the cursor's hotspot is over the handle. * * @param event - The event param. */ onPointerMove(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is released while the pointer is over the handle. * * @param event - The event param. */ onPointerUp(event: ZeaPointerEvent): void; onPointerClick(event: ZeaPointerEvent): void; onPointerDoubleClick(event: ZeaPointerEvent): void; /** * Event fired when the user rotates the pointing device wheel over the handle. * * @param event - The event param. */ onWheel(event: ZeaWheelEvent): void; /** * Handles mouse down interaction with the handle. * * @param event - The event param. */ handlePointerDown(event: ZeaPointerEvent): void; /** * Handles mouse move interaction with the handle. * * @param event - The event param */ handlePointerMove(event: ZeaPointerEvent): void; /** * Handles mouse up interaction with the handle. * * @param event - The event param. */ handlePointerUp(event: ZeaPointerEvent): void; /** * Event fired when a VR controller button is pressed over the handle. * * @param event - The event param. */ onXRControllerButtonDown(event: XRControllerEvent): void; /** * The onXRPoseChanged method. * * @param event - The event param. */ onXRPoseChanged(event: XRPoseEvent): void; /** * Event fired when a VR controller button is released over the handle. * * @param event - The event param. */ onVRControllerButtonUp(event: XRControllerEvent): void; /** * Handles the initially drag of the handle. * * @param event - The event param. */ onDragStart(event: ZeaPointerEvent): void; /** * Handles drag action of the handle. * * @param event - The event param. */ onDrag(event: ZeaPointerEvent): void; /** * Handles the end of dragging the handle. * * @param event - The event param. */ onDragEnd(event?: ZeaPointerEvent): void; /** * Sets the target parameter for manipulation * * @param param - The parameter that will be modified during manipulation */ setTargetParam(param: Parameter): void; } /** * Class representing a base linear movement scene widget. * * @extends Handle */ declare class BaseLinearMovementHandle extends Handle { grabDist: number; /** * Create base linear movement scene widget. * @param name - The name value. */ constructor(name: string); /** * Handles mouse down interaction with the handle. * * @param event - The event param. */ handlePointerDown(event: ZeaPointerEvent): void; /** * Handles mouse move interaction with the handle. * * @param event - The event param */ handlePointerMove(event: ZeaPointerEvent): void; /** * Handles mouse up interaction with the handle. * * @param event - The event param. */ handlePointerUp(event: ZeaPointerEvent): void; /** * Event fired when a VR controller button is pressed over the handle. * * @param event - The event param. */ onXRControllerButtonDown(event: XRControllerEvent): void; /** * The onXRPoseChanged method. * * @param event - The event param. */ onXRPoseChanged(event: XRPoseEvent): void; /** * Event fired when a VR controller button is released over the handle. * * @param event - The event param. * @return - The return value. */ onVRControllerButtonUp(event: XRControllerEvent): void; } /** * Class representing a linear movement scene widget. * * @extends BaseLinearMovementHandle */ declare class LinearMovementHandle extends BaseLinearMovementHandle { private handleMat; private baseXfo; private change; param: XfoParameter; selectionGroup: SelectionGroup; /** * Create a linear movement scene widget. * * @param name - The name value. * @param length - The length value. * @param thickness - The thickness value. * @param color - The color value. */ constructor(name?: string, length?: number, thickness?: number, color?: Color); /** * highlight the handle to indicate it is under the mouse. */ highlight(): void; /** * Removes the highlight from the handle once the mouse moves away. */ unhighlight(): void; /** * Sets selectionGroup so this handle can modify the items. * * @param selectionGroup - The SelectionGroup. */ setSelectionGroup(selectionGroup: SelectionGroup): void; /** * Sets the target parameter for this manipulator. * This parameter will be modified by interactions on the manipulator. * * @param param - The parameter that will be modified during manipulation */ setTargetParam(param: Parameter): void; /** * Returns target's global xfo parameter. * * @return - returns handle's target global Xfo. */ getTargetParam(): XfoParameter; /** * Handles the initially drag of the handle. * * @param event - The event param. */ onDragStart(event: ZeaPointerEvent): void; /** * Handles drag action of the handle. * * @param event - The event param. */ onDrag(event: ZeaPointerEvent): void; /** * Handles the end of dragging the handle. * * @param event - The event param. */ onDragEnd(event: ZeaPointerEvent): void; } /** * Class representing a planar movement scene widget. * * @extends Handle */ declare class PlanarMovementHandle extends Handle { param: Parameter; private fullXfoManipulationInVR; private grabOffset; private baseXfo; private change; selectionGroup: SelectionGroup; /** * Create a planar movement scene widget. * * @param name - The name value. */ constructor(name: string); /** * Sets selectionGroup so this handle can modify the items. * * @param selectionGroup - The SelectionGroup. */ setSelectionGroup(selectionGroup: SelectionGroup): void; /** * Sets global xfo target parameter. * * @param param - The parameter that will be modified during manipulation */ setTargetParam(param: XfoParameter): void; /** * Returns target's global xfo parameter. * * @return {Parameter} - returns handle's target global Xfo. */ getTargetParam(): Parameter; /** * Handles the initially drag of the handle. * * @param event - The event param. */ onDragStart(event: ZeaPointerEvent): void; /** * Handles drag action of the handle. * * @param event - The event param. */ onDrag(event: ZeaPointerEvent): void; /** * Handles the end of dragging the handle. * * @param event - The event param. */ onDragEnd(event: ZeaPointerEvent): void; /** * Event fired when a VR controller button is pressed over the handle. * * @param event - The event param. * @return {boolean} The return value. */ onXRControllerButtonDown(event: XRControllerEvent): void; /** * The onXRPoseChanged method. * * @param event - The event param. */ onXRPoseChanged(event: XRPoseEvent): void; /** * Event fired when a VR controller button is released over the handle. * * @param event - The event param. */ onVRControllerButtonUp(event: XRControllerEvent): void; } /** * Class representing an axial rotation scene widget. * * @extends Handle */ declare class AxialRotationHandle extends Handle { param: XfoParameter; radiusParam: NumberParameter; private baseXfo; private handleXfo; snapIncrementAngle: number; enableAngleSnapping: boolean; private handleToTargetXfo; private vec0; private change; private handleMat; private handle; selectionGroup: SelectionGroup; /** * Create an axial rotation scene widget. * * @param name - The name value. */ constructor(name: string, radius: number, thickness: number, radians?: number, color?: Color); /** * highlight the handle to indicate it is under the mouse. */ highlight(): void; /** * Removes the highlight from the handle once the mouse moves away. */ unhighlight(): void; /** * Sets selectionGroup so this handle can modify the items. * * @param selectionGroup - The SelectionGroup. */ setSelectionGroup(selectionGroup: SelectionGroup): void; /** * Sets the target parameter for this manipulator. * This parameter will be modified by interactions on the manipulator. * * @param param - The parameter that will be modified during manipulation */ setTargetParam(param: XfoParameter): void; /** * Returns target's global xfo parameter. * * @return {Parameter} - returns parameter */ getTargetParam(): XfoParameter; /** * Handles the initially drag of the handle. * * @param event - The event param. */ onDragStart(event: ZeaPointerEvent): void; /** * Handles drag action of the handle. * * @param event - The event param. */ onDrag(event: ZeaPointerEvent): void; /** * Handles the end of dragging the handle. * * @param event - The event param. */ onDragEnd(event: ZeaPointerEvent): void; } /** * Class representing a slider scene widget. There are two parts in this widget, the slider and the handle.
* The **Handle** is the moving part of the widget, the object you interact with. The **Slider** is the path that the **handle** follows. * * **Parameters** * * **Length(`NumberParameter`):** Specifies the length of the slider. * * **HandleRadius(`NumberParameter`):** Specifies the handle radius. * * **BarRadius(`NumberParameter`):** Specifies the radius of the slider. * * * @extends BaseLinearMovementHandle */ declare class SliderHandle extends BaseLinearMovementHandle { param: Parameter; lengthParam: NumberParameter; barRadiusParam: NumberParameter; handleRadiusParam: NumberParameter; handleMat: FlatSurfaceMaterial; handle: GeomItem; baseBar: GeomItem; topBar: GeomItem; handleXfo: Xfo; baseBarXfo: Xfo; topBarXfo: Xfo; change: ParameterValueChange; /** * Create a slider scene widget. * * @param name - The name value. * @param length - The length value. * @param radius - The radius value. * @param color - The color value. */ constructor(name?: string, length?: number, radius?: number, color?: Color); /** * highlight the handle to indicate it is under the mouse. */ highlight(): void; /** * Removes the highlight from the handle once the mouse moves away. */ unhighlight(): void; /** * Sets global xfo target parameter. * * @param param - The parameter that will be modified during manipulation */ setTargetParam(param: Parameter): void; /** * * * @param value - * @private */ __updateSlider(value: number): void; /** * Handles the initially drag of the handle. * * @param event - The event param. */ onDragStart(event: ZeaPointerEvent): void; /** * Handles drag action of the handle. * * @param event - The event param. */ onDrag(event: ZeaPointerEvent): void; /** * Handles the end of dragging the handle. * * @param event - The event param. */ onDragEnd(event: ZeaPointerEvent): void; /** * Serializes handle item as a JSON object. * * @param context - The context param. * @return {object} The return value. */ toJSON(context: Record): Record; /** * Restores handle item from a JSON object. * * @param json - The json param. * @param context - The context param. */ fromJSON(json: Record, context: Record): void; } /** * Class representing a slider scene widget with an arc shape. There are two parts in this widget, the slider and the handle.
* The **Handle** is the moving part of the widget, the object you interact with. The **Slider** is the path that the **handle** follows. * * * **Parameters** * * **ArcRadius(`NumberParameter`):** Specifies the radius of the slider. * * **ArcAngle(`NumberParameter`):** Specifies the arc angle of the slider. * * **HandleRadius(`NumberParameter`):** Specifies the radius of the handle in the slider. * * **Events** * * **dragStart:** Triggered when the pointer is down. * * **dragEnd:** Triggered when the pointer is released. * * @extends Handle */ declare class ArcSlider extends Handle { param: XfoParameter | NumberParameter; arcRadiusParam: NumberParameter; arcAngleParam: NumberParameter; handleRadiusParam: NumberParameter; range: Array; private handleMat; private handle; private arc; private baseXfo; private handleXfo; private vec0; private change; private handleGeomOffsetXfo; /** * Creates an instance of ArcSlider. * * @param name - The name value * @param [arcRadius=1] - The arcRadius value * @param [arcAngle=1] - The arcAngle value * @param [handleRadius=0.02] - The handleRadius value * @param [color=new Color(1, 1, 0)] - the color value */ constructor(name?: string, arcRadius?: number, arcAngle?: number, handleRadius?: number, color?: Color); /** * Event fired when a pointing device is initially moved within the space of the handle. * * @param event - The event param. */ onPointerEnter(event: ZeaPointerEvent): void; /** * Event fired when a pointing device moves outside of the space of the handle. * * @param event - The event param. */ onPointerLeave(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is pressed while the pointer is over the handle element. * * @param event - The event param. */ onPointerDown(event: ZeaPointerEvent): void; /** * highlight the handle to indicate it is under the mouse. */ highlight(): void; /** * Removes the highlight from the handle once the mouse moves away. */ unhighlight(): void; /** * Sets global xfo target parameter * * @param param - The parameter that will be modified during manipulation * @param track - The track param. */ setTargetParam(param: XfoParameter | NumberParameter, track?: boolean): void; /** * Returns handle's global Xfo * * @return {Xfo} - The Xfo value */ getBaseXfo(): Xfo; /** * Handles the initially drag interaction of the handle. * * @param event - The event param. */ onDragStart(event: ZeaPointerEvent): void; /** * Handles drag interaction of the handle. * * @param event - The event param. */ onDrag(event: ZeaPointerEvent): void; /** * Handles the end of dragging interaction with the handle. * * @param event - The event param. */ onDragEnd(event: ZeaPointerEvent): void; /** * Serializes handle item as a JSON object. * * @param context - The context param. * @return {object} The return value. */ toJSON(context: Record): Record; /** * Restores handle item from a JSON object. * * @param json - The json param. * @param context - The context param. */ fromJSON(json: Record, context: Record): void; } /** * Class representing a planar movement scene widget. * * @extends Handle */ declare class ScreenSpaceMovementHandle extends Handle { param: XfoParameter; baseXfo: Xfo; change: Change; selectionGroup: SelectionGroup; /** * Create a planar movement scene widget. * * @param name - The name value */ constructor(name?: string); /** * Sets selectionGroup so this handle can modify the items. * * @param selectionGroup - The SelectionGroup. */ setSelectionGroup(selectionGroup: SelectionGroup): void; /** * Sets global xfo target parameter. * * @param param - The parameter that will be modified during manipulation */ setTargetParam(param: XfoParameter): void; /** * Returns target's global xfo parameter. * * @return {Parameter} - returns handle's target global Xfo. */ getTargetParam(): XfoParameter; /** * Handles mouse down interaction with the handle. * * @param event - The event param. */ handlePointerDown(event: ZeaPointerEvent): void; /** * Handles mouse move interaction with the handle. * * @param event - The event param */ handlePointerMove(event: ZeaPointerEvent): void; /** * Handles mouse up interaction with the handle. * * @param event - The event param. */ handlePointerUp(event: ZeaPointerEvent): void; /** * Handles the initially drag of the handle. * * @param event - The event param. */ onDragStart(event: ZeaPointerEvent): void; /** * Handles drag action of the handle. * * @param event - The event param. */ onDrag(event: ZeaPointerEvent): void; /** * Handles the end of dragging the handle. * * @param event - The event param. */ onDragEnd(event: ZeaPointerEvent): void; } declare class AxisTripod extends TreeItem { /** * Create an axial rotation scene widget. * * @param size - The size value. */ constructor(size?: number, xaxisColor?: Color, yaxisColor?: Color, zaxisColor?: Color); bindToViewport(renderer: GLRenderer, viewport: GLViewport, pixelOffset?: number, screenSpaceCoord?: number[]): void; /** * Event fired when a pointing device button is pressed while the pointer is over the handle element. * * @param event - The event param. */ onPointerDown(event: ZeaPointerEvent): void; /** * Event fired when a pointing device is moved while the cursor's hotspot is over the handle. * * @param event - The event param. */ onPointerMove(event: ZeaPointerEvent): void; /** * Event fired when a pointing device button is released while the pointer is over the handle. * * @param event - The event param. */ onPointerUp(event: ZeaPointerEvent): void; } /** * The Material Class to use for Handle items. * The Handle shader is used to display geometry that must provide a fixed size on * screen and not get smaller or bigger as the user gets closer/farther away. * * @extends {GLShader} */ declare class HandleMaterial extends Material { baseColorParam: MaterialColorParam; maintainScreenSizeParam: NumberParameter; overlayParam: NumberParameter; /** * Creates an instance of HandleMaterial. * * @param name - The name of the material. Note: this value is entirely optional. */ constructor(name?: string); } /** * * * @extends {TreeItem} */ declare class Measure extends TreeItem { colorParam: ColorParameter; lineMaterial: LinesMaterial; markerMaterial: HandleMaterial; markerA: GeomItem; markerB: GeomItem; label: Label; billboard: BillboardItem; constructor(name?: string, color?: Color); } /** * * * @extends {TreeItem} */ declare class MeasureDistance extends Measure { lineGeomItem: GeomItem; startPos: Vec3; endPos: Vec3; sceneUnits: String; /** * Creates an instance of MeasureDistance. * @param name * @param color */ constructor(name?: string, color?: Color, sceneUnits?: string); /** * Updates the measured value */ updateMeasurement(): void; /** * * * @param position */ setStartMarkerPos(position: Vec3): void; /** * * * @param position */ setEndMarkerPos(position: Vec3): void; /** * * * @param isVisible - */ setGeomBuffersVisibility(isVisible: boolean): void; /** * * @return {string} */ getMeasurementText(): any; } /** * * * @extends {TreeItem} */ declare class MeasureAngle extends Measure { /** * Creates an instance of MeasureAngle. * @param name * @param color */ constructor(name?: string, color?: Color); /** * Given the 2 marker positions, calculate and display the angle. */ createLinesAndLabel(): void; /** * * * @param xfo */ setXfoA(xfo: Xfo): void; /** * * * @return {Xfo} */ getXfoA(): Xfo; /** * * * @param xfo */ setXfoB(xfo: Xfo): void; } /** * Represents a Measurement change. * * @extends Change */ declare class MeasurementChange extends Change { measurement: MeasureDistance; measurementType: string; parentItem: TreeItem; parentItemPath: Array; childIndex: number; /** * Creates an instance of MeasurementChange. * * @param measurement - The parent that the measurement will be added to. */ constructor(measurement: TreeItem); /** * * * @param data - An object containing potentially the start and end positions. * @memberof MeasurementChange */ update(data: Record): void; /** * */ end(): void; /** * Removes recently created geometry from its parent. */ undo(): void; /** * Restores recently created geometry and adds it to the specified parent tree item. */ redo(): void; /** * Serializes the change as a JSON object. * * @param context - The context value * @return {Record} - The serialized change */ toJSON(context: Record): Record; /** * Restores geometry from using the specified JSON * * @param j - The j param. * @param context - The appData param. */ fromJSON(j: Record, context: Record): void; /** * Removes geometry item reference from change change. */ destroy(): void; } /** * UI Tool for measurements * * @extends {BaseTool} */ declare class MeasureTool extends BaseTool { protected appData: AppData; colorParam: ColorParameter; protected measurement: Measure; protected measurementChange: MeasurementChange; protected highlightedItemA: GeomItem; protected highlightedItemA_params: ParameterOwner; protected highlightedItemA_componentId: number; protected highlightedItemA_highlightKey: string; protected highlightedItemB: GeomItem; protected highlightedItemB_params: ParameterOwner; protected highlightedItemB_componentId: number; protected highlightedItemB_highlightKey: string; protected stage: number; protected numStages: number; private prevCursor; protected geomConstraints: Record; /** * Creates an instance of MeasureDistanceTool. * * @param appData - The appData value */ constructor(appData: AppData); /** * The activateTool method. */ activateTool(): void; /** * The deactivateTool method. */ deactivateTool(): void; /** * @protected * @param geomItem * @returns */ getGeomParams(geomItem: GeomItem, componentId?: number): Promise; /** * @protected * @param geomItem * @returns */ getGeomParamsSync(geomItem: GeomItem, componentId?: number): ParameterOwner; /** * @private * @param geomItem * @returns */ getGeomXfo(geomItem: GeomItem, componentId?: number): Xfo; /** * Checks to see if the surface is appropriate for this kind of measurement. * @param geomItem - The geomItem to check * @return {boolean} */ checkGeom(geomItem: GeomItem, componentId?: number): Promise; /** * * * @param event - The event value */ onPointerMove(event: ZeaPointerEvent): void; /** * * * @param event - The event value */ onPointerUp(event: ZeaPointerEvent): void; } /** * UI Tool for measurements * * @extends {BaseTool} */ declare class MeasureDistanceTool extends MeasureTool { /** * @param appData - The appData value */ constructor(appData: AppData); /** * @param geomItem * @param pos * @return * @private */ snapToParametricEdge(geomXfo: Xfo, geomParams: ParameterOwner, pos: Vec3): Vec3; /** * * * @param event - The event value */ onPointerDown(event: ZeaPointerEvent): void; } /** * UI Tool for measurements * * @extends {BaseTool} */ declare class MeasureCenterDistancesTool extends MeasureTool { /** * @param appData - The appData value */ constructor(appData: AppData); /** * @private */ snapToParametricCenter(geomXfo: Xfo, geomParams: ParameterOwner, pos: Vec3): Vec3; /** * * * @param event - The event value */ onPointerDown(event: ZeaPointerEvent): void; } /** * UI Tool for measurements * * @extends {MeasureTool} */ declare class MeasureRadiusTool extends MeasureTool { /** * Creates an instance of MeasureDistanceTool. * * @param appData - The appData value */ constructor(appData: AppData); /** * * * @param event - The event value */ onPointerDown(event: ZeaPointerEvent): void; } /** * UI Tool for measurements * * @extends {BaseTool} */ declare class MeasureAngleTool extends MeasureTool { highlightedItemAHitPos: any; hitPosA: Vec3; dragging: boolean; /** * @param appData - The appData value */ constructor(appData: AppData); /** * @private */ snapToSurface(geomXfo: Xfo, geomParams: ParameterOwner, hitPos: Vec3, pointerRay: Ray, closestTo?: Xfo): Xfo; /** * * * @param event - The event value */ onPointerDown(event: ZeaPointerEvent): void; } export { AppData, ArcSlider, AxialRotationHandle, AxisTripod, Change, CreateCircleChange, CreateCircleTool, CreateConeChange, CreateConeTool, CreateCuboidChange, CreateCuboidTool, CreateFreehandLineChange, CreateFreehandLineTool, CreateGeomChange, CreateGeomTool, CreateLineChange, CreateLineTool, CreateMultiLineChange, CreateMultiLineTool, CreateRectChange, CreateRectTool, CreateSphereChange, CreateSphereTool, DeleteGeomsTool, DropUserTool, HandHeldTool, HandleMaterial, LinearMovementHandle, MeasureAngle, MeasureAngleTool, MeasureCenterDistancesTool, MeasureDistance, MeasureDistanceTool, MeasureRadiusTool, MeasurementChange, ParameterValueChange, PlanarMovementHandle, PointerTool, ScreenSpaceMovementHandle, SelectionChange, SelectionManager, SelectionTool, SelectionVisibilityChange, SelectionXfoChange, SliderHandle, ToolManager, TreeItemAddChange, TreeItemMoveChange, TreeItemsRemoveChange, UndoRedoManager, VRHoldObjectsTool, VRUITool, XfoHandle };