English中文

BufferPointCollection

ArrayBuffer 存储中保存的点的集合,用于性能和内存优化。 Collection of points held in ArrayBuffer storage for performance and memory optimization.

默认缓冲区内存分配是任意的,并且集合无法调整大小,因此应在集合构造函数中提供特定的每个缓冲区容量(如果可用)。 Default buffer memory allocation is arbitrary, and collections cannot be resized, so specific per-buffer capacities should be provided in the collection constructor when available.

new Cesium.BufferPointCollection(options)

名称 Name 类型 Type 说明 Description
options object
名称 Name 类型 Type 默认值 Default 说明 Description
primitiveCountMax number BufferPrimitiveCollection.DEFAULT_CAPACITY 可选 optional
show boolean true 可选 optional
debugShowBoundingVolume boolean false 可选 optional
示例: Example:
const collection = new BufferPointCollection({primitiveCountMax: 1024});

const point = new BufferPoint();
const material = new BufferPointMaterial({color: Color.WHITE});

// Create a new point, temporarily bound to 'point' local variable.
collection.add({
  position: new Cartesian3(0.0, 0.0, 0.0),
  material
}, point);

// Iterate over all points in collection, temporarily binding 'point'
// local variable to each, and updating point material.
for (let i = 0; i < collection.primitiveCount; i++) {
  collection.get(i, point);
  point.setMaterial(material);
}
实验性 Experimental

此功能不是最终版本,可能会在没有 Cesium 标准弃用政策的情况下进行更改。 This feature is not final and is subject to change without Cesium's standard deprecation policy.

另见: See:

继承 Extends

方法 Methods

使用指定的选项将新点添加到集合中。一个 Adds a new point to the collection, with the specified options. A BufferPoint 实例链接到新点,如果给定则使用“结果”参数,如果没有则使用新实例。对于重复调用,最好重用单个 BufferPoint 实例,而不是在每次调用时分配一个新实例。 instance is linked to the new point, using the 'result' argument if given, or a new instance if not. For repeated calls, prefer to reuse a single BufferPoint instance rather than allocating a new instance on each call.
名称 Name 类型 Type 说明 Description
options BufferPointOptions
result BufferPoint
返回: Returns:
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.