@cognite/reveal 4.12.1-dev.20240430 → 4.12.1-dev.20240501
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/index.js +190 -190
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +1 -1
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +2 -1
- package/dist/packages/360-images/src/entity/Image360.d.ts +2 -2
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +4 -4
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +2 -1
- package/dist/packages/3d-overlays/src/Overlay3DCollection.d.ts +2 -2
- package/dist/packages/3d-overlays/src/OverlayCollection.d.ts +3 -2
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +5 -1
- package/dist/packages/api/src/public/migration/types.d.ts +8 -7
- package/dist/packages/cad-model/src/types.d.ts +2 -1
- package/dist/packages/cad-model/src/utilities/GeometryBufferUtils.d.ts +1 -1
- package/dist/packages/cad-styling/src/prioritized/AreaCollection.d.ts +5 -4
- package/dist/packages/cad-styling/src/prioritized/BoxClusterer.d.ts +1 -1
- package/dist/packages/cad-styling/src/prioritized/ClusteredAreaCollection.d.ts +5 -4
- package/dist/packages/cad-styling/src/prioritized/EmptyAreaCollection.d.ts +5 -4
- package/dist/packages/cad-styling/src/prioritized/types.d.ts +2 -1
- package/dist/packages/camera-manager/src/types.d.ts +10 -9
- package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +2 -1
- package/dist/packages/pointclouds/src/PointCloudNode.d.ts +6 -6
- package/dist/packages/pointclouds/src/potree-three-loader/tree/PointCloudOctreePickerHelper.d.ts +1 -1
- package/dist/packages/pointclouds/src/potree-three-loader/types/types.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/workers/assignPointsToObjectsWithWasm.d.ts +2 -1
- package/dist/packages/rendering/src/RenderPipelineProvider.d.ts +2 -1
- package/dist/packages/rendering/src/pointcloud-rendering/types.d.ts +3 -3
- package/dist/packages/rendering/src/rendering/SettableRenderTarget.d.ts +2 -1
- package/dist/packages/sector-parser/src/types.d.ts +5 -4
- package/dist/packages/tools/src/Measurement/types.d.ts +4 -3
- package/dist/packages/utilities/src/CameraConfiguration.d.ts +3 -2
- package/dist/packages/utilities/src/events/types.d.ts +5 -4
- package/package.json +78 -79
|
@@ -49,7 +49,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
49
49
|
get isCollectionVisible(): boolean;
|
|
50
50
|
constructor(collectionId: string, collectionLabel: string | undefined, entities: Image360Entity[], icons: IconCollection, annotationFilter: Image360AnnotationFilter, image360DataProvider: Image360DataProvider, setNeedsRedraw: () => void);
|
|
51
51
|
getModelTransformation(out?: Matrix4): Matrix4;
|
|
52
|
-
setModelTransformation(matrix:
|
|
52
|
+
setModelTransformation(matrix: Matrix4): void;
|
|
53
53
|
/**
|
|
54
54
|
* Subscribes to events on 360 Image datasets. There are several event types:
|
|
55
55
|
* 'image360Entered' - Subscribes to a event for entering 360 image mode.
|
|
@@ -5,6 +5,7 @@ import { Image360Provider } from '../../../data-providers';
|
|
|
5
5
|
import { BeforeSceneRenderedDelegate, DeviceDescriptor, EventTrigger, SceneHandler } from '../../../utilities';
|
|
6
6
|
import { DefaultImage360Collection } from './DefaultImage360Collection';
|
|
7
7
|
import { IconsOptions } from '../icons/IconCollection';
|
|
8
|
+
import { type Matrix4 } from 'three';
|
|
8
9
|
import { Image360AnnotationFilterOptions } from '../annotation/types';
|
|
9
10
|
export declare class Image360CollectionFactory<T> {
|
|
10
11
|
private readonly _image360DataProvider;
|
|
@@ -14,5 +15,5 @@ export declare class Image360CollectionFactory<T> {
|
|
|
14
15
|
private readonly _device;
|
|
15
16
|
private readonly _setNeedsRedraw;
|
|
16
17
|
constructor(image360DataProvider: Image360Provider<T>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, setNeedsRedraw: () => void, device: DeviceDescriptor, iconsOptions?: IconsOptions);
|
|
17
|
-
create(dataProviderFilter: T, postTransform:
|
|
18
|
+
create(dataProviderFilter: T, postTransform: Matrix4, preMultipliedRotation: boolean, annotationFilter: Image360AnnotationFilterOptions): Promise<DefaultImage360Collection>;
|
|
18
19
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Revision } from './Image360Revision';
|
|
5
5
|
import { Image360Visualization } from './Image360Visualization';
|
|
6
|
-
import { Color } from 'three';
|
|
6
|
+
import { Color, type Matrix4 } from 'three';
|
|
7
7
|
/**
|
|
8
8
|
* Image360 icon style
|
|
9
9
|
*/
|
|
@@ -23,7 +23,7 @@ export interface Image360 {
|
|
|
23
23
|
* of the given 360 image.
|
|
24
24
|
* @returns model-to-world transform of the 360 Image
|
|
25
25
|
*/
|
|
26
|
-
readonly transform:
|
|
26
|
+
readonly transform: Matrix4;
|
|
27
27
|
/**
|
|
28
28
|
* The object containing the unit cube with the 360 images.
|
|
29
29
|
* @returns Image360Visualization
|
|
@@ -10,7 +10,7 @@ import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
|
10
10
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
11
11
|
import { Overlay3DIcon } from '../../../3d-overlays';
|
|
12
12
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
13
|
-
import { Color, Matrix4 } from 'three';
|
|
13
|
+
import { Color, Matrix4, type Raycaster } from 'three';
|
|
14
14
|
export declare class Image360Entity implements Image360 {
|
|
15
15
|
private readonly _revisions;
|
|
16
16
|
private readonly _imageMetadata;
|
|
@@ -25,7 +25,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
25
25
|
* of the given 360 image.
|
|
26
26
|
* @returns model-to-world transform of the 360 Image
|
|
27
27
|
*/
|
|
28
|
-
get transform():
|
|
28
|
+
get transform(): Matrix4;
|
|
29
29
|
/**
|
|
30
30
|
* Get the icon that represents the 360
|
|
31
31
|
* image during normal visualization.
|
|
@@ -47,7 +47,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
47
47
|
* @returns Station label
|
|
48
48
|
* */
|
|
49
49
|
get label(): string | undefined;
|
|
50
|
-
constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, annotationFilterer: Image360AnnotationFilter, transform:
|
|
50
|
+
constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, annotationFilterer: Image360AnnotationFilter, transform: Matrix4, icon: Overlay3DIcon, device: DeviceDescriptor);
|
|
51
51
|
setWorldTransform(matrix: Matrix4): void;
|
|
52
52
|
/**
|
|
53
53
|
* List all historical images for this entity.
|
|
@@ -67,7 +67,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
67
67
|
* If all revisions are undated the first available revison is returned.
|
|
68
68
|
*/
|
|
69
69
|
getRevisionClosestToDate(date: Date): Image360RevisionEntity;
|
|
70
|
-
intersectAnnotations(raycaster:
|
|
70
|
+
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject | undefined;
|
|
71
71
|
/**
|
|
72
72
|
* Drops the GPU resources for the 360 image
|
|
73
73
|
*/
|
|
@@ -5,6 +5,7 @@ import { Image360DataProvider, Image360Descriptor } from '../../../data-provider
|
|
|
5
5
|
import { Image360Revision } from './Image360Revision';
|
|
6
6
|
import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
7
7
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
8
|
+
import { type Raycaster } from 'three';
|
|
8
9
|
import { Image360AnnotationAppearance } from '../annotation/types';
|
|
9
10
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
10
11
|
export declare class Image360RevisionEntity implements Image360Revision {
|
|
@@ -25,7 +26,7 @@ export declare class Image360RevisionEntity implements Image360Revision {
|
|
|
25
26
|
*/
|
|
26
27
|
get date(): Date | undefined;
|
|
27
28
|
getAnnotations(): Promise<ImageAnnotationObject[]>;
|
|
28
|
-
intersectAnnotations(raycaster:
|
|
29
|
+
intersectAnnotations(raycaster: Raycaster): ImageAnnotationObject | undefined;
|
|
29
30
|
/**
|
|
30
31
|
* Loads the textures needed for the 360 image (6 faces).
|
|
31
32
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { Color, Texture, Object3D } from 'three';
|
|
4
|
+
import { Color, Texture, Object3D, type Camera } from 'three';
|
|
5
5
|
import { Overlay3D } from './Overlay3D';
|
|
6
6
|
import { DefaultOverlay3DContentType, OverlayCollection, OverlayInfo } from './OverlayCollection';
|
|
7
7
|
export type Overlay3DCollectionOptions = {
|
|
@@ -24,7 +24,7 @@ export declare class Overlay3DCollection<MetadataType = DefaultOverlay3DContentT
|
|
|
24
24
|
setVisibility(visibility: boolean): void;
|
|
25
25
|
getOverlays(): Overlay3D<MetadataType>[];
|
|
26
26
|
addOverlays(overlayInfos: OverlayInfo<MetadataType>[]): Overlay3D<MetadataType>[];
|
|
27
|
-
sortOverlaysRelativeToCamera(camera:
|
|
27
|
+
sortOverlaysRelativeToCamera(camera: Camera): void;
|
|
28
28
|
removeOverlays(overlays: Overlay3D<MetadataType>[]): void;
|
|
29
29
|
removeAllOverlays(): void;
|
|
30
30
|
private rebuildOctree;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Vector3, Color } from 'three';
|
|
4
5
|
import { Overlay3D } from './Overlay3D';
|
|
5
6
|
/**
|
|
6
7
|
* The default metadata type contained in Overlays
|
|
@@ -15,7 +16,7 @@ export type OverlayInfo<ContentType = DefaultOverlay3DContentType> = {
|
|
|
15
16
|
/**
|
|
16
17
|
* Position of the overlay
|
|
17
18
|
*/
|
|
18
|
-
position:
|
|
19
|
+
position: Vector3;
|
|
19
20
|
/**
|
|
20
21
|
* The data contained in this overlay
|
|
21
22
|
*/
|
|
@@ -23,7 +24,7 @@ export type OverlayInfo<ContentType = DefaultOverlay3DContentType> = {
|
|
|
23
24
|
/**
|
|
24
25
|
* The color of this overlay. Will be set by collection if undefined
|
|
25
26
|
*/
|
|
26
|
-
color?:
|
|
27
|
+
color?: Color;
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* A set of overlays managed.
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { type Matrix4 } from 'three';
|
|
1
5
|
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
2
6
|
import { Image360Collection, Image360Entity, Image360, IconsOptions, Image360RevisionEntity, Image360AnnotationIntersection, Image360AnnotationFilterOptions } from '../../../360-images';
|
|
3
7
|
import { Image360DataModelIdentifier } from '../../../data-providers';
|
|
@@ -20,7 +24,7 @@ export declare class Image360ApiHelper {
|
|
|
20
24
|
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, iconsOptions?: IconsOptions);
|
|
21
25
|
get needsRedraw(): boolean;
|
|
22
26
|
resetRedraw(): void;
|
|
23
|
-
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform:
|
|
27
|
+
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform: Matrix4, preMultipliedRotation: boolean, annotationOptions?: Image360AnnotationFilterOptions): Promise<Image360Collection>;
|
|
24
28
|
getImageCollections(): Image360Collection[];
|
|
25
29
|
remove360Images(entities: Image360[]): Promise<void>;
|
|
26
30
|
remove360ImageCollection(collection: Image360Collection): void;
|
|
@@ -9,6 +9,7 @@ import { GeometryFilter, CogniteCadModel } from '../../../../cad-model';
|
|
|
9
9
|
import { DataSource } from '../../../../data-source';
|
|
10
10
|
import { EdlOptions } from '../../../../rendering';
|
|
11
11
|
import { Image360AnnotationFilterOptions } from '../../../../360-images';
|
|
12
|
+
import type { Vector2, WebGLRenderTarget, WebGLRenderer, Matrix4, Vector3 } from 'three';
|
|
12
13
|
/**
|
|
13
14
|
* Callback to monitor loaded requests and progress.
|
|
14
15
|
* Use OnLoadingCallback instead of onProgress/onComplete.
|
|
@@ -20,13 +21,13 @@ import { Image360AnnotationFilterOptions } from '../../../../360-images';
|
|
|
20
21
|
*/
|
|
21
22
|
export type OnLoadingCallback = (itemsLoaded: number, itemsRequested: number, itemsCulled: number) => void;
|
|
22
23
|
/**
|
|
23
|
-
* Some parameters of
|
|
24
|
+
* Some parameters of WebGLRenderer initialized with {@link Cognite3DViewer}.
|
|
24
25
|
*/
|
|
25
26
|
export type RenderParameters = {
|
|
26
27
|
/**
|
|
27
28
|
* Current width and height of the renderer's output canvas, in pixels.
|
|
28
29
|
*/
|
|
29
|
-
renderSize:
|
|
30
|
+
renderSize: Vector2;
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
32
33
|
* @module @cognite/reveal
|
|
@@ -42,7 +43,7 @@ export interface Cognite3DViewerOptions {
|
|
|
42
43
|
* Render to offscreen buffer instead of canvas.
|
|
43
44
|
*/
|
|
44
45
|
renderTargetOptions?: {
|
|
45
|
-
target:
|
|
46
|
+
target: WebGLRenderTarget;
|
|
46
47
|
autoSetSize?: boolean;
|
|
47
48
|
};
|
|
48
49
|
/**
|
|
@@ -63,7 +64,7 @@ export interface Cognite3DViewerOptions {
|
|
|
63
64
|
* Camera manager instance that is used for controlling the camera.
|
|
64
65
|
* It is responsible for all manipulations that are done with the camera,
|
|
65
66
|
* including animations and modification of state. Also, gives ability
|
|
66
|
-
* to provide custom `
|
|
67
|
+
* to provide custom `PerspectiveCamera` instance to {@link Cognite3DViewer}.
|
|
67
68
|
* Default implementation is {@link DefaultCameraManager}.
|
|
68
69
|
*/
|
|
69
70
|
cameraManager?: CameraManager;
|
|
@@ -72,7 +73,7 @@ export interface Cognite3DViewerOptions {
|
|
|
72
73
|
* Note that when providing a custom renderer, this should be configured with
|
|
73
74
|
* `'powerPreference': 'high-performance'` for best performance.
|
|
74
75
|
*/
|
|
75
|
-
renderer?:
|
|
76
|
+
renderer?: WebGLRenderer;
|
|
76
77
|
/**
|
|
77
78
|
* Generally Reveal will follow the resolution given by the size
|
|
78
79
|
* of the encapsulating DOM element of the Canvas {@link Cognite3DViewerOptions.domElement}.
|
|
@@ -168,7 +169,7 @@ export type AddImage360Options = {
|
|
|
168
169
|
/**
|
|
169
170
|
* An optional transformation which will be applied to all 360 images that are fetched.
|
|
170
171
|
*/
|
|
171
|
-
collectionTransform?:
|
|
172
|
+
collectionTransform?: Matrix4;
|
|
172
173
|
/**
|
|
173
174
|
* Set this to false if the 360 images' rotation is not pre-multiplied to fit the given model.
|
|
174
175
|
* @default true
|
|
@@ -191,7 +192,7 @@ export type CadIntersection = {
|
|
|
191
192
|
/**
|
|
192
193
|
* Coordinate of the intersection.
|
|
193
194
|
*/
|
|
194
|
-
point:
|
|
195
|
+
point: Vector3;
|
|
195
196
|
/**
|
|
196
197
|
* Tree index of the intersected 3D node.
|
|
197
198
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Units supported by {@link CogniteCadModel}.
|
|
6
7
|
*/
|
|
@@ -13,7 +14,7 @@ export type GeometryFilter = {
|
|
|
13
14
|
* or set in {@link https://fusion.cognite.com/ |Cognite Fusion}.
|
|
14
15
|
* @see {@link GeometryFilter.isBoundingBoxInModelCoordinates}.
|
|
15
16
|
*/
|
|
16
|
-
boundingBox?:
|
|
17
|
+
boundingBox?: Box3;
|
|
17
18
|
/**
|
|
18
19
|
* When set, the geometry filter `boundingBox` will be considered to be in "Reveal/ThreeJS space".
|
|
19
20
|
* Rather than CDF space which is the default. When using Reveal space, the model transformation
|
|
@@ -9,7 +9,7 @@ export declare class GeometryBufferUtils {
|
|
|
9
9
|
name: string;
|
|
10
10
|
attribute: T;
|
|
11
11
|
}[];
|
|
12
|
-
static copyGeometryWithBufferAttributes(geometry: BufferGeometry):
|
|
12
|
+
static copyGeometryWithBufferAttributes(geometry: BufferGeometry): BufferGeometry;
|
|
13
13
|
static setInstanceAttributeDescriptors(instanceAttributes: {
|
|
14
14
|
name: string;
|
|
15
15
|
attribute: InterleavedBufferAttribute;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Represents a collection of areas/axis-aligned
|
|
6
7
|
* bounding boxes for use e.g. for load prioritization. Implementations
|
|
@@ -18,16 +19,16 @@ export interface AreaCollection {
|
|
|
18
19
|
* It is required that each inserted box is completely covered by some
|
|
19
20
|
* subset of boxes in the set returned from `areas`
|
|
20
21
|
*/
|
|
21
|
-
areas(): Generator<
|
|
22
|
+
areas(): Generator<Box3>;
|
|
22
23
|
/**
|
|
23
24
|
* Return whether the input box intersects the AreaCollection.
|
|
24
25
|
*/
|
|
25
|
-
intersectsBox(box:
|
|
26
|
+
intersectsBox(box: Box3): boolean;
|
|
26
27
|
/**
|
|
27
28
|
* Add areas to be covered by the representative set of this
|
|
28
29
|
* AreaCollection.
|
|
29
30
|
*/
|
|
30
|
-
addAreas(boxes: Iterable<
|
|
31
|
+
addAreas(boxes: Iterable<Box3>): void;
|
|
31
32
|
/**
|
|
32
33
|
* Alter the representative set to cover only the intersection between the
|
|
33
34
|
* representative set of this AreaCollection and the incoming boxes.
|
|
@@ -35,5 +36,5 @@ export interface AreaCollection {
|
|
|
35
36
|
* represent the original box sets A and B will cover the intersection between
|
|
36
37
|
* A and B, and will thus be a valid representative set for the intersection of A and B.
|
|
37
38
|
*/
|
|
38
|
-
intersectWith(boxes: Iterable<
|
|
39
|
+
intersectWith(boxes: Iterable<Box3>): void;
|
|
39
40
|
}
|
|
@@ -25,5 +25,5 @@ export declare class BoxClusterer {
|
|
|
25
25
|
intersectsBox(box: Box3): boolean;
|
|
26
26
|
union(boxes: Iterable<Box3>): BoxClusterer;
|
|
27
27
|
private addIntersectionIfNonempty;
|
|
28
|
-
intersection(other: Iterable<
|
|
28
|
+
intersection(other: Iterable<Box3>): BoxClusterer;
|
|
29
29
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
import { AreaCollection } from './AreaCollection';
|
|
5
6
|
/**
|
|
6
7
|
* AreaCollection that stores a representative box set by merging
|
|
@@ -10,8 +11,8 @@ import { AreaCollection } from './AreaCollection';
|
|
|
10
11
|
export declare class ClusteredAreaCollection implements AreaCollection {
|
|
11
12
|
private readonly _clusterer;
|
|
12
13
|
get isEmpty(): boolean;
|
|
13
|
-
areas(): Generator<
|
|
14
|
-
intersectsBox(box:
|
|
15
|
-
addAreas(boxes: Iterable<
|
|
16
|
-
intersectWith(boxes: Iterable<
|
|
14
|
+
areas(): Generator<Box3>;
|
|
15
|
+
intersectsBox(box: Box3): boolean;
|
|
16
|
+
addAreas(boxes: Iterable<Box3>): void;
|
|
17
|
+
intersectWith(boxes: Iterable<Box3>): void;
|
|
17
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3 } from 'three';
|
|
4
5
|
import { AreaCollection } from './AreaCollection';
|
|
5
6
|
/**
|
|
6
7
|
* Convenience implementation to represent an empty collection of areas.
|
|
@@ -10,9 +11,9 @@ export declare class EmptyAreaCollection implements AreaCollection {
|
|
|
10
11
|
private static _instance;
|
|
11
12
|
static instance(): AreaCollection;
|
|
12
13
|
private constructor();
|
|
13
|
-
areas(): Generator<
|
|
14
|
-
intersectsBox(_box:
|
|
15
|
-
addAreas(_: Iterable<
|
|
16
|
-
intersectWith(_: Iterable<
|
|
14
|
+
areas(): Generator<Box3>;
|
|
15
|
+
intersectsBox(_box: Box3): boolean;
|
|
16
|
+
addAreas(_: Iterable<Box3>): void;
|
|
17
|
+
intersectWith(_: Iterable<Box3>): void;
|
|
17
18
|
get isEmpty(): boolean;
|
|
18
19
|
}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Box3, Quaternion, Vector3 } from 'three';
|
|
4
5
|
export type ControlsState = {
|
|
5
|
-
position:
|
|
6
|
-
target:
|
|
6
|
+
position: Vector3;
|
|
7
|
+
target: Vector3;
|
|
7
8
|
};
|
|
8
9
|
export type CameraState = {
|
|
9
10
|
/**
|
|
10
11
|
* Camera position in world space.
|
|
11
12
|
*/
|
|
12
|
-
position?:
|
|
13
|
+
position?: Vector3;
|
|
13
14
|
/**
|
|
14
15
|
* Camera target in world space.
|
|
15
16
|
* **/
|
|
16
|
-
target?:
|
|
17
|
+
target?: Vector3;
|
|
17
18
|
/**
|
|
18
19
|
* Camera local rotation in quaternion form.
|
|
19
20
|
*/
|
|
20
|
-
rotation?:
|
|
21
|
+
rotation?: Quaternion;
|
|
21
22
|
};
|
|
22
23
|
/**
|
|
23
24
|
* Delegate for camera update events.
|
|
24
25
|
* @module @cognite/reveal
|
|
25
26
|
*/
|
|
26
|
-
export type CameraChangeDelegate = (position:
|
|
27
|
+
export type CameraChangeDelegate = (position: Vector3, target: Vector3) => void;
|
|
27
28
|
/**
|
|
28
29
|
* Delegate for camera update events.
|
|
29
30
|
* @module @cognite/reveal
|
|
@@ -41,7 +42,7 @@ export type CameraManagerCallbackData = {
|
|
|
41
42
|
/**
|
|
42
43
|
* Coordinate of the intersection.
|
|
43
44
|
*/
|
|
44
|
-
point:
|
|
45
|
+
point: Vector3;
|
|
45
46
|
/**
|
|
46
47
|
* Distance from the camera to the intersection.
|
|
47
48
|
*/
|
|
@@ -50,11 +51,11 @@ export type CameraManagerCallbackData = {
|
|
|
50
51
|
/**
|
|
51
52
|
* Bounding box for all models on the scene
|
|
52
53
|
*/
|
|
53
|
-
modelsBoundingBox:
|
|
54
|
+
modelsBoundingBox: Box3;
|
|
54
55
|
/**
|
|
55
56
|
* Bounding box for the object (node in a model) that was picked
|
|
56
57
|
*/
|
|
57
|
-
pickedBoundingBox:
|
|
58
|
+
pickedBoundingBox: Box3 | undefined;
|
|
58
59
|
};
|
|
59
60
|
/**
|
|
60
61
|
* List of supported event types (adapted from https://stackoverflow.com/questions/44480644/string-union-to-string-array)
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { AnnotationsAssetRef } from '@cognite/sdk';
|
|
5
5
|
import { CognitePointCloudModel } from './CognitePointCloudModel';
|
|
6
|
+
import type { Vector3 } from 'three';
|
|
6
7
|
export type PointCloudIntersection = {
|
|
7
8
|
/**
|
|
8
9
|
* The intersection type.
|
|
@@ -15,7 +16,7 @@ export type PointCloudIntersection = {
|
|
|
15
16
|
/**
|
|
16
17
|
* Coordinate of the intersection.
|
|
17
18
|
*/
|
|
18
|
-
point:
|
|
19
|
+
point: Vector3;
|
|
19
20
|
/**
|
|
20
21
|
* The index of the point that was intersected.
|
|
21
22
|
*/
|
|
@@ -7,7 +7,7 @@ import { WellKnownAsprsPointClassCodes } from './types';
|
|
|
7
7
|
import { PointColorType, PointShape, PointSizeType } from '../../rendering';
|
|
8
8
|
import { PointCloudObjectMetadata, PointCloudObject } from '../../data-providers';
|
|
9
9
|
import { CompletePointCloudAppearance, StyledPointCloudObjectCollection } from '../../pointcloud-styling';
|
|
10
|
-
import { Matrix4, Group, Color } from 'three';
|
|
10
|
+
import { Matrix4, Group, Box3, Color, type Camera, type Plane, type Ray, type WebGLRenderer } from 'three';
|
|
11
11
|
export declare class PointCloudNode extends Group {
|
|
12
12
|
private readonly _cameraConfiguration?;
|
|
13
13
|
private readonly _octree;
|
|
@@ -41,7 +41,7 @@ export declare class PointCloudNode extends Group {
|
|
|
41
41
|
* @param ray Ray representing the direction for picking.
|
|
42
42
|
* @returns Picked point data.
|
|
43
43
|
*/
|
|
44
|
-
pick(renderer:
|
|
44
|
+
pick(renderer: WebGLRenderer, camera: Camera, ray: Ray): PickPoint | null;
|
|
45
45
|
/**
|
|
46
46
|
* Sets a visible filter on points of a given class.
|
|
47
47
|
* @param pointClass ASPRS classification class code. Either one of the well known
|
|
@@ -74,16 +74,16 @@ export declare class PointCloudNode extends Group {
|
|
|
74
74
|
code: number | WellKnownAsprsPointClassCodes;
|
|
75
75
|
color: Color;
|
|
76
76
|
}>;
|
|
77
|
-
getBoundingBox(outBbox?:
|
|
78
|
-
setModelTransformation(matrix:
|
|
79
|
-
getModelTransformation(out?: Matrix4):
|
|
77
|
+
getBoundingBox(outBbox?: Box3): Box3;
|
|
78
|
+
setModelTransformation(matrix: Matrix4): void;
|
|
79
|
+
getModelTransformation(out?: Matrix4): Matrix4;
|
|
80
80
|
getCdfToDefaultModelTransformation(out?: Matrix4): Matrix4;
|
|
81
81
|
get stylableObjectAnnotationMetadata(): Iterable<PointCloudObjectMetadata>;
|
|
82
82
|
getStylableObjectMetadata(objectId: number): PointCloudObjectMetadata | undefined;
|
|
83
83
|
get stylableObjectCount(): number;
|
|
84
84
|
get defaultAppearance(): CompletePointCloudAppearance;
|
|
85
85
|
set defaultAppearance(appearance: CompletePointCloudAppearance);
|
|
86
|
-
set clippingPlanes(clippingPlanes:
|
|
86
|
+
set clippingPlanes(clippingPlanes: Plane[]);
|
|
87
87
|
assignStyledPointCloudObjectCollection(styledCollection: StyledPointCloudObjectCollection): void;
|
|
88
88
|
removeAllStyledPointCloudObjects(): void;
|
|
89
89
|
dispose(): void;
|
package/dist/packages/pointclouds/src/potree-three-loader/tree/PointCloudOctreePickerHelper.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export declare class PointCloudOctreePickerHelper {
|
|
|
48
48
|
private static updatePickMaterial;
|
|
49
49
|
static updatePickRenderTarget(pickState: IPickState, width: number, height: number): void;
|
|
50
50
|
private static makePickRenderTarget;
|
|
51
|
-
static findHit(pixels: Uint8Array, pickWndSize: number, nodes: RenderedNode[], camera:
|
|
51
|
+
static findHit(pixels: Uint8Array, pickWndSize: number, nodes: RenderedNode[], camera: Camera): PointCloudHit | null;
|
|
52
52
|
static getPickPoint(hit: PointCloudHit | null, nodes: RenderedNode[]): PickPoint | null;
|
|
53
53
|
static getPointPosition(nodes: RenderedNode[], pcIndex: number, pIndex: number): Vector3;
|
|
54
54
|
private static addPositionToPickPoint;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Vector3 } from 'three';
|
|
1
|
+
import type { Vector3, Object3D } from 'three';
|
|
2
2
|
import { PointCloudOctree } from '../tree/PointCloudOctree';
|
|
3
3
|
export interface PickPoint {
|
|
4
4
|
pointIndex: number;
|
|
5
|
-
object:
|
|
5
|
+
object: Object3D;
|
|
6
6
|
position: Vector3;
|
|
7
7
|
normal?: Vector3;
|
|
8
8
|
pointCloud?: PointCloudOctree;
|
package/dist/packages/pointclouds/src/potree-three-loader/workers/assignPointsToObjectsWithWasm.d.ts
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { SerializableStylableObject } from '../../../../data-providers';
|
|
5
|
-
|
|
5
|
+
import type { Vector3, Box3 } from 'three';
|
|
6
|
+
export declare function assignPointsToObjectsWithWasm(points: Float32Array, objects: SerializableStylableObject[], pointOffset: Vector3, sectorBoundingBox: Box3): Promise<Uint16Array>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { WebGLRenderer } from 'three';
|
|
4
5
|
import { RenderPass } from './RenderPass';
|
|
5
6
|
/**
|
|
6
7
|
* Defines a provider that provides a set of renderpasses
|
|
@@ -10,6 +11,6 @@ import { RenderPass } from './RenderPass';
|
|
|
10
11
|
* render passes given some dependency.
|
|
11
12
|
*/
|
|
12
13
|
export interface RenderPipelineProvider {
|
|
13
|
-
pipeline(renderer:
|
|
14
|
+
pipeline(renderer: WebGLRenderer): Generator<RenderPass>;
|
|
14
15
|
dispose(): void;
|
|
15
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Adapted from pnext/three-loader (https://github.com/pnext/three-loader)
|
|
3
3
|
*/
|
|
4
|
-
import { Color, IUniform as IThreeUniform, Vector4 } from 'three';
|
|
4
|
+
import { Color, IUniform as IThreeUniform, Vector4, type Box3, type Vector3 } from 'three';
|
|
5
5
|
export type IGradient = [number, Color][];
|
|
6
6
|
export interface PointClassification {
|
|
7
7
|
[value: string]: Vector4;
|
|
@@ -12,7 +12,7 @@ export interface IUniform<T> extends IThreeUniform {
|
|
|
12
12
|
value: T;
|
|
13
13
|
}
|
|
14
14
|
export type OctreeMaterialParams = {
|
|
15
|
-
scale:
|
|
15
|
+
scale: Vector3;
|
|
16
16
|
spacing: number;
|
|
17
|
-
boundingBox:
|
|
17
|
+
boundingBox: Box3;
|
|
18
18
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { WebGLRenderTarget } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Interface for allowing render targets in renderPipelines to be changed dynamicaly in RevealManager.
|
|
6
7
|
*/
|
|
7
8
|
export interface SettableRenderTarget {
|
|
8
|
-
setOutputRenderTarget(target:
|
|
9
|
+
setOutputRenderTarget(target: WebGLRenderTarget | null, autoSizeRenderTarget?: boolean): void;
|
|
9
10
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { InstancedBufferGeometry, BufferGeometry, Texture as ThreeTexture } from 'three';
|
|
4
5
|
export type GltfJson = {
|
|
5
6
|
accessors: Accessor[];
|
|
6
7
|
asset: Asset;
|
|
@@ -109,7 +110,7 @@ export type GlbHeaderData = {
|
|
|
109
110
|
};
|
|
110
111
|
export type GeometryProcessingPayload = {
|
|
111
112
|
geometryType: RevealGeometryCollectionType;
|
|
112
|
-
bufferGeometry:
|
|
113
|
+
bufferGeometry: InstancedBufferGeometry | BufferGeometry;
|
|
113
114
|
instancingExtension: {
|
|
114
115
|
attributes: {
|
|
115
116
|
[key: string]: number;
|
|
@@ -117,12 +118,12 @@ export type GeometryProcessingPayload = {
|
|
|
117
118
|
} | undefined;
|
|
118
119
|
meshId: number | undefined;
|
|
119
120
|
glbHeaderData: GlbHeaderData;
|
|
120
|
-
texture?:
|
|
121
|
+
texture?: ThreeTexture;
|
|
121
122
|
data: ArrayBuffer;
|
|
122
123
|
};
|
|
123
124
|
export type ParsedGeometry = {
|
|
124
125
|
type: RevealGeometryCollectionType;
|
|
125
|
-
geometryBuffer:
|
|
126
|
-
texture?:
|
|
126
|
+
geometryBuffer: BufferGeometry;
|
|
127
|
+
texture?: ThreeTexture;
|
|
127
128
|
instanceId?: string;
|
|
128
129
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Vector3, Color } from 'three';
|
|
4
5
|
export type Measurement = {
|
|
5
6
|
readonly measurementId: number;
|
|
6
|
-
readonly startPoint:
|
|
7
|
-
readonly endPoint:
|
|
7
|
+
readonly startPoint: Vector3;
|
|
8
|
+
readonly endPoint: Vector3;
|
|
8
9
|
readonly distanceInMeters: number;
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
@@ -35,5 +36,5 @@ export type MeasurementOptions = {
|
|
|
35
36
|
/**
|
|
36
37
|
* Line color in 32 bit hex.
|
|
37
38
|
*/
|
|
38
|
-
color?:
|
|
39
|
+
color?: Color;
|
|
39
40
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { Vector3 } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Represents a camera configuration, consisting of a camera position and target.
|
|
6
7
|
*/
|
|
7
8
|
export type CameraConfiguration = {
|
|
8
|
-
readonly position:
|
|
9
|
-
readonly target:
|
|
9
|
+
readonly position: Vector3;
|
|
10
|
+
readonly target: Vector3;
|
|
10
11
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import type { PerspectiveCamera, WebGLRenderer } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Delegate for pointer events.
|
|
6
7
|
* @module @cognite/reveal
|
|
@@ -25,8 +26,8 @@ export type DisposedDelegate = () => void;
|
|
|
25
26
|
*/
|
|
26
27
|
export type BeforeSceneRenderedDelegate = (event: {
|
|
27
28
|
frameNumber: number;
|
|
28
|
-
renderer:
|
|
29
|
-
camera:
|
|
29
|
+
renderer: WebGLRenderer;
|
|
30
|
+
camera: PerspectiveCamera;
|
|
30
31
|
}) => void;
|
|
31
32
|
/**
|
|
32
33
|
* Delegate for event triggered when scene has been rendered.
|
|
@@ -35,6 +36,6 @@ export type BeforeSceneRenderedDelegate = (event: {
|
|
|
35
36
|
export type SceneRenderedDelegate = (event: {
|
|
36
37
|
frameNumber: number;
|
|
37
38
|
renderTime: number;
|
|
38
|
-
renderer:
|
|
39
|
-
camera:
|
|
39
|
+
renderer: WebGLRenderer;
|
|
40
|
+
camera: PerspectiveCamera;
|
|
40
41
|
}) => void;
|