ViewerPointCloudAPI

Interface ViewerPointCloudAPIExperimental

Experimental. May be changed in the future without notice.

The ViewerPointCloudAPI provides functionality to visualize point clouds based on a given set of points.

This API visualizes a set of CloudPoints in the 3D space. At the moment, this happens without any further optimization. Thus, it may come to limitations in terms of performance and memory consumption when visualizing a large number of points.

Example: Create, change and remove a point cloud.

// get an instance of the ContextAPI and the matching ViewerAPI
const context = webvis.getContext();
const viewer = context.getViewer();

// define a list of cloud points to visualize
const points = [
  { position: [0, 1, 0], color: [1, 0, 0, 1] }, // first point
  { position: [0, 1, 1], color: [1, 0, 0, 1] }, // second point
  { position: [0, 0, 2], color: [1, 0, 0, 1] }, // third point
];

// create a point cloud
const pointCloudId = viewer.createPointCloud(points, { enabled: true });

// change the scale of the point cloud
viewer.changePointCloud(pointCloudId, { scale: 2.0 });

// remove the point cloud
viewer.removePointCloud(pointCloudId);

The following events are associated with the ViewerPointCloudAPI:

interface ViewerPointCloudAPI {
    changePointCloud(
        pointCloudId: number,
        properties: PointCloudProperties,
    ): void;
    createPointCloud(
        points: CloudPoint[],
        properties?: PointCloudProperties,
    ): number;
    getPointCloudData(pointCloudId: number): PointCloudProperties;
    getPointClouds(): number[];
    removePointCloud(pointCloudId: number): void;
}

Hierarchy (View Summary)

Methods

  • Experimental

    Experimental. May be changed in the future without notice.

    Changes one or more properties of the point cloud with the specified ID and triggers a ViewerPointCloudChangedEvent.

    Parameters

    Returns void

  • Experimental

    Experimental. May be changed in the future without notice.

    Returns the properties of a point cloud dataset.

    Parameters

    • pointCloudId: number

      The ID of point cloud to query. Obtained using createPointCloud.

    Returns PointCloudProperties

    Properties of the point cloud.

  • Experimental

    Experimental. May be changed in the future without notice.

    Returns a list of all point clouds.

    Returns number[]

    Array of point cloud IDs.

  • Experimental

    Experimental. May be changed in the future without notice.

    Removes the point cloud with the specified ID and triggers a ViewerPointCloudRemovedEvent.

    Parameters

    • pointCloudId: number

      The ID of point cloud to remove. Obtained using createPointCloud.

    Returns void


Did you find this page useful? Please give it a rating:
Thank you for rating this page!
Any issues or feedback?
What kind of problem would you like to report?
Please tell us more about what's wrong: