Skip to content

KBE3D / KBCore / Cesium / SelectionIndicatorViewModel

类: SelectionIndicatorViewModel

The view model for SelectionIndicator.

参数

The scene instance to use for screen-space coordinate conversion.

参数

The element containing all elements that make up the selection indicator.

参数

The DOM element that contains the widget.

属性

position

position: Cartesian3

Gets or sets the world position of the object for which to display the selection indicator.


showSelection

showSelection: boolean

Gets or sets the visibility of the selection indicator.


isVisible

isVisible: boolean

Gets the visibility of the position indicator. This can be false even if an object is selected, when the selected object has no position.


computeScreenSpacePosition

computeScreenSpacePosition: ComputeScreenSpacePosition

Gets or sets the function for converting the world position of the object to the screen space position.

示例

ts
selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
    return Cesium.SceneTransforms.worldToWindowCoordinates(scene, position, result);
};

container

container: Element

Gets the HTML element containing the selection indicator.


selectionIndicatorElement

selectionIndicatorElement: Element

Gets the HTML element that holds the selection indicator.


scene

scene: Scene

Gets the scene being used.

方法

update()

update(): void

Updates the view of the selection indicator to match the position and content properties of the view model. This function should be called as part of the render loop.

返回

void


animateAppear()

animateAppear(): void

Animate the indicator to draw attention to the selection.

返回

void


animateDepart()

animateDepart(): void

Animate the indicator to release the selection.

返回

void

构造函数

构造函数

new SelectionIndicatorViewModel(scene: Scene, selectionIndicatorElement: Element, container: Element): SelectionIndicatorViewModel

参数

scene

Scene

selectionIndicatorElement

Element

container

Element

返回

SelectionIndicatorViewModel

KBE3D @3.0.0 Copyright © 2024-present KBE3D