Interface EventModuleOptions

事件选项

interface EventModuleOptions {
    cancelHighlight?: "none" | "clickOtherPosition" | "clickOtherEntity" | "inherit";
    cancelSelectMode?: "none" | "clickOtherPosition" | "clickOtherEntity" | "inherit";
    clickCallback?: ((entity, isClick) => void);
    clickHighlight?: boolean;
    clickHtmlText?: string | ((ent) => Promise<string>);
    clickSelect?: boolean;
    enableWhenActiveTool?: boolean;
    highlightColor?: ColorRepresentation;
    highlightOpacity?: number;
    highlightUseBoxHelper?: boolean;
    hoverCallback?: ((entity, isHover) => void);
    hoverHighlight?: boolean;
    hoverHtmlText?: string | ((ent) => Promise<string>);
    hoverSelect?: boolean;
    onAdd?: ((parent, self) => void);
    onBeforeAdd?: ((parent, self) => void);
    onBeforeRemove?: ((self) => void);
    onKeyDown?: ((event, object) => void);
    onKeyUp?: ((event, object) => void);
    onMouseClick?: ((event, object) => void);
    onMouseDblClick?: ((event, object) => void);
    onMouseDown?: ((event, object) => void);
    onMouseEnter?: ((event, object) => void);
    onMouseLeave?: ((event, object) => void);
    onMouseMove?: ((event, object) => void);
    onMouseOut?: ((event, object) => void);
    onMouseOver?: ((event, object) => void);
    onMouseUp?: ((event, object) => void);
    onMouseWheel?: ((event, object) => void);
    onPointerDown?: ((event, object) => void);
    onPointerMove?: ((event, object) => void);
    onPointerUp?: ((event, object) => void);
    onRayIntersect?: ((event, object) => void);
    onRemove?: ((self) => void);
    popupAnchor?: Anchor3d;
    popupAsEntityChild?: boolean;
    popupCallback?: ((entity, popup, isHover) => Object3D<Object3DEventMap> | Entity);
    popupOptions?: PopupOptions;
}

Properties

cancelHighlight?: "none" | "clickOtherPosition" | "clickOtherEntity" | "inherit"

取消高亮模式(默认inherit) none 不主动取消,需要调用代码取消高亮; inherit 继承,跟随系统设置; clickOtherPosition 点击其他位置(不在此实体上面时)取消高亮; clickOtherEntity 点击选中其他实体时,取消高亮

cancelSelectMode?: "none" | "clickOtherPosition" | "clickOtherEntity" | "inherit"

取消选中模式(默认inherit) none 不主动取消,需要调用代码取消选中; inherit 继承,跟随系统设置; clickOtherPosition 点击其他位置(不在此实体上面时)取消选中; clickOtherEntity 点击选中其他实体时,取消选中

clickCallback?: ((entity, isClick) => void)

点击回调

Type declaration

    • (entity, isClick): void
    • 点击回调

      Parameters

      • entity: Entity
      • isClick: boolean

      Returns void

clickHighlight?: boolean

是否点击高亮

clickHtmlText?: string | ((ent) => Promise<string>)

点击时显示的文本内容

Type declaration

    • (ent): Promise<string>
    • Parameters

      Returns Promise<string>

clickSelect?: boolean

是否点击选中

enableWhenActiveTool?: boolean

当前工具运行时,响应事件,默认false

highlightColor?: ColorRepresentation

高亮颜色

highlightOpacity?: number

高亮透明度

highlightUseBoxHelper?: boolean

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

hoverCallback?: ((entity, isHover) => void)

高亮回调

Type declaration

    • (entity, isHover): void
    • 高亮回调

      Parameters

      • entity: Entity
      • isHover: boolean

      Returns void

hoverHighlight?: boolean

悬浮时设置为高亮状态

hoverHtmlText?: string | ((ent) => Promise<string>)

点击时显示的文本内容

Type declaration

    • (ent): Promise<string>
    • Parameters

      Returns Promise<string>

hoverSelect?: boolean

悬浮时设置为选中状态

onAdd?: ((parent, self) => void)

Type declaration

    • (parent, self): void
    • Parameters

      Returns void

onBeforeAdd?: ((parent, self) => void)

Type declaration

    • (parent, self): void
    • Parameters

      Returns void

onBeforeRemove?: ((self) => void)

Type declaration

    • (self): void
    • Parameters

      Returns void

onKeyDown?: ((event, object) => void)

Type declaration

onKeyUp?: ((event, object) => void)

Type declaration

onMouseClick?: ((event, object) => void)

Type declaration

onMouseDblClick?: ((event, object) => void)

Type declaration

onMouseDown?: ((event, object) => void)

Type declaration

onMouseEnter?: ((event, object) => void)

Type declaration

onMouseLeave?: ((event, object) => void)

Type declaration

onMouseMove?: ((event, object) => void)

Type declaration

onMouseOut?: ((event, object) => void)

Type declaration

onMouseOver?: ((event, object) => void)

Type declaration

onMouseUp?: ((event, object) => void)

Type declaration

onMouseWheel?: ((event, object) => void)

Type declaration

onPointerDown?: ((event, object) => void)

Type declaration

onPointerMove?: ((event, object) => void)

Type declaration

onPointerUp?: ((event, object) => void)

Type declaration

onRayIntersect?: ((event, object) => void)

Type declaration

onRemove?: ((self) => void)

Type declaration

    • (self): void
    • Parameters

      Returns void

popupAnchor?: Anchor3d

显示文本时弹出框锚位于实体的位置 (默认'middle-top' 中间-上面居中 )

popupAsEntityChild?: boolean

popup弹出时作为实体的子节点,默认true

popupCallback?: ((entity, popup, isHover) => Object3D<Object3DEventMap> | Entity)

popup弹出前回调 如果返回 Object3D 将把此Object3d做为popup的父节点

Type declaration

    • (entity, popup, isHover): Object3D<Object3DEventMap> | Entity
    • popup弹出前回调 如果返回 Object3D 将把此Object3d做为popup的父节点

      Parameters

      Returns Object3D<Object3DEventMap> | Entity

popupOptions?: PopupOptions

显示文本时弹出框选项