Viewer - Drawing Tools
    Preparing search index...

    Interface IControl

    interface IControl {
        position: vec3;
        type: string;
        cancel(moveTemporary: MoveTemporaryFn): void;
        end(getPosition: GetPositionFn): void;
        move(
            ray: IRay,
            moveTemporary: MoveTemporaryFn,
            restrictedPosition?: vec3,
            applyConstraints?: ApplyConstraintsFn,
        ): vec3 | undefined;
        refreshAll(getPosition: GetPositionFn): void;
        refreshForMovedPoint(
            movedIndex: number,
            getPosition: GetPositionFn,
        ): boolean;
        start(getPosition: GetPositionFn): boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    position: vec3
    type: string

    Methods

    • Cancel the drag, restoring all affected geometry points to their pre-drag positions.

      Parameters

      • moveTemporary: MoveTemporaryFn

      Returns void

    • Commit the drag and refresh any derived state from the committed geometry.

      Parameters

      • getPosition: GetPositionFn

      Returns void

    • Move the control during drag. Returns the updated visual position of the control, or undefined if no movement was possible (e.g. degenerate geometry).

      Parameters

      • ray: IRay
      • moveTemporary: MoveTemporaryFn
      • OptionalrestrictedPosition: vec3

        Optional pre-computed restriction-constrained position. When provided the control should derive its movement from this world-space point rather than from a raw line-line closest-point computation on the ray.

      • OptionalapplyConstraints: ApplyConstraintsFn

        Optional constraint evaluator. When provided, edge controls use it to find the tightest valid scalar t before moving both endpoints, guaranteeing they always translate rigidly together.

      Returns vec3 | undefined

    • Refreshes all derived state from the current geometry (e.g. after undo/redo).

      Parameters

      • getPosition: GetPositionFn

      Returns void

    • Called when a single point in the geometry has moved (not during a drag). Returns true if this control was affected and its visual position changed.

      Parameters

      • movedIndex: number
      • getPosition: GetPositionFn

      Returns boolean

    • Begin a drag interaction. Snapshots any required initial state. Returns false if the control cannot be dragged at this time.

      Parameters

      • getPosition: GetPositionFn

      Returns boolean