Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PointPrimitiveCollection
    • PointCollection

Index

Constructors

constructor

  • new PointCollection(options?: { blendOption?: OPAQUE | TRANSLUCENT | OPAQUE_AND_TRANSLUCENT; debugShowBoundingVolume?: boolean; modelMatrix?: Matrix4 }): PointCollection
  • Parameters

    • Optional options: { blendOption?: OPAQUE | TRANSLUCENT | OPAQUE_AND_TRANSLUCENT; debugShowBoundingVolume?: boolean; modelMatrix?: Matrix4 }
      • Optional blendOption?: OPAQUE | TRANSLUCENT | OPAQUE_AND_TRANSLUCENT
      • Optional debugShowBoundingVolume?: boolean
      • Optional modelMatrix?: Matrix4

    Returns PointCollection

Properties

blendOption

blendOption: BlendOption

The point blending option. The default is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.

debugShowBoundingVolume

debugShowBoundingVolume: boolean

This property is for debugging only; it is not for production use nor is it optimized.

Draws the bounding sphere for each draw command in the primitive.

length

length: number

Returns the number of points in this collection. This is commonly used with {@link PointPrimitiveCollection#get} to iterate over all the points in the collection.

modelMatrix

modelMatrix: Matrix4

The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates. When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by {@link Transforms.eastNorthUpToFixedFrame}.

example

var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); pointPrimitives.add({ color : Cesium.Color.ORANGE, position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center }); pointPrimitives.add({ color : Cesium.Color.YELLOW, position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east }); pointPrimitives.add({ color : Cesium.Color.GREEN, position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north }); pointPrimitives.add({ color : Cesium.Color.CYAN, position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up });

Methods

add

  • add(options?: any): PointPrimitive
  • Creates and adds a point with the specified initial properties to the collection. The added point is returned so it can be modified or removed from the collection later.

    example

    // Example 1: Add a point, specifying all the default values. var p = pointPrimitives.add({ show : true, position : Cesium.Cartesian3.ZERO, pixelSize : 10.0, color : Cesium.Color.WHITE, outlineColor : Cesium.Color.TRANSPARENT, outlineWidth : 0.0, id : undefined });

    example

    // Example 2: Specify only the point's cartographic position. var p = pointPrimitives.add({ position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) });

    Parameters

    • Optional options: any

    Returns PointPrimitive

    The point that was added to the collection.

contains

  • contains(pointPrimitive?: PointPrimitive): boolean
  • Check whether this collection contains a given point.

    Parameters

    • Optional pointPrimitive: PointPrimitive

    Returns boolean

    true if this collection contains the point, false otherwise.

destroy

  • destroy(): void
  • Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

    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.

    example

    pointPrimitives = pointPrimitives && pointPrimitives.destroy();

    Returns void

get

  • get(index: number): PointPrimitive
  • Returns the point in the collection at the specified index. Indices are zero-based and increase as points are added. Removing a point shifts all points after it to the left, changing their indices. This function is commonly used with {@link PointPrimitiveCollection#length} to iterate over all the points in the collection.

    example

    // Toggle the show property of every point in the collection var len = pointPrimitives.length; for (var i = 0; i < len; ++i) { var p = pointPrimitives.get(i); p.show = !p.show; }

    Parameters

    • index: number

      The zero-based index of the point.

    Returns PointPrimitive

    The point at the specified index.

isDestroyed

  • isDestroyed(): boolean
  • Returns true if this object was destroyed; otherwise, false.

    If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.

    Returns boolean

    true if this object was destroyed; otherwise, false.

remove

  • remove(pointPrimitive: PointPrimitive): boolean
  • Removes a point from the collection.

    example

    var p = pointPrimitives.add(...); pointPrimitives.remove(p); // Returns true

    Parameters

    • pointPrimitive: PointPrimitive

      The point to remove.

    Returns boolean

    true if the point was removed; false if the point was not found in the collection.

removeAll

  • removeAll(): void
  • Removes all points from the collection.

    example

    pointPrimitives.add(...); pointPrimitives.add(...); pointPrimitives.removeAll();

    Returns void