@cognite/reveal 4.2.0-dev.20230509 → 4.2.0-dev.20230510
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 +30 -30
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/index.d.ts +2 -1
- package/dist/packages/360-images/src/annotation/BoxAnnotationData.d.ts +2 -2
- package/dist/packages/360-images/src/annotation/Image360AnnotationIntersection.d.ts +22 -0
- package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +1 -0
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +2 -12
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +1 -7
- package/dist/packages/360-images/src/types.d.ts +0 -11
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +2 -2
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +9 -1
- package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +1 -1
- package/package.json +4 -4
|
@@ -9,7 +9,8 @@ export { Image360CollectionFactory } from './src/collection/Image360CollectionFa
|
|
|
9
9
|
export { Image360Entity } from './src/entity/Image360Entity';
|
|
10
10
|
export { Image360RevisionEntity } from './src/entity/Image360RevisionEntity';
|
|
11
11
|
export { Image360Visualization } from './src/entity/Image360Visualization';
|
|
12
|
-
export { Image360EnteredDelegate, Image360ExitedDelegate
|
|
12
|
+
export { Image360EnteredDelegate, Image360ExitedDelegate } from './src/types';
|
|
13
13
|
export { Image360AnnotationAppearance } from './src/annotation/types';
|
|
14
|
+
export { Image360AnnotationIntersection } from './src/annotation/Image360AnnotationIntersection';
|
|
14
15
|
export { Image360Annotation } from './src/annotation/Image360Annotation';
|
|
15
16
|
export { DefaultImage360Collection } from './src/collection/DefaultImage360Collection';
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { ImageAnnotationObjectData } from './ImageAnnotationData';
|
|
5
5
|
import { BufferGeometry, Matrix4, PlaneGeometry } from 'three';
|
|
6
|
-
import { AnnotationsBoundingBox
|
|
6
|
+
import { AnnotationsBoundingBox } from '@cognite/sdk';
|
|
7
7
|
export declare class BoxAnnotationData implements ImageAnnotationObjectData {
|
|
8
8
|
private readonly _geometry;
|
|
9
9
|
private readonly _initialTranslation;
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(annotationsBox: AnnotationsBoundingBox);
|
|
11
11
|
createGeometry(annotationsBox: AnnotationsBoundingBox): PlaneGeometry;
|
|
12
12
|
getGeometry(): BufferGeometry;
|
|
13
13
|
getNormalizationMatrix(): Matrix4;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Image360Annotation } from './Image360Annotation';
|
|
5
|
+
import { Vector3 } from 'three';
|
|
6
|
+
/**
|
|
7
|
+
* Describes an intersection with a 360 image annotation
|
|
8
|
+
*/
|
|
9
|
+
export type Image360AnnotationIntersection = {
|
|
10
|
+
/**
|
|
11
|
+
* The intersection type.
|
|
12
|
+
*/
|
|
13
|
+
type: 'image360Annotation';
|
|
14
|
+
/**
|
|
15
|
+
* The intersected annotation
|
|
16
|
+
*/
|
|
17
|
+
annotation: Image360Annotation;
|
|
18
|
+
/**
|
|
19
|
+
* The world direction from the camera to the intersection point
|
|
20
|
+
*/
|
|
21
|
+
direction: Vector3;
|
|
22
|
+
};
|
|
@@ -15,6 +15,7 @@ export declare class ImageAnnotationObject implements Image360Annotation {
|
|
|
15
15
|
private readonly _appearance;
|
|
16
16
|
get annotation(): AnnotationModel;
|
|
17
17
|
static createAnnotationObject(annotation: AnnotationModel, face: FaceType): ImageAnnotationObject | undefined;
|
|
18
|
+
private static createObjectData;
|
|
18
19
|
private constructor();
|
|
19
20
|
private getRotationFromFace;
|
|
20
21
|
private initializeTransform;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { EventTrigger
|
|
4
|
+
import { EventTrigger } from '../../../utilities';
|
|
5
5
|
import { Image360Collection } from './Image360Collection';
|
|
6
6
|
import { Image360Entity } from '../entity/Image360Entity';
|
|
7
|
-
import {
|
|
7
|
+
import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
8
8
|
import { IconCollection, IconCullingScheme } from '../icons/IconCollection';
|
|
9
|
-
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
10
9
|
import { Image360AnnotationAppearance } from '../annotation/types';
|
|
11
|
-
import { Vector3 } from 'three';
|
|
12
10
|
/**
|
|
13
11
|
* Default implementation of {@link Image360Collection}. Used for events when entering
|
|
14
12
|
* and exiting 360 image mode
|
|
@@ -38,8 +36,6 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
38
36
|
get events(): {
|
|
39
37
|
image360Entered: EventTrigger<Image360EnteredDelegate>;
|
|
40
38
|
image360Exited: EventTrigger<Image360ExitedDelegate>;
|
|
41
|
-
annotationHovered: EventTrigger<Image360AnnotationHoveredDelegate>;
|
|
42
|
-
annotationClicked: EventTrigger<Image360AnnotationClickedDelegate>;
|
|
43
39
|
};
|
|
44
40
|
get isCollectionVisible(): boolean;
|
|
45
41
|
constructor(collectionId: string, entities: Image360Entity[], icons: IconCollection);
|
|
@@ -52,8 +48,6 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
52
48
|
*/
|
|
53
49
|
on(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
54
50
|
on(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
55
|
-
on(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
56
|
-
on(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
57
51
|
/**
|
|
58
52
|
* Specify parameters used to determine the number of icons that are visible when entering 360 Images.
|
|
59
53
|
* @param radius Only icons within the given radius will be made visible.
|
|
@@ -72,10 +66,6 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
72
66
|
*/
|
|
73
67
|
off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
74
68
|
off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
75
|
-
off(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
76
|
-
off(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
77
|
-
fireHoverEvent(annotationObject: ImageAnnotationObject, pointerEvent: PointerEventData, direction: Vector3): void;
|
|
78
|
-
fireClickEvent(annotationObject: ImageAnnotationObject, pointerEvent: PointerEventData, direction: Vector3): void;
|
|
79
69
|
setSelectedVisibility(visible: boolean): void;
|
|
80
70
|
setCullingScheme(scheme: IconCullingScheme): void;
|
|
81
71
|
remove(entity: Image360Entity): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Image360 } from './../entity/Image360';
|
|
5
|
-
import {
|
|
5
|
+
import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
6
6
|
import { Image360AnnotationAppearance } from '../annotation/types';
|
|
7
7
|
/**
|
|
8
8
|
* A wrapper that represents a set of 360 images.
|
|
@@ -32,15 +32,11 @@ export interface Image360Collection {
|
|
|
32
32
|
* Subscribes to events on 360 Image datasets. There are several event types:
|
|
33
33
|
* 'image360Entered' - Subscribes to a event for entering 360 image mode.
|
|
34
34
|
* 'image360Exited' - Subscribes to events indicating 360 image mode has exited.
|
|
35
|
-
* 'image360AnnotationHovered - Subscribes to events indicating that the cursor hovered over an image annotation.
|
|
36
|
-
* 'image360AnnotationClicked - Subscribes to events indicating a click on an image annotation
|
|
37
35
|
* @param event The event type.
|
|
38
36
|
* @param callback Callback to be called when the event is fired.
|
|
39
37
|
*/
|
|
40
38
|
on(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
41
39
|
on(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
42
|
-
on(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
43
|
-
on(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
44
40
|
/**
|
|
45
41
|
* Unsubscribes from 360 image dataset event.
|
|
46
42
|
* @param event The event type.
|
|
@@ -48,8 +44,6 @@ export interface Image360Collection {
|
|
|
48
44
|
*/
|
|
49
45
|
off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
50
46
|
off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
51
|
-
off(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
52
|
-
off(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
53
47
|
/**
|
|
54
48
|
* Assign a default style which affects all annotations
|
|
55
49
|
*/
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360 } from './entity/Image360';
|
|
5
5
|
import { Image360Revision } from './entity/Image360Revision';
|
|
6
|
-
import { Image360Annotation } from './annotation/Image360Annotation';
|
|
7
|
-
import { PointerEventData } from '../../utilities';
|
|
8
|
-
import { Vector3 } from 'three';
|
|
9
6
|
/**
|
|
10
7
|
* Delegate for 360 image mode entered events.
|
|
11
8
|
*/
|
|
@@ -14,11 +11,3 @@ export type Image360EnteredDelegate = (image360: Image360, revision: Image360Rev
|
|
|
14
11
|
* Delegate for 360 image mode exited events.
|
|
15
12
|
*/
|
|
16
13
|
export type Image360ExitedDelegate = () => void;
|
|
17
|
-
/**
|
|
18
|
-
* Delegate for 360 image annotation hover events
|
|
19
|
-
*/
|
|
20
|
-
export type Image360AnnotationHoveredDelegate = (annotation: Image360Annotation, pointerEvent: PointerEventData, direction: Vector3) => void;
|
|
21
|
-
/**
|
|
22
|
-
* Delegate for 360 image annotation click events
|
|
23
|
-
*/
|
|
24
|
-
export type Image360AnnotationClickedDelegate = (annotation: Image360Annotation, pointerEvent: PointerEventData, direction: Vector3) => void;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
6
|
-
import { Image360Collection, Image360Entity, Image360, Image360RevisionEntity } from '../../../360-images';
|
|
6
|
+
import { Image360Collection, Image360Entity, Image360, Image360RevisionEntity, Image360AnnotationIntersection } from '../../../360-images';
|
|
7
7
|
import { BeforeSceneRenderedDelegate, EventTrigger, InputHandler, SceneHandler } from '../../../utilities';
|
|
8
8
|
import { ProxyCameraManager } from '../../../camera-manager';
|
|
9
9
|
export declare class Image360ApiHelper {
|
|
@@ -23,7 +23,6 @@ export declare class Image360ApiHelper {
|
|
|
23
23
|
get needsRedraw(): boolean;
|
|
24
24
|
resetRedraw(): void;
|
|
25
25
|
private getNormalizedOffset;
|
|
26
|
-
private handleAnnotationCursorEvent;
|
|
27
26
|
add360ImageSet(eventFilter: Metadata, collectionTransform: THREE.Matrix4, preMultipliedRotation: boolean): Promise<Image360Collection>;
|
|
28
27
|
remove360Images(entities: Image360[]): Promise<void>;
|
|
29
28
|
enter360Image(image360Entity: Image360Entity, revision?: Image360RevisionEntity): Promise<void>;
|
|
@@ -37,6 +36,7 @@ export declare class Image360ApiHelper {
|
|
|
37
36
|
private findRevisionIdToEnter;
|
|
38
37
|
private enter360ImageOnIntersect;
|
|
39
38
|
intersect360ImageIcons(offsetX: number, offsetY: number): Image360Entity | undefined;
|
|
39
|
+
intersect360ImageAnnotations(offsetX: number, offsetY: number): Image360AnnotationIntersection | undefined;
|
|
40
40
|
private setHoverIconOnIntersect;
|
|
41
41
|
private exit360ImageOnEscape;
|
|
42
42
|
}
|
|
@@ -10,7 +10,7 @@ import { CogniteModel } from '../types';
|
|
|
10
10
|
import { ViewerState } from '../../utilities/ViewStateHelper';
|
|
11
11
|
import { CameraManager, CameraChangeDelegate, CameraStopDelegate } from '../../../../camera-manager';
|
|
12
12
|
import { SupportedModelTypes } from '../../../../model-base';
|
|
13
|
-
import { Image360Collection, Image360, Image360Revision } from '../../../../360-images';
|
|
13
|
+
import { Image360Collection, Image360, Image360Revision, Image360AnnotationIntersection } from '../../../../360-images';
|
|
14
14
|
/**
|
|
15
15
|
* @example
|
|
16
16
|
* ```js
|
|
@@ -559,6 +559,14 @@ export declare class Cognite3DViewer {
|
|
|
559
559
|
* ```
|
|
560
560
|
*/
|
|
561
561
|
getIntersectionFromPixel(offsetX: number, offsetY: number): Promise<null | Intersection>;
|
|
562
|
+
/**
|
|
563
|
+
* Check for intersections with 360 annotations through the given pixel.
|
|
564
|
+
* Similar to {getIntersectionFromPixel}, but checks 360 image annotations
|
|
565
|
+
* instead of models.
|
|
566
|
+
* @param offsetX
|
|
567
|
+
* @param offsetY
|
|
568
|
+
*/
|
|
569
|
+
get360AnnotationIntersectionFromPixel(offsetX: number, offsetY: number): Promise<null | Image360AnnotationIntersection>;
|
|
562
570
|
/** @private */
|
|
563
571
|
private getModels;
|
|
564
572
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.2.0-dev.
|
|
3
|
+
"version": "4.2.0-dev.20230510",
|
|
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": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"three-stdlib": "2.21.11"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@azure/msal-browser": "2.
|
|
82
|
+
"@azure/msal-browser": "2.37.0",
|
|
83
83
|
"@cognite/sdk": "8.1.1",
|
|
84
84
|
"@microsoft/api-extractor": "^7.33.6",
|
|
85
85
|
"@types/dat.gui": "0.7.9",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@types/jsdom": "21.1.1",
|
|
92
92
|
"@types/lodash": "4.14.194",
|
|
93
93
|
"@types/mixpanel-browser": "2.38.1",
|
|
94
|
-
"@types/node": "18.16.
|
|
94
|
+
"@types/node": "18.16.4",
|
|
95
95
|
"@types/random-seed": "0.3.3",
|
|
96
96
|
"@types/skmeans": "0.11.4",
|
|
97
97
|
"@types/stats": "0.16.30",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"tsc-alias": "1.8.6",
|
|
139
139
|
"typescript": "5.0.4",
|
|
140
140
|
"wasm-pack": "0.10.3",
|
|
141
|
-
"webpack": "5.
|
|
141
|
+
"webpack": "5.82.0",
|
|
142
142
|
"webpack-cli": "5.0.2",
|
|
143
143
|
"webpack-dev-server": "4.13.3",
|
|
144
144
|
"webpack-node-externals": "3.0.0",
|