@cognite/reveal 4.23.3-dev.20250206 → 4.23.3-dev.20250210
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/dist/api-entry-points/core.d.ts +1 -1
- package/dist/index.js +208 -204
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/Image360Facade.d.ts +3 -3
- package/dist/packages/utilities/index.d.ts +1 -0
- package/dist/packages/utilities/src/ClosestGeometryFinder.d.ts +71 -0
- package/dist/packages/utilities/src/three/isPointVisibleByPlanes.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { Camera, Matrix4, Vector2 } from 'three';
|
|
5
5
|
import { Image360Entity } from './entity/Image360Entity';
|
|
6
6
|
import { Image360CollectionFactory } from './collection/Image360CollectionFactory';
|
|
7
7
|
import { DefaultImage360Collection } from './collection/DefaultImage360Collection';
|
|
@@ -23,11 +23,11 @@ export declare class Image360Facade<T extends DataSourceType> {
|
|
|
23
23
|
hideAllHoverIcons(): boolean;
|
|
24
24
|
set allIconCullingScheme(scheme: IconCullingScheme);
|
|
25
25
|
constructor(_entityFactory: Image360CollectionFactory);
|
|
26
|
-
create<Image360CollectionSourceType extends DataSourceType>(collectionIdentifier: Image360CollectionSourceType['image360Identifier'], annotationFilter?: Image360AnnotationFilterOptions, postTransform?:
|
|
26
|
+
create<Image360CollectionSourceType extends DataSourceType>(collectionIdentifier: Image360CollectionSourceType['image360Identifier'], annotationFilter?: Image360AnnotationFilterOptions, postTransform?: Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection<T>>;
|
|
27
27
|
removeSet(collection: DefaultImage360Collection<T>): void;
|
|
28
28
|
delete(entity: Image360Entity<T>): Promise<void>;
|
|
29
29
|
preload(entity: Image360Entity<T>, revision: Image360RevisionEntity<T>, lockDownload?: boolean): Promise<void>;
|
|
30
30
|
getCollectionContainingEntity(entity: Image360Entity<T>): DefaultImage360Collection<T>;
|
|
31
|
-
intersect(coords:
|
|
31
|
+
intersect(coords: Vector2, camera: Camera): Image360IconIntersectionData<T> | undefined;
|
|
32
32
|
dispose(): void;
|
|
33
33
|
}
|
|
@@ -50,6 +50,7 @@ export { ICustomObject } from './src/customObject/ICustomObject';
|
|
|
50
50
|
export { CustomObjectIntersectInput } from './src/customObject/CustomObjectIntersectInput';
|
|
51
51
|
export { CustomObjectIntersection } from './src/customObject/CustomObjectIntersection';
|
|
52
52
|
export { Vector3Pool } from './src/three/Vector3Pool';
|
|
53
|
+
export { ClosestGeometryFinder } from './src/ClosestGeometryFinder';
|
|
53
54
|
export { isPointVisibleByPlanes } from './src/three/isPointVisibleByPlanes';
|
|
54
55
|
export { CDF_TO_VIEWER_TRANSFORMATION } from './src/constants';
|
|
55
56
|
export * from './src/workers/workerize-transferable';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { type Vector3 } from 'three';
|
|
5
|
+
/**
|
|
6
|
+
* A utility class to find and store the closest geometry to a given origin point.
|
|
7
|
+
* @template T - The type of the geometry.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare class ClosestGeometryFinder<T> {
|
|
11
|
+
private _closestGeometry;
|
|
12
|
+
private readonly _origin;
|
|
13
|
+
private _minDistanceSquared;
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of ClosestGeometryFinder.
|
|
16
|
+
*
|
|
17
|
+
* @param origin - The origin point from which distances are measured.
|
|
18
|
+
*/
|
|
19
|
+
constructor(origin: Vector3);
|
|
20
|
+
/**
|
|
21
|
+
* Sets the minimum distance to the closest geometry.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The minimum distance.
|
|
24
|
+
*/
|
|
25
|
+
set minDistance(value: number);
|
|
26
|
+
/**
|
|
27
|
+
* Gets the minimum distance to the closest geometry.
|
|
28
|
+
*
|
|
29
|
+
* @returns The minimum distance.
|
|
30
|
+
*/
|
|
31
|
+
get minDistance(): number;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the closest geometry found so far.
|
|
34
|
+
*
|
|
35
|
+
* @returns The closest geometry or undefined if no geometry has been added.
|
|
36
|
+
*/
|
|
37
|
+
getClosestGeometry(): T | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the closest geometry.
|
|
40
|
+
*
|
|
41
|
+
* @param geometry - The geometry to set as the closest.
|
|
42
|
+
*/
|
|
43
|
+
setClosestGeometry(geometry: T): void;
|
|
44
|
+
/**
|
|
45
|
+
* Checks if a given point is closer to the origin than the current closest geometry.
|
|
46
|
+
*
|
|
47
|
+
* @param point - The point to check.
|
|
48
|
+
* @returns True if the point is closer, false otherwise.
|
|
49
|
+
*/
|
|
50
|
+
isClosest(point: Vector3): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Clears the closest geometry and resets the minimum distance.
|
|
53
|
+
*/
|
|
54
|
+
clear(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Adds a geometry if the given point is closer to the origin than the current closest geometry.
|
|
57
|
+
*
|
|
58
|
+
* @param point - The point associated with the geometry.
|
|
59
|
+
* @param geometry - The geometry to add.
|
|
60
|
+
* @returns True if the geometry was added, false otherwise.
|
|
61
|
+
*/
|
|
62
|
+
add(point: Vector3, geometry: T): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Lazily adds a geometry if the given point is closer to the origin than the current closest geometry.
|
|
65
|
+
*
|
|
66
|
+
* @param point - The point associated with the geometry.
|
|
67
|
+
* @param geometryCreator - A function that creates the geometry to add.
|
|
68
|
+
* @returns True if the geometry was added, false otherwise.
|
|
69
|
+
*/
|
|
70
|
+
addLazy(point: Vector3, geometryCreator: () => T): boolean;
|
|
71
|
+
}
|
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
* Copyright 2024 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Vector3, Plane } from 'three';
|
|
5
|
+
/**
|
|
6
|
+
* Determines if a point is visible by a set of planes.
|
|
7
|
+
*
|
|
8
|
+
* @param planes - An array of Plane objects to check visibility against.
|
|
9
|
+
* @param point - The Vector3 point to be checked.
|
|
10
|
+
* @returns A boolean indicating whether the point is visible by all planes.
|
|
11
|
+
*/
|
|
5
12
|
export declare function isPointVisibleByPlanes(planes: Plane[], point: Vector3): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.23.3-dev.
|
|
3
|
+
"version": "4.23.3-dev.20250210",
|
|
4
4
|
"description": "WebGL based 3D viewer for CAD and point clouds processed in Cognite Data Fusion.",
|
|
5
5
|
"homepage": "https://github.com/cognitedata/reveal/tree/master/viewer",
|
|
6
6
|
"repository": {
|