new Cesium.VoxelCell(primitive, tileIndex, sampleIndex)

A cell from a VoxelPrimitive.

提供与一个阴道原始细胞相关的属性访问.

Do not construct this directly. Access it through picking using Scene#pickVoxel.

Name Type Description
primitive VoxelPrimitive 含有细胞的阴道原始
tileIndex number 瓦片的索引
sampleIndex number 砖块内的样本索引,包含此单元格的元数据
Example:
// On left click, display all the properties for a voxel cell in the console log.
handler.setInputAction(function(movement) {
  const voxelCell = scene.pickVoxel(movement.position);
  if (voxelCell instanceof Cesium.VoxelCell) {
    const propertyIds = voxelCell.getPropertyIds();
    const length = propertyIds.length;
    for (let i = 0; i < length; ++i) {
      const propertyId = propertyIds[i];
      console.log(`{propertyId}: ${voxelCell.getProperty(propertyId)}`);
    }
  }
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

Members

readonly orientedBoundingBox : OrientedBoundingBox

获取含有单元格的定向边框副本.

readonly primitive : VoxelPrimitive

All objects returned by Scene#pick have a primitive property. This returns 含有细胞的 VoxelPrimitive.

readonly sampleIndex : number

获取单元格样本索引.

readonly tileIndex : number

获取含有单元格的瓦片索引.

Methods

getNames()Array.<string>

返回特性的元数据属性名称.
Returns:
特征属性的ID.

getProperty(name)*

返回带有给定名称的单元格中元数据值的副本.
Name Type Description
name string 财产的大小写名称.
Returns:
The value of the property or undefined if the feature does not have this property.
Example:
// Display all the properties for a voxel cell in the console log.
const names = voxelCell.getNames();
for (let i = 0; i < names.length; ++i) {
  const name = names[i];
  console.log(`{name}: ${voxelCell.getProperty(name)}`);
}

hasProperty(name)boolean

Returns true if the feature contains this property.
Name Type Description
name string 财产的大小写名称.
Returns:
特性是否包含此属性 .
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.