English中文

BufferPolygon

绑定到底层缓冲区数据的视图 View bound to the underlying buffer data of a BufferPolygonCollection.

BufferPolygon 实例是 BufferPolygon instances are flyweights:单个 BufferPolygon 实例可以临时绑定到 BufferPolygonCollection 中的任何概念“多边形”,从而允许以最小的内存占用量迭代和更新非常大的集合。 : a single BufferPolygon instance can be temporarily bound to any conceptual "polygon" in a BufferPolygonCollection, allowing very large collections to be iterated and updated with a minimal memory footprint.

表示为三 (3) 个或更多位置的一 (1) 个外部线性环。可以选择在多边形内定义一个或多个内部线性环(“孔”)。每个孔都表示为位置数组中的单个索引,其中该索引处的顶点是内部线性环的开始,该内部线性环沿着后续顶点继续,直到到达下一个孔的顶点索引或顶点列表的末尾。存储预先计算的三角剖分,表示为每个三角形的三个顶点索引。 Represented as one (1) external linear ring of three (3) or more positions. May optionally define one or more internal linear rings ("holes") within the polygon. Each hole is represented as a single index into the positions array, where the vertex at that index is the start of an internal linear ring that continues along the following vertices until reaching either the vertex index of the next hole, or the end of the vertex list. Stores a precomputed triangulation, represented as three vertex indices per triangle.

new Cesium.BufferPolygon()

实验性 Experimental

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

另见: See:

继承 Extends

成员 Members

与图元关联的特征 ID;不要求是唯一的。 Feature ID associated with the primitive; not required to be unique.
继承自: Inherited From:

readonly holeCount : number

该多边形中的孔(索引)计数。 Count of holes (indices) in this polygon.

readonly outerVertexCount : number

该多边形外部线性环中的位置(顶点)计数,VEC3 元素的数量。 Count of positions (vertices) in this polygon's outer linear ring, number of VEC3 elements.

readonly outerVertexOffset : number

集合位置数组中到多边形外线性环中第一个顶点的偏移量,VEC3 元素的数量。 Offset in collection position array to first vertex in polygon's outer linear ring, number of VEC3 elements.
是否显示原语。 Whether primitive is shown.
继承自: Inherited From:

readonly triangleCount : number

该多边形中的三角形数量,VEC3 元素数量。 Count of triangles in this polygon, number of VEC3 elements.

readonly vertexCount : number

该多边形中的位置(顶点)计数,包括外环和内环(孔)、VEC3 元素的数量。 Count of positions (vertices) in this polygon, including both outer ring and internal rings (holes), number of VEC3 elements.

方法 Methods

static Cesium.BufferPolygon.clone(polygon, result)BufferPolygon

将数据从源多边形复制到结果。如果结果多边形不是新的(集合中的最后一个多边形),则源多边形和结果多边形必须具有相同的顶点数、孔数和三角形数。 Copies data from source polygon to result. If the result polygon is not new (the last polygon in the collection) then source and result polygons must have the same vertex counts, hole counts, and triangle counts.
名称 Name 类型 Type 说明 Description
polygon BufferPolygon
result BufferPolygon
返回: Returns:

getHolePositions(holeIndex, result)

返回指定孔的内部线性环顶点位置的数组视图。如果给出“结果”参数,则顶点位置将写入该数组并返回。否则,在集合内存上返回一个 ArrayView - 对此数组的更改不会触发渲染更新,这需要“.setPositions()”。 Returns an array view of the inner linear ring vertex positions for the specified hole. If 'result' argument is given, vertex positions are written to that array and returned. Otherwise, returns an ArrayView on collection memory — changes to this array will not trigger render updates, which requires `.setPositions()`.
名称 Name 类型 Type 说明 Description
holeIndex number
result TypedArray 可选 optional 返回 {TypedArray} return {TypedArray}
获取此多边形的孔索引,每个孔表示为此多边形位置数组中的单个偏移量。每个孔隐式地从该顶点偏移沿着内部线性环继续,直到到达位置数组的末尾或下一个孔偏移。如果给出“结果”参数,则孔索引将写入该数组并返回。否则,在集合内存上返回一个 ArrayView - 对此数组的更改不会触发渲染更新,这需要“.setHoles()”。 Gets this polygon's hole indices, with each hole represented as a single offset into this polygon's positions array. Each hole implicitly continues along an internal linear ring from that vertex offset until reaching either the end of the positions array, or the next hole offset. If 'result' argument is given, hole indices are written to that array and returned. Otherwise, returns an ArrayView on collection memory — changes to this array will not trigger render updates, which requires `.setHoles()`.
名称 Name 类型 Type 说明 Description
result TypedArray 可选 optional
返回: Returns:

getHoleVertexCount(holeIndex)number

返回指定孔中的 (VEC3) 顶点数。 Returns the number of (VEC3) vertices in the specified hole.
名称 Name 类型 Type 说明 Description
holeIndex number
返回: Returns:
名称 Name 类型 Type 说明 Description
result BufferPrimitiveMaterial
返回: Returns:
继承自: Inherited From:
返回此多边形的外部线性环顶点位置的数组视图。如果给出“结果”参数,则顶点位置将写入该数组并返回。否则,在集合内存上返回一个 ArrayView - 对此数组的更改不会触发渲染更新,这需要“.setPositions()”。 Returns an array view of this polygon's outer linear ring vertex positions. If 'result' argument is given, vertex positions are written to that array and returned. Otherwise, returns an ArrayView on collection memory — changes to this array will not trigger render updates, which requires `.setPositions()`.
名称 Name 类型 Type 说明 Description
result TypedArray 可选 optional
返回: Returns:
返回此多边形顶点位置的数组视图。如果给出“结果”参数,则顶点位置将写入该数组并返回。否则,在集合内存上返回一个 ArrayView - 对此数组的更改不会触发渲染更新,这需要“.setPositions()”。 Returns an array view of this polygon's vertex positions. If 'result' argument is given, vertex positions are written to that array and returned. Otherwise, returns an ArrayView on collection memory — changes to this array will not trigger render updates, which requires `.setPositions()`.
名称 Name 类型 Type 说明 Description
result TypedArray 可选 optional 返回 {TypedArray} return {TypedArray}
返回此多边形的三角形索引的数组视图,表示为每个三角形的三个顶点索引。如果给出“结果”参数,则三角形索引将写入该数组并返回。否则,在集合内存上返回一个 ArrayView - 对此数组的更改不会触发渲染更新,这需要`.setTriangles()`。 Returns an array view of this polygon's triangle indices, represented as three vertex indices per triangle. If 'result' argument is given, triangle indices are written to that array and returned. Otherwise, returns an ArrayView on collection memory — changes to this array will not trigger render updates, which requires `.setTriangles()`.
名称 Name 类型 Type 说明 Description
result TypedArray 可选 optional
返回: Returns:
设置此多边形的孔索引,孔表示为此多边形位置数组中的单个偏移量。每个孔隐式地从该顶点偏移沿着内部线性环继续,直到到达位置数组的末尾或下一个孔偏移。 Sets this polygon's hole indices, with holes represented as a single offset into this polygon's positions array. Each hole implicitly continues along an internal linear ring from that vertex offset until reaching either the end of the positions array, or the next hole offset.
名称 Name 类型 Type 说明 Description
holes TypedArray
名称 Name 类型 Type 说明 Description
material BufferPrimitiveMaterial
继承自: Inherited From:
名称 Name 类型 Type 说明 Description
positions TypedArray
设置此多边形的三角形索引,表示为每个三角形的三个顶点索引。 Sets this polygon's triangle indices, represented as three vertex indices per triangle.
名称 Name 类型 Type 说明 Description
indices TypedArray
返回表示多边形的 JSON 可序列化对象。这种编码不节省内存,通常应该用于调试和测试。 Returns a JSON-serializable object representing the polygon. This encoding is not memory-efficient, and should generally be used for debugging and testing.
返回: Returns:
JSON 可序列化对象。 JSON-serializable object.
继承自: Inherited From:
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.