UNPKG

@loaders.gl/potree

Version:

potree loaders for large point clouds.

66 lines 2.48 kB
import { Mesh } from '@loaders.gl/schema'; import { DataSource, DataSourceProps, LoaderOptions } from '@loaders.gl/loader-utils'; import { PotreeMetadata } from "../types/potree-metadata.js"; import { POTreeNode } from "../parsers/parse-potree-hierarchy-chunk.js"; export type PotreeNodesSourceProps = DataSourceProps & { attributions?: string[]; potree?: { loadOptions?: LoaderOptions; }; }; /** * A Potree data source * @version 1.0 - https://github.com/potree/potree/blob/1.0RC/docs/file_format.md * @version 1.7 - https://github.com/potree/potree/blob/1.7/docs/potree-file-format.md * @note Point cloud nodes tile source */ export declare class PotreeNodesSource extends DataSource { /** Dataset base URL */ baseUrl: string; /** Input data: string - dataset url, blob - single file data */ data: string | Blob; /** Input props */ props: PotreeNodesSourceProps; /** Meta information from `cloud.js` */ metadata: PotreeMetadata | null; /** Root node */ root: POTreeNode | null; /** Is data source ready to use after initial loading */ isReady: boolean; private initPromise; /** * @constructor * @param data - if string - data set path url or path to `cloud.js` metadata file * - if Blob - single file data * @param props - data source properties */ constructor(data: string | Blob, props: PotreeNodesSourceProps); /** Initial data source loading */ init(): Promise<void>; /** Is data set supported */ isSupported(): boolean; /** Get content files extension */ getContentExtension(): string | null; /** * Load octree node content * @param path array of numbers between 0-7 specifying successive octree divisions. * @return node content geometry or null if the node doesn't exist */ loadNodeContent(path: number[]): Promise<Mesh | null>; /** * Check if a node exists in the octree * @param path array of numbers between 0-7 specifying successive octree divisions * @returns true - the node does exist, false - the nodes doesn't exist */ isNodeAvailable(path: number[]): Promise<boolean>; /** * Load data source hierarchy into tree of available nodes */ private loadHierarchy; /** * Deduce base url from the input url sring * @param data - data source input data */ private makeBaseUrl; } //# sourceMappingURL=potree-node-source.d.ts.map