new Cesium.ClippingPolygonCollection(options)

指定一组剪切多边形。 拼贴多边形选择性地禁用区域渲染 inside or outside the specified list of ClippingPolygon objects for a single glTF model, 3D Tileset, or the globe. Clipping Polygons只在 NT 0 2上下文中支持.
Name Type Description
options object optional 下列属性的对象 :
Name Type Default Description
polygons Array.<ClippingPolygon> [] optional An array of ClippingPolygon objects used to selectively disable rendering on the inside of each polygon.
enabled boolean true optional Determines whether the clipping polygons are active.
inverse boolean false optional If true, a region will be clipped if it is outside of every polygon in the collection. Otherwise, a region will only be clipped if it is on the inside of any polygon.
Example:
const positions = Cesium.Cartesian3.fromRadiansArray([
    -1.3194369277314022,
    0.6988062530900625,
    -1.31941,
    0.69879,
    -1.3193955980204217,
    0.6988091578771254,
    -1.3193931220959367,
    0.698743632490865,
    -1.3194358224045408,
    0.6987471965556998,
]);

const polygon = new Cesium.ClippingPolygon({
    positions: positions
});

const polygons = new Cesium.ClippingPolygonCollection({
   polygons: [ polygon ]
});

Members

enabled : boolean

如果选中的话, 将会启用剪辑 .
Default Value: true

inverse : boolean

如果为真, 如果区域位于区域中的每个多边形之外, 区域将被剪切 藏书。 否则,一个区域只有被切断 在任何多边形内.
Default Value: false

readonly length : number

返回此收藏中的多边形数。 这通常用于 ClippingPolygonCollection#get to iterate over all the polygons 在收藏中.

polygonAdded : Event

当新剪辑多边形添加到收藏中时触发的事件 。 事件处理器 ,通过新的多边形和添加时的索引.
Default Value: Event()

polygonRemoved : Event

当从收藏中删除新的剪辑多边形时触发的事件 。 事件处理器 被传递到新多边形及其删除的索引.
Default Value: Event()

Methods

static Cesium.ClippingPolygonCollection.isSupported(scene)boolean

用于检查上下文是否允许剪切多边形的函数,这需要浮点纹理.
Name Type Description
scene Scene | object 将包含剪切对象和剪切纹理的场景.
Returns:
如果上下文支持剪切多边形,则使用 NT#0 true NT 1 .

add(polygon)ClippingPolygon

Adds the specified ClippingPolygon to the collection to be used to selectively disable rendering on the inside of each polygon. Use ClippingPolygonCollection#unionClippingRegions to modify 如何修改多个多边形的剪切行为.
Name Type Description
polygon ClippingPolygon 剪刀波利根来加入收藏.
Returns:
添加的克菲特·波利贡.
Example:
const polygons = new Cesium.ClippingPolygonCollection();

const positions = Cesium.Cartesian3.fromRadiansArray([
    -1.3194369277314022,
    0.6988062530900625,
    -1.31941,
    0.69879,
    -1.3193955980204217,
    0.6988091578771254,
    -1.3193931220959367,
    0.698743632490865,
    -1.3194358224045408,
    0.6987471965556998,
]);

polygons.add(new Cesium.ClippingPolygon({
    positions: positions
}));
See:

contains(polygon)boolean

检查此收藏是否包含一个等于给定的 ClippingPolygon 的 ClippingPolygon .
Name Type Description
polygon ClippingPolygon 克里皮特·波利贡要检查.
Returns:
如果此收藏包含 ClippingPolygon, 否则是虚假的 .
See:

destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic 释放 WebGL 资源,而不是依赖垃圾收集器来摧毁此对象.

Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.
Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
clippingPolygons = clippingPolygons && clippingPolygons.destroy();
See:

get(index)ClippingPolygon

在指定的索引中返回收藏中的剪切多边形。 指数为零 随着多边形的增加。 删除所有多边形之后的多边形 在左边,改变他们的指数。 此函数通常用于 ClippingPolygonCollection#length to iterate over all the polygons 在收藏中.
Name Type Description
index number 多边形的零基索引.
Returns:
指定的索引中的 ClippingPolygon .
See:

isDestroyed()boolean

如果此对象被销毁, 返回真实; 否则, 错误 .

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.
Returns:
true if this object was destroyed; otherwise, false.
See:

remove(polygon)boolean

从收藏中删除给定的 ClippingPolygon 的第一个事件.
Name Type Description
polygon ClippingPolygon
Returns:
true if the polygon was removed; false if the polygon was not found in the collection.
See:

removeAll()

从收藏中删除所有多边形.
See:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.