potree-core 2.0.10 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/dem-node.d.ts +56 -0
- package/dist/features.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/loading/load-poc.d.ts +5 -8
- package/dist/loading2/OctreeGeometryNode.d.ts +27 -1
- package/dist/loading2/OctreeLoader.d.ts +46 -4
- package/dist/loading2/RequestManager.d.ts +20 -0
- package/dist/loading2/WorkerPool.d.ts +33 -1
- package/dist/loading2/load-octree.d.ts +9 -2
- package/dist/materials/blur-material.d.ts +45 -0
- package/dist/materials/eye-dome-lighting-material.d.ts +25 -0
- package/dist/materials/index.d.ts +1 -0
- package/dist/materials/point-cloud-material.d.ts +80 -0
- package/dist/point-cloud-octree-node.d.ts +50 -0
- package/dist/point-cloud-octree-picker.d.ts +6 -9
- package/dist/point-cloud-octree.d.ts +74 -4
- package/dist/point-cloud-tree.d.ts +11 -0
- package/dist/potree.d.ts +27 -8
- package/dist/rendering/edl-pass.d.ts +25 -0
- package/dist/rendering/potree-renderer.d.ts +83 -0
- package/dist/rendering/screen-pass.d.ts +11 -0
- package/dist/type-predicates.d.ts +12 -0
- package/dist/types.d.ts +4 -2
- package/dist/utils/binary-heap.d.ts +16 -0
- package/dist/utils/bounds.d.ts +12 -1
- package/dist/utils/box3-helper.d.ts +2 -6
- package/dist/utils/lru.d.ts +57 -3
- package/dist/utils/math.d.ts +8 -0
- package/dist/version.d.ts +18 -0
- package/package.json +8 -7
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { PointCloudOctreeGeometry } from '../point-cloud-octree-geometry';
|
|
2
2
|
import { GetUrlFn, XhrRequest } from './types';
|
|
3
3
|
/**
|
|
4
|
+
* Loads a Point Cloud Octree (POC) from a given URL.
|
|
4
5
|
*
|
|
5
|
-
* @param url
|
|
6
|
-
*
|
|
7
|
-
* @param
|
|
8
|
-
*
|
|
9
|
-
* and shoud return a new url (e.g. signed) in the form of a string or a promise.
|
|
10
|
-
* @param xhrRequest An arrow function for a fetch request
|
|
11
|
-
* @returns
|
|
12
|
-
* An observable which emits once when the first LOD of the point cloud is loaded.
|
|
6
|
+
* @param url - The url of the point cloud file (usually cloud.js).
|
|
7
|
+
* @param getUrl - Function which receives the relative URL of a point cloud chunk file which is to be loaded and shoud return a new url (e.g. signed) in the form of a string or a promise.
|
|
8
|
+
* @param xhrRequest - An arrow function for a fetch request
|
|
9
|
+
* @returns An observable which emits once when the first LOD of the point cloud is loaded.
|
|
13
10
|
*/
|
|
14
11
|
export declare function loadPOC(url: string, getUrl: GetUrlFn, xhrRequest: XhrRequest): Promise<PointCloudOctreeGeometry>;
|
|
@@ -1,34 +1,60 @@
|
|
|
1
1
|
import { IPointCloudTreeNode } from './../types';
|
|
2
2
|
import { Box3, Sphere, BufferGeometry } from 'three';
|
|
3
3
|
import { OctreeGeometry } from './OctreeGeometry';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a node in an octree structure for point cloud geometry.
|
|
6
|
+
*/
|
|
4
7
|
export declare class OctreeGeometryNode implements IPointCloudTreeNode {
|
|
5
8
|
name: string;
|
|
6
9
|
octreeGeometry: OctreeGeometry;
|
|
7
10
|
boundingBox: Box3;
|
|
8
|
-
|
|
11
|
+
/** Indicates if the node's geometry has been loaded. */
|
|
9
12
|
loaded: boolean;
|
|
13
|
+
/** Indicates if the node's geometry is currently loading. */
|
|
10
14
|
loading: boolean;
|
|
15
|
+
/** Reference to the parent node, or null if this is the root. */
|
|
11
16
|
parent: OctreeGeometryNode | null;
|
|
17
|
+
/** The geometry data associated with this node, or null if not loaded. */
|
|
12
18
|
geometry: BufferGeometry | null;
|
|
19
|
+
/** Optional type identifier for the node. */
|
|
13
20
|
nodeType?: number;
|
|
21
|
+
/** Optional byte offset for the node's data in the source file. */
|
|
14
22
|
byteOffset?: bigint;
|
|
23
|
+
/** Optional byte size of the node's data in the source file. */
|
|
15
24
|
byteSize?: bigint;
|
|
25
|
+
/** Optional byte offset for the node's hierarchy data. */
|
|
16
26
|
hierarchyByteOffset?: bigint;
|
|
27
|
+
/** Optional byte size of the node's hierarchy data. */
|
|
17
28
|
hierarchyByteSize?: bigint;
|
|
29
|
+
/** Indicates if the node has children. */
|
|
18
30
|
hasChildren: boolean;
|
|
31
|
+
/** The spacing value for the node's points. */
|
|
19
32
|
spacing: number;
|
|
33
|
+
/** Optional density value for the node's points. */
|
|
20
34
|
density?: number;
|
|
35
|
+
/** Indicates if the node is a leaf node (has no children). */
|
|
21
36
|
isLeafNode: boolean;
|
|
37
|
+
/** Indicates if this node is a tree node (always false for geometry nodes). */
|
|
22
38
|
readonly isTreeNode: boolean;
|
|
39
|
+
/** Indicates if this node is a geometry node (always true). */
|
|
23
40
|
readonly isGeometryNode: boolean;
|
|
41
|
+
/** Array of child nodes (up to 8 for an octree), or null if no child at that position. */
|
|
24
42
|
readonly children: ReadonlyArray<OctreeGeometryNode | null>;
|
|
43
|
+
/** Static counter for generating unique node IDs. */
|
|
25
44
|
static IDCount: number;
|
|
45
|
+
/** Unique identifier for this node. */
|
|
26
46
|
id: number;
|
|
47
|
+
/** Index of this node within its parent. */
|
|
27
48
|
index: number;
|
|
49
|
+
/** Bounding sphere enclosing the node's geometry. */
|
|
28
50
|
boundingSphere: Sphere;
|
|
51
|
+
/** Number of points contained in this node. */
|
|
29
52
|
numPoints: number;
|
|
53
|
+
/** Level of the node in the octree hierarchy. */
|
|
30
54
|
level: number;
|
|
55
|
+
/** Array of handlers to be called once when the node is disposed. */
|
|
31
56
|
oneTimeDisposeHandlers: Function[];
|
|
57
|
+
constructor(name: string, octreeGeometry: OctreeGeometry, boundingBox: Box3);
|
|
32
58
|
getLevel(): number;
|
|
33
59
|
isLoaded(): boolean;
|
|
34
60
|
getBoundingSphere(): Sphere;
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import { XhrRequest } from './../loading/types';
|
|
2
1
|
import { PointAttributes } from './PointAttributes';
|
|
3
2
|
import { WorkerPool } from './WorkerPool';
|
|
4
3
|
import { OctreeGeometryNode } from './OctreeGeometryNode';
|
|
5
4
|
import { OctreeGeometry } from './OctreeGeometry';
|
|
5
|
+
import { RequestManager } from './RequestManager';
|
|
6
|
+
/**
|
|
7
|
+
* NodeLoader is responsible for loading the geometry of octree nodes.
|
|
8
|
+
*/
|
|
6
9
|
export declare class NodeLoader {
|
|
7
10
|
url: string;
|
|
8
11
|
workerPool: WorkerPool;
|
|
9
12
|
metadata: Metadata;
|
|
13
|
+
requestManager: RequestManager;
|
|
14
|
+
/**
|
|
15
|
+
* Point attributes to be used when loading the geometry.
|
|
16
|
+
*/
|
|
10
17
|
attributes?: PointAttributes;
|
|
18
|
+
/**
|
|
19
|
+
* Scale applied to the geometry when loading.
|
|
20
|
+
*/
|
|
11
21
|
scale?: [number, number, number];
|
|
22
|
+
/**
|
|
23
|
+
* Offset applied to the geometry when loading.
|
|
24
|
+
*/
|
|
12
25
|
offset?: [number, number, number];
|
|
13
|
-
constructor(url: string, workerPool: WorkerPool, metadata: Metadata);
|
|
26
|
+
constructor(url: string, workerPool: WorkerPool, metadata: Metadata, requestManager: RequestManager);
|
|
27
|
+
/**
|
|
28
|
+
* Loads the geometry for a given octree node.
|
|
29
|
+
*
|
|
30
|
+
* @param node - The octree node to load.
|
|
31
|
+
*/
|
|
14
32
|
load(node: OctreeGeometryNode): Promise<void>;
|
|
15
33
|
parseHierarchy(node: OctreeGeometryNode, buffer: ArrayBuffer): void;
|
|
16
34
|
loadHierarchy(node: OctreeGeometryNode): Promise<void>;
|
|
@@ -68,6 +86,9 @@ declare let typenameTypeattributeMap: {
|
|
|
68
86
|
};
|
|
69
87
|
};
|
|
70
88
|
type AttributeType = keyof typeof typenameTypeattributeMap;
|
|
89
|
+
/**
|
|
90
|
+
* Attribute interface defines the structure of an attribute in the octree geometry.
|
|
91
|
+
*/
|
|
71
92
|
export interface Attribute {
|
|
72
93
|
name: string;
|
|
73
94
|
description: string;
|
|
@@ -77,6 +98,9 @@ export interface Attribute {
|
|
|
77
98
|
min: number[];
|
|
78
99
|
max: number[];
|
|
79
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Metadata interface defines the structure of the metadata for an octree geometry.
|
|
103
|
+
*/
|
|
80
104
|
export interface Metadata {
|
|
81
105
|
version: string;
|
|
82
106
|
name: string;
|
|
@@ -98,11 +122,29 @@ export interface Metadata {
|
|
|
98
122
|
encoding: string;
|
|
99
123
|
attributes: Attribute[];
|
|
100
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* OctreeLoader is responsible for loading octree geometries from a given URL.
|
|
127
|
+
*/
|
|
101
128
|
export declare class OctreeLoader {
|
|
129
|
+
/**
|
|
130
|
+
* WorkerPool instance used for managing workers for loading tasks.
|
|
131
|
+
*/
|
|
102
132
|
workerPool: WorkerPool;
|
|
103
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Parses the attributes from a JSON array and converts them into PointAttributes.
|
|
135
|
+
*
|
|
136
|
+
* @param jsonAttributes Array of attributes in JSON format.
|
|
137
|
+
* @returns A PointAttributes instance containing the parsed attributes.
|
|
138
|
+
*/
|
|
104
139
|
static parseAttributes(jsonAttributes: Attribute[]): PointAttributes;
|
|
105
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Loads an octree geometry from a given URL using the provided RequestManager.
|
|
142
|
+
*
|
|
143
|
+
* @param url - The URL from which to load the octree geometry metadata.
|
|
144
|
+
* @param requestManager - The RequestManager instance used to handle HTTP requests.
|
|
145
|
+
* @returns Geometry object containing the loaded octree geometry.
|
|
146
|
+
*/
|
|
147
|
+
load(url: string, requestManager: RequestManager): Promise<{
|
|
106
148
|
geometry: OctreeGeometry;
|
|
107
149
|
}>;
|
|
108
150
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequestManager interface for handling HTTP requests.
|
|
3
|
+
*
|
|
4
|
+
* This interface defines methods for fetching resources and resolving URLs.
|
|
5
|
+
*/
|
|
6
|
+
export interface RequestManager {
|
|
7
|
+
/**
|
|
8
|
+
* Fetches a resource from the network.
|
|
9
|
+
*
|
|
10
|
+
* @param input - The resource to fetch, which can be a URL string or a Request object.
|
|
11
|
+
* @param init - Optional parameters for the request, such as method, headers, body, etc.
|
|
12
|
+
*/
|
|
13
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
14
|
+
/**
|
|
15
|
+
* Get the URL for a given resource.
|
|
16
|
+
*
|
|
17
|
+
* @param url - The URL of the resource to resolve.
|
|
18
|
+
*/
|
|
19
|
+
getUrl(url: string): Promise<string>;
|
|
20
|
+
}
|
|
@@ -1,9 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumerates the types of workers available in the worker pool.
|
|
3
|
+
*/
|
|
1
4
|
export declare enum WorkerType {
|
|
5
|
+
/**
|
|
6
|
+
* Worker for decoding Brotli-compressed data.
|
|
7
|
+
*/
|
|
2
8
|
DECODER_WORKER_BROTLI = "DECODER_WORKER_BROTLI",
|
|
9
|
+
/**
|
|
10
|
+
* Worker for general decoding tasks.
|
|
11
|
+
*/
|
|
3
12
|
DECODER_WORKER = "DECODER_WORKER"
|
|
4
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* WorkerPool manages a collection of worker instances, allowing for efficient retrieval and return of workers based on their type.
|
|
16
|
+
*/
|
|
5
17
|
export declare class WorkerPool {
|
|
6
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Workers will be an object that has a key for each worker type and the value is an array of Workers that can be empty.
|
|
20
|
+
*/
|
|
21
|
+
workers: {
|
|
22
|
+
[key in WorkerType]: Worker[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves a Worker instance from the pool associated with the specified worker type.
|
|
26
|
+
*
|
|
27
|
+
* If no worker instances are available, a new worker is created and added to the pool before retrieving one.
|
|
28
|
+
*
|
|
29
|
+
* @param workerType - The type of the worker to retrieve.
|
|
30
|
+
* @returns A Worker instance corresponding to the specified worker type.
|
|
31
|
+
* @throws Error if the worker type is not recognized or if no workers are available in the pool.
|
|
32
|
+
*/
|
|
7
33
|
getWorker(workerType: WorkerType): Worker;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a worker instance to the pool for the specified worker type.
|
|
36
|
+
*
|
|
37
|
+
* @param workerType - The type of the worker, which determines the corresponding pool.
|
|
38
|
+
* @param worker - The worker instance to be returned to the pool.
|
|
39
|
+
*/
|
|
8
40
|
returnWorker(workerType: WorkerType, worker: Worker): void;
|
|
9
41
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { type RequestManager } from './RequestManager';
|
|
2
|
+
/**
|
|
3
|
+
* Loads an octree geometry from a specified URL using the provided request manager.
|
|
4
|
+
*
|
|
5
|
+
* @param url - The URL of the octree geometry to load.
|
|
6
|
+
* @param requestManager - The request manager to handle network requests.
|
|
7
|
+
* @returns A promise that resolves to the loaded octree geometry.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadOctree(url: string, requestManager: RequestManager): Promise<import("./OctreeGeometry").OctreeGeometry>;
|
|
@@ -1,11 +1,56 @@
|
|
|
1
1
|
import { ShaderMaterial, Texture } from 'three';
|
|
2
2
|
import { IUniform } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Uniforms interface for blur material shader.
|
|
5
|
+
*
|
|
6
|
+
* Defines the uniform variables that control blur rendering parameters.
|
|
7
|
+
*
|
|
8
|
+
* Check http://john-chapman-graphics.blogspot.co.at/2013/01/ssao-tutorial.html
|
|
9
|
+
*/
|
|
3
10
|
export interface IBlurMaterialUniforms {
|
|
11
|
+
/**
|
|
12
|
+
* Generic uniform property accessor.
|
|
13
|
+
* @param name - The name of the uniform property
|
|
14
|
+
*/
|
|
4
15
|
[name: string]: IUniform<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Screen width in pixels.
|
|
18
|
+
* Used to calculate blur kernel size and sampling coordinates.
|
|
19
|
+
*/
|
|
5
20
|
screenWidth: IUniform<number>;
|
|
21
|
+
/**
|
|
22
|
+
* Screen height in pixels.
|
|
23
|
+
* Used to calculate blur kernel size and sampling coordinates.
|
|
24
|
+
*/
|
|
6
25
|
screenHeight: IUniform<number>;
|
|
26
|
+
/**
|
|
27
|
+
* Input texture to be blurred.
|
|
28
|
+
* Can be null if no texture is currently bound.
|
|
29
|
+
*/
|
|
7
30
|
map: IUniform<Texture | null>;
|
|
8
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Represents a custom shader material for applying a blur effect.
|
|
34
|
+
*
|
|
35
|
+
* Extends the base ShaderMaterial class and sets up the required shaders and uniforms.
|
|
36
|
+
*
|
|
37
|
+
* This material uses custom vertex and fragment shaders for blurring.
|
|
38
|
+
*/
|
|
9
39
|
export declare class BlurMaterial extends ShaderMaterial {
|
|
40
|
+
/**
|
|
41
|
+
* The GLSL source code for the vertex shader.
|
|
42
|
+
*/
|
|
43
|
+
vertexShader: any;
|
|
44
|
+
/**
|
|
45
|
+
* The GLSL source code for the fragment shader.
|
|
46
|
+
*/
|
|
47
|
+
fragmentShader: any;
|
|
48
|
+
/**
|
|
49
|
+
* The set of uniforms used by the blur shader.
|
|
50
|
+
*
|
|
51
|
+
* @property screenWidth - The width of the screen, used for blur calculations.
|
|
52
|
+
* @property screenHeight - The height of the screen, used for blur calculations.
|
|
53
|
+
* @property map - The texture to which the blur effect will be applied.
|
|
54
|
+
*/
|
|
10
55
|
uniforms: IBlurMaterialUniforms;
|
|
11
56
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Matrix4, RawShaderMaterial, Texture } from 'three';
|
|
2
|
+
import { IUniform } from './types';
|
|
3
|
+
export interface IEyeDomeLightingMaterialUniforms {
|
|
4
|
+
[name: string]: IUniform<any>;
|
|
5
|
+
screenWidth: IUniform<number>;
|
|
6
|
+
screenHeight: IUniform<number>;
|
|
7
|
+
edlStrength: IUniform<number>;
|
|
8
|
+
radius: IUniform<number>;
|
|
9
|
+
opacity: IUniform<number>;
|
|
10
|
+
neighbours: IUniform<Float32Array>;
|
|
11
|
+
uProj: IUniform<Float32Array>;
|
|
12
|
+
colorMap: IUniform<Texture | null>;
|
|
13
|
+
}
|
|
14
|
+
export declare class EyeDomeLightingMaterial extends RawShaderMaterial {
|
|
15
|
+
uniforms: IEyeDomeLightingMaterialUniforms;
|
|
16
|
+
private _neighbourCount;
|
|
17
|
+
private neighboursArray;
|
|
18
|
+
constructor();
|
|
19
|
+
get neighbourCount(): number;
|
|
20
|
+
set neighbourCount(value: number);
|
|
21
|
+
private initializeNeighboursArray;
|
|
22
|
+
private getDefines;
|
|
23
|
+
updateShaderSource(): void;
|
|
24
|
+
setProjectionMatrix(projectionMatrix: Matrix4): void;
|
|
25
|
+
}
|
|
@@ -5,64 +5,143 @@ import { ClipMode, IClipBox } from './clipping';
|
|
|
5
5
|
import { PointColorType, PointOpacityType, PointShape, PointSizeType, TreeType } from './enums';
|
|
6
6
|
import { IClassification, IGradient, IUniform } from './types';
|
|
7
7
|
import { ColorEncoding } from './color-encoding';
|
|
8
|
+
/**
|
|
9
|
+
* Configuration parameters for point cloud material rendering.
|
|
10
|
+
*
|
|
11
|
+
* @interface IPointCloudMaterialParameters
|
|
12
|
+
*/
|
|
8
13
|
export interface IPointCloudMaterialParameters {
|
|
14
|
+
/**
|
|
15
|
+
* The base size of points in the point cloud.
|
|
16
|
+
*/
|
|
9
17
|
size: number;
|
|
18
|
+
/**
|
|
19
|
+
* The minimum allowed size for points when scaling.
|
|
20
|
+
*/
|
|
10
21
|
minSize: number;
|
|
22
|
+
/**
|
|
23
|
+
* The maximum allowed size for points when scaling.
|
|
24
|
+
*/
|
|
11
25
|
maxSize: number;
|
|
26
|
+
/**
|
|
27
|
+
* The type of tree structure used for organizing the point cloud data.
|
|
28
|
+
*/
|
|
12
29
|
treeType: TreeType;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to use the new format for point cloud data processing.
|
|
32
|
+
*/
|
|
13
33
|
newFormat: boolean;
|
|
14
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Interface defining uniforms for point cloud material rendering in WebGL shaders.
|
|
37
|
+
* These uniforms control various aspects of point cloud visualization including
|
|
38
|
+
* appearance, filtering, transformations, and rendering parameters.
|
|
39
|
+
*
|
|
40
|
+
* @interface IPointCloudMaterialUniforms
|
|
41
|
+
*/
|
|
15
42
|
export interface IPointCloudMaterialUniforms {
|
|
43
|
+
/** Bounding box size as [width, height, depth] */
|
|
16
44
|
bbSize: IUniform<[number, number, number]>;
|
|
45
|
+
/** Supplement value for depth blending calculations */
|
|
17
46
|
blendDepthSupplement: IUniform<number>;
|
|
47
|
+
/** Hardness factor for blending operations */
|
|
18
48
|
blendHardness: IUniform<number>;
|
|
49
|
+
/** Lookup texture for point classification rendering */
|
|
19
50
|
classificationLUT: IUniform<Texture>;
|
|
51
|
+
/** Number of active clipping boxes */
|
|
20
52
|
clipBoxCount: IUniform<number>;
|
|
53
|
+
/** Array containing clipping box parameters */
|
|
21
54
|
clipBoxes: IUniform<Float32Array>;
|
|
55
|
+
/** Depth map texture for depth-based effects, null if not used */
|
|
22
56
|
depthMap: IUniform<Texture | null>;
|
|
57
|
+
/** Diffuse color as RGB values [r, g, b] */
|
|
23
58
|
diffuse: IUniform<[number, number, number]>;
|
|
59
|
+
/** Field of view angle in radians */
|
|
24
60
|
fov: IUniform<number>;
|
|
61
|
+
/** Gradient texture for color mapping */
|
|
25
62
|
gradient: IUniform<Texture>;
|
|
63
|
+
/** Maximum height value for elevation-based coloring */
|
|
26
64
|
heightMax: IUniform<number>;
|
|
65
|
+
/** Minimum height value for elevation-based coloring */
|
|
27
66
|
heightMin: IUniform<number>;
|
|
67
|
+
/** Brightness adjustment for intensity values */
|
|
28
68
|
intensityBrightness: IUniform<number>;
|
|
69
|
+
/** Contrast adjustment for intensity values */
|
|
29
70
|
intensityContrast: IUniform<number>;
|
|
71
|
+
/** Gamma correction for intensity values */
|
|
30
72
|
intensityGamma: IUniform<number>;
|
|
73
|
+
/** Intensity range as [min, max] values */
|
|
31
74
|
intensityRange: IUniform<[number, number]>;
|
|
75
|
+
/** Current level of detail */
|
|
32
76
|
level: IUniform<number>;
|
|
77
|
+
/** Maximum point size in pixels */
|
|
33
78
|
maxSize: IUniform<number>;
|
|
79
|
+
/** Minimum point size in pixels */
|
|
34
80
|
minSize: IUniform<number>;
|
|
81
|
+
/** Size of the octree structure */
|
|
35
82
|
octreeSize: IUniform<number>;
|
|
83
|
+
/** Overall opacity of the point cloud (0.0 to 1.0) */
|
|
36
84
|
opacity: IUniform<number>;
|
|
85
|
+
/** Point cloud index identifier */
|
|
37
86
|
pcIndex: IUniform<number>;
|
|
87
|
+
/** Brightness adjustment for RGB color values */
|
|
38
88
|
rgbBrightness: IUniform<number>;
|
|
89
|
+
/** Contrast adjustment for RGB color values */
|
|
39
90
|
rgbContrast: IUniform<number>;
|
|
91
|
+
/** Gamma correction for RGB color values */
|
|
40
92
|
rgbGamma: IUniform<number>;
|
|
93
|
+
/** Screen height in pixels */
|
|
41
94
|
screenHeight: IUniform<number>;
|
|
95
|
+
/** Screen width in pixels */
|
|
42
96
|
screenWidth: IUniform<number>;
|
|
97
|
+
/** Orthographic camera height */
|
|
43
98
|
orthoHeight: IUniform<number>;
|
|
99
|
+
/** Orthographic camera width */
|
|
44
100
|
orthoWidth: IUniform<number>;
|
|
101
|
+
/** Flag indicating whether orthographic camera is being used */
|
|
45
102
|
useOrthographicCamera: IUniform<boolean>;
|
|
103
|
+
/** Far clipping plane distance */
|
|
46
104
|
far: IUniform<number>;
|
|
105
|
+
/** Base point size */
|
|
47
106
|
size: IUniform<number>;
|
|
107
|
+
/** Spacing between points */
|
|
48
108
|
spacing: IUniform<number>;
|
|
109
|
+
/** Transformation matrix to model space */
|
|
49
110
|
toModel: IUniform<number[]>;
|
|
111
|
+
/** Transition factor for animations or interpolations */
|
|
50
112
|
transition: IUniform<number>;
|
|
113
|
+
/** Color uniform for material */
|
|
51
114
|
uColor: IUniform<Color>;
|
|
115
|
+
/** Texture containing visible node information */
|
|
52
116
|
visibleNodes: IUniform<Texture>;
|
|
117
|
+
/** Starting index for visible nodes */
|
|
53
118
|
vnStart: IUniform<number>;
|
|
119
|
+
/** Weight factor for classification-based coloring */
|
|
54
120
|
wClassification: IUniform<number>;
|
|
121
|
+
/** Weight factor for elevation-based coloring */
|
|
55
122
|
wElevation: IUniform<number>;
|
|
123
|
+
/** Weight factor for intensity-based coloring */
|
|
56
124
|
wIntensity: IUniform<number>;
|
|
125
|
+
/** Weight factor for return number-based coloring */
|
|
57
126
|
wReturnNumber: IUniform<number>;
|
|
127
|
+
/** Weight factor for RGB color contribution */
|
|
58
128
|
wRGB: IUniform<number>;
|
|
129
|
+
/** Weight factor for source ID-based coloring */
|
|
59
130
|
wSourceID: IUniform<number>;
|
|
131
|
+
/** Opacity attenuation factor based on distance or other criteria */
|
|
60
132
|
opacityAttenuation: IUniform<number>;
|
|
133
|
+
/** Threshold value for normal-based point filtering */
|
|
61
134
|
filterByNormalThreshold: IUniform<number>;
|
|
135
|
+
/** 3D coordinate of the highlighted point */
|
|
62
136
|
highlightedPointCoordinate: IUniform<Vector3>;
|
|
137
|
+
/** RGBA color for highlighted point rendering */
|
|
63
138
|
highlightedPointColor: IUniform<Vector4>;
|
|
139
|
+
/** Flag to enable or disable point highlighting feature */
|
|
64
140
|
enablePointHighlighting: IUniform<boolean>;
|
|
141
|
+
/** Scale factor for highlighted point size */
|
|
65
142
|
highlightedPointScale: IUniform<number>;
|
|
143
|
+
/** Scale factor for view-dependent sizing */
|
|
144
|
+
viewScale: IUniform<number>;
|
|
66
145
|
}
|
|
67
146
|
export declare class PointCloudMaterial extends RawShaderMaterial {
|
|
68
147
|
private static helperVec3;
|
|
@@ -115,6 +194,7 @@ export declare class PointCloudMaterial extends RawShaderMaterial {
|
|
|
115
194
|
highlightedPointColor: Vector4;
|
|
116
195
|
enablePointHighlighting: boolean;
|
|
117
196
|
highlightedPointScale: number;
|
|
197
|
+
viewScale: number;
|
|
118
198
|
useClipBox: boolean;
|
|
119
199
|
weighted: boolean;
|
|
120
200
|
pointColorType: PointColorType;
|
|
@@ -2,17 +2,67 @@ import { Box3, EventDispatcher, Object3D, Points, Sphere } from 'three';
|
|
|
2
2
|
import { PointCloudOctreeGeometryNode } from './point-cloud-octree-geometry-node';
|
|
3
3
|
import { IPointCloudTreeNode } from './types';
|
|
4
4
|
export declare class PointCloudOctreeNode extends EventDispatcher implements IPointCloudTreeNode {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for the node, automatically incremented.
|
|
7
|
+
*/
|
|
5
8
|
geometryNode: PointCloudOctreeGeometryNode;
|
|
9
|
+
/**
|
|
10
|
+
* The scene node that represents this octree node in the 3D scene.
|
|
11
|
+
*
|
|
12
|
+
* It contains the points of the point cloud.
|
|
13
|
+
*/
|
|
6
14
|
sceneNode: Points;
|
|
15
|
+
/**
|
|
16
|
+
* The index of the point cloud in the scene, if applicable.
|
|
17
|
+
*
|
|
18
|
+
* This is used to identify which point cloud this node belongs to.
|
|
19
|
+
*/
|
|
7
20
|
pcIndex: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The bounding box node for this octree node, if applicable.
|
|
23
|
+
*
|
|
24
|
+
* This is used for visualizing the bounding box in the scene.
|
|
25
|
+
*/
|
|
8
26
|
boundingBoxNode: Object3D | null;
|
|
27
|
+
/**
|
|
28
|
+
* An array of child nodes, which can be null if there are no children at that position.
|
|
29
|
+
*
|
|
30
|
+
* This is used to traverse the octree structure.
|
|
31
|
+
*/
|
|
9
32
|
readonly children: (IPointCloudTreeNode | null)[];
|
|
33
|
+
/**
|
|
34
|
+
* Indicates whether the node's geometry has been loaded.
|
|
35
|
+
*/
|
|
10
36
|
readonly loaded = true;
|
|
37
|
+
/**
|
|
38
|
+
* Indicates whether the node is currently loading.
|
|
39
|
+
*/
|
|
11
40
|
readonly isTreeNode: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Indicates whether this node is a geometry node.
|
|
43
|
+
*
|
|
44
|
+
* This is always false for PointCloudOctreeNode, as it represents a tree node.
|
|
45
|
+
*/
|
|
12
46
|
readonly isGeometryNode: boolean;
|
|
13
47
|
constructor(geometryNode: PointCloudOctreeGeometryNode, sceneNode: Points);
|
|
48
|
+
/**
|
|
49
|
+
* Disposes of the resources used by this node.
|
|
50
|
+
*
|
|
51
|
+
* This method should be called when the node is no longer needed to free up memory.
|
|
52
|
+
*/
|
|
14
53
|
dispose(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Disposes of the scene node associated with this octree node.
|
|
56
|
+
*
|
|
57
|
+
* This method removes the geometry and its attributes from the scene node to free up resources.
|
|
58
|
+
*/
|
|
15
59
|
disposeSceneNode(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Traverses the octree node and executes a callback function for each node.
|
|
62
|
+
*
|
|
63
|
+
* @param cb - The callback function to execute for each node.
|
|
64
|
+
* @param includeSelf - If true, the callback will also be executed for this node.
|
|
65
|
+
*/
|
|
16
66
|
traverse(cb: (node: IPointCloudTreeNode) => void, includeSelf?: boolean): void;
|
|
17
67
|
get id(): number;
|
|
18
68
|
get name(): string;
|
|
@@ -6,19 +6,16 @@ export interface PickParams {
|
|
|
6
6
|
pickWindowSize: number;
|
|
7
7
|
pickOutsideClipRegion: boolean;
|
|
8
8
|
/**
|
|
9
|
-
* If provided, the picking will use this pixel position instead of the `Ray` passed to the `pick`
|
|
10
|
-
* method.
|
|
9
|
+
* If provided, the picking will use this pixel position instead of the `Ray` passed to the `pick` method.
|
|
11
10
|
*/
|
|
12
11
|
pixelPosition: Vector3;
|
|
13
12
|
/**
|
|
14
|
-
* Function which gets called after a picking material has been created and setup and before the
|
|
15
|
-
* point cloud is rendered into the picking render target. This gives applications a chance to
|
|
16
|
-
* customize the renderTarget and the material.
|
|
13
|
+
* Function which gets called after a picking material has been created and setup and before the point cloud is rendered into the picking render target.
|
|
17
14
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @param
|
|
21
|
-
*
|
|
15
|
+
* This gives applications a chance to customize the renderTarget and the material.
|
|
16
|
+
*
|
|
17
|
+
* @param material - The pick material.
|
|
18
|
+
* @param renterTarget - The render target used for picking.
|
|
22
19
|
*/
|
|
23
20
|
onBeforePickRender: (material: PointCloudMaterial, renterTarget: WebGLRenderTarget) => void;
|
|
24
21
|
}
|