Class: SpatialQuery3D

SpatialQuery3D

new SpatialQuery3D(scene)

GPU空间查询类。

Name Type Description
scene Scene

进行GPU空间查询的场景。

Throws:

需要场景。

Type
DeveloperError

Members

fillColorColor

获取或者设置查询对象的填充颜色,RGBA格式。

fillStyleFillStyle

获取或者设置查询对象的填充模式。

geometryGeometry3D

获取或者设置用于查询的单个几何模型对象(兼容旧版本)。

layersLayers

获取或者设置被查询图层。

outlineColorColor

获取或者设置查询对象边框颜色。

positionModePositionMode

获取或者设置查询时对象位置模式,指查询对象与模型对象的位置关系,包括相离、相交和包含等几种。

Methods

addGeometry(geometry)

动态添加单个查询几何体

Name Type Description
geometry Geometry3D

要添加的几何模型对象

build()

执行GPU空间查询与分析。

clear()

清除对象但不销毁。

destroy()

销毁对象。

getQueryIDs(){Array}

获取所有查询到的id。

Returns:
Type Description
Array ids

getVisibleInViewport(index){boolean}

获取空间查询结果在对应视口的可见性。

Name Type Description
index number

索引

Throws:

index 为 0~8

Type
DeveloperError
Returns:
Type Description
boolean visible 可见性

removeGeometry(geometry){boolean}

移除指定的几何体。

Name Type Description
geometry Geometry3D | Primitive

要移除的几何体对象

Returns:
Type Description
boolean
  • 如果移除成功返回true,否则返回false

setVisibleInViewport(index, visible)

设置空间查询结果在对应视口的可见性

Name Type Description
index number

索引

visible boolean

可见性

Throws:

index 为 0~8

Type
DeveloperError