Interface PickEntityOptions

interface PickEntityOptions {
    autoFocus?: boolean;
    beforeConfirm?: ((e, context) => any);
    canSelectBox?: boolean;
    ctrlKeyCencelSelect?: boolean;
    dblClickConfirm?: boolean;
    enterKeyCb?: ((e, context) => any);
    enterKeyConfirm?: boolean;
    escCancel?: boolean;
    exitAutoClearDelay?: number;
    exitAutoClearHighlight?: boolean;
    filterEntityCb?: ((ent) => boolean);
    highlightColor?: ColorRepresentation;
    highlightOpacity?: number;
    highlightUseBoxHelper?: boolean;
    keydownCb?: ((e, context) => any);
    maxSelectedCount?: number;
    onResult?: ((entity?) => any);
    onSelect?: ((currentEntity, context) => any);
    onSelectBoxEnd?: ((pointLeftTop, pointBottomRight, context) => any);
    onlyUseSelectBox?: boolean;
    rightClickCb?: ((e, context) => any);
    rightClickConfirm?: boolean;
    selectBoxStyle?: Record<string, any>;
    shiftSelectBox?: boolean;
    unprojectOpts?: "depth" | UnProjectOpts;
    updateCoordinate?: ((e, context) => any);
}

Properties

autoFocus?: boolean

进入时使div元素自动获取焦点(能响应键盘事件) 默认是

beforeConfirm?: ((e, context) => any)

结果确定前回调 返回true交确认结果。其他继续拾取

Type declaration

    • (e, context): any
    • 结果确定前回调 返回true交确认结果。其他继续拾取

      Parameters

      • e: any
      • context: {
            entity?: Entity[];
            reject: ((reason?) => void);
            resolve: ((value) => void);
        }
        • Optional entity?: Entity[]
        • reject: ((reason?) => void)
            • (reason?): void
            • Parameters

              • Optional reason: any

              Returns void

        • resolve: ((value) => void)
            • (value): void
            • Parameters

              • value: unknown

              Returns void

      Returns any

canSelectBox?: boolean

是否允许矩形框选 默认允许(需同时按shift键)

ctrlKeyCencelSelect?: boolean

已选中实体,再次选择时是否需同时按Ctrl键取消实体(默认不需要按ctrl,再次选择时取消选择)

dblClickConfirm?: boolean

是否双击确认 默认是

enterKeyCb?: ((e, context) => any)

按enter回调(例如可以调出输入界面等 enterKeyConfirm 为false时有效)

Type declaration

    • (e, context): any
    • 按enter回调(例如可以调出输入界面等 enterKeyConfirm 为false时有效)

      Parameters

      • e: any
      • context: {
            entity?: Entity[];
            reject: ((reason?) => void);
            resolve: ((value) => void);
        }
        • Optional entity?: Entity[]
        • reject: ((reason?) => void)
            • (reason?): void
            • Parameters

              • Optional reason: any

              Returns void

        • resolve: ((value) => void)
            • (value): void
            • Parameters

              • value: unknown

              Returns void

      Returns any

enterKeyConfirm?: boolean

是否回车键确认 默认是

escCancel?: boolean

是否ESC取消 默认是

exitAutoClearDelay?: number

选择结束后自动清除延迟时间(使最后那个有选中的显示时间) 默认100ms, 0不延迟

exitAutoClearHighlight?: boolean

选择结束后自动清除

filterEntityCb?: ((ent) => boolean)

过滤实体回调 满足条件的返回true

Type declaration

    • (ent): boolean
    • 过滤实体回调 满足条件的返回true

      Parameters

      Returns boolean

highlightColor?: ColorRepresentation

选中时高亮的颜色 默认 "#ff0000"

highlightOpacity?: number

选中时高亮的透明度 默认0.5

highlightUseBoxHelper?: boolean

高亮模式是否用外包盒的方式 默认false

keydownCb?: ((e, context) => any)

按键回调

Type declaration

    • (e, context): any
    • 按键回调

      Parameters

      • e: any
      • context: {
            entity?: Entity[];
            reject: ((reason?) => void);
            resolve: ((value) => void);
        }
        • Optional entity?: Entity[]
        • reject: ((reason?) => void)
            • (reason?): void
            • Parameters

              • Optional reason: any

              Returns void

        • resolve: ((value) => void)
            • (value): void
            • Parameters

              • value: unknown

              Returns void

      Returns any

maxSelectedCount?: number

选择多少个实体后自动确认返回。默认不限制

onResult?: ((entity?) => any)

选择结束结果回调

Type declaration

    • (entity?): any
    • 选择结束结果回调

      Parameters

      Returns any

onSelect?: ((currentEntity, context) => any)

选择了一个实体回调 如果返回false将不加入选择集

Type declaration

    • (currentEntity, context): any
    • 选择了一个实体回调 如果返回false将不加入选择集

      Parameters

      • currentEntity: Entity
      • context: {
            entity?: Entity[];
            reject: ((reason?) => void);
            resolve: ((value) => void);
        }
        • Optional entity?: Entity[]
        • reject: ((reason?) => void)
            • (reason?): void
            • Parameters

              • Optional reason: any

              Returns void

        • resolve: ((value) => void)
            • (value): void
            • Parameters

              • value: unknown

              Returns void

      Returns any

onSelectBoxEnd?: ((pointLeftTop, pointBottomRight, context) => any)

结束框选回调

Type declaration

    • (pointLeftTop, pointBottomRight, context): any
    • 结束框选回调

      Parameters

      • pointLeftTop: Vector2
      • pointBottomRight: Vector2
      • context: {
            entity?: Entity[];
            reject: ((reason?) => void);
            resolve: ((value) => void);
        }
        • Optional entity?: Entity[]
        • reject: ((reason?) => void)
            • (reason?): void
            • Parameters

              • Optional reason: any

              Returns void

        • resolve: ((value) => void)
            • (value): void
            • Parameters

              • value: unknown

              Returns void

      Returns any

onlyUseSelectBox?: boolean

只能矩形选择

rightClickCb?: ((e, context) => any)

右键回调

Type declaration

    • (e, context): any
    • 右键回调

      Parameters

      • e: any
      • context: {
            entity?: Entity[];
            reject: ((reason?) => void);
            resolve: ((value) => void);
        }
        • Optional entity?: Entity[]
        • reject: ((reason?) => void)
            • (reason?): void
            • Parameters

              • Optional reason: any

              Returns void

        • resolve: ((value) => void)
            • (value): void
            • Parameters

              • value: unknown

              Returns void

      Returns any

rightClickConfirm?: boolean

是否右键确认 默认否

selectBoxStyle?: Record<string, any>

矩形框选样式

shiftSelectBox?: boolean

矩形框选需同时按shift键 默认是

unprojectOpts?: "depth" | UnProjectOpts

同unproject的第三个参数 (undefined根据地图配置决定, false 不用场景数据, true用场景数据) 深度 (-1近裁剪面 到 1 远裁剪面) 或者输入 平面 或者由一个点所在的屏幕平面 或者使用当前场景实体 或 指定实体数组 或同时指定包含或过滤的实体 depth 使用深度

updateCoordinate?: ((e, context) => any)

更新坐标回调

Type declaration

    • (e, context): any
    • 更新坐标回调

      Parameters

      • e: any
      • context: {
            reject: ((reason?) => void);
            resolve: ((value) => void);
            worldPos?: Vector3;
        }
        • reject: ((reason?) => void)
            • (reason?): void
            • Parameters

              • Optional reason: any

              Returns void

        • resolve: ((value) => void)
            • (value): void
            • Parameters

              • value: unknown

              Returns void

        • Optional worldPos?: Vector3

      Returns any