@cognite/reveal 4.2.0-dev.20230502 → 4.2.0-dev.20230504

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.
@@ -1,13 +1,14 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { EventTrigger } from '../../../utilities';
4
+ import { EventTrigger, PointerEventData } from '../../../utilities';
5
5
  import { Image360Collection } from './Image360Collection';
6
6
  import { Image360Entity } from '../entity/Image360Entity';
7
7
  import { Image360AnnotationClickedDelegate, Image360AnnotationHoveredDelegate, Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
8
8
  import { IconCollection, IconCullingScheme } from '../icons/IconCollection';
9
9
  import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
10
10
  import { Image360AnnotationAppearance } from '../annotation/types';
11
+ import { Vector3 } from 'three';
11
12
  /**
12
13
  * Default implementation of {@link Image360Collection}. Used for events when entering
13
14
  * and exiting 360 image mode
@@ -73,8 +74,8 @@ export declare class DefaultImage360Collection implements Image360Collection {
73
74
  off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
74
75
  off(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
75
76
  off(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
76
- fireHoverEvent(annotationObject: ImageAnnotationObject): void;
77
- fireClickEvent(annotationObject: ImageAnnotationObject): void;
77
+ fireHoverEvent(annotationObject: ImageAnnotationObject, pointerEvent: PointerEventData, direction: Vector3): void;
78
+ fireClickEvent(annotationObject: ImageAnnotationObject, pointerEvent: PointerEventData, direction: Vector3): void;
78
79
  setSelectedVisibility(visible: boolean): void;
79
80
  setCullingScheme(scheme: IconCullingScheme): void;
80
81
  remove(entity: Image360Entity): void;
@@ -15,5 +15,5 @@ export interface Image360Revision {
15
15
  /**
16
16
  * The annotations associated with this revision
17
17
  */
18
- annotations: Image360Annotation[];
18
+ getAnnotations(): Promise<Image360Annotation[]>;
19
19
  }
@@ -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 { Image360AnnotationAppearance } from '../annotation/types';
8
9
  export declare class Image360RevisionEntity implements Image360Revision {
9
10
  private readonly _imageProvider;
10
11
  private readonly _image360Descriptor;
@@ -12,6 +13,7 @@ export declare class Image360RevisionEntity implements Image360Revision {
12
13
  private _previewTextures;
13
14
  private _fullResolutionTextures;
14
15
  private _onFullResolutionCompleted;
16
+ private _defaultAppearance;
15
17
  private _annotations;
16
18
  constructor(imageProvider: Image360DataProvider, image360Descriptor: Image360Descriptor, image360VisualzationBox: Image360VisualizationBox);
17
19
  /**
@@ -19,7 +21,7 @@ export declare class Image360RevisionEntity implements Image360Revision {
19
21
  * @returns Date | undefined
20
22
  */
21
23
  get date(): Date | undefined;
22
- get annotations(): ImageAnnotationObject[];
24
+ getAnnotations(): Promise<ImageAnnotationObject[]>;
23
25
  intersectAnnotations(raycaster: THREE.Raycaster): ImageAnnotationObject | undefined;
24
26
  /**
25
27
  * Loads the textures needed for the 360 image (6 faces).
@@ -34,11 +36,12 @@ export declare class Image360RevisionEntity implements Image360Revision {
34
36
  loadTextures(abortSignal?: AbortSignal): {
35
37
  lowResolutionCompleted: Promise<void>;
36
38
  fullResolutionCompleted: Promise<void>;
37
- annotationsCompleted: Promise<void>;
38
39
  };
39
40
  private loadPreviewTextures;
40
41
  private loadFullTextures;
41
- private loadAnnotations;
42
+ private loadAndSetAnnotations;
43
+ setDefaultAppearance(appearance: Image360AnnotationAppearance): void;
44
+ private propagateDefaultAppearanceToAnnotations;
42
45
  /**
43
46
  * Clear the cached textures used by this revision.
44
47
  */
@@ -4,6 +4,8 @@
4
4
  import { Image360 } from './entity/Image360';
5
5
  import { Image360Revision } from './entity/Image360Revision';
6
6
  import { Image360Annotation } from './annotation/Image360Annotation';
7
+ import { PointerEventData } from '../../utilities';
8
+ import { Vector3 } from 'three';
7
9
  /**
8
10
  * Delegate for 360 image mode entered events.
9
11
  */
@@ -15,8 +17,8 @@ export type Image360ExitedDelegate = () => void;
15
17
  /**
16
18
  * Delegate for 360 image annotation hover events
17
19
  */
18
- export type Image360AnnotationHoveredDelegate = (annotation: Image360Annotation) => void;
20
+ export type Image360AnnotationHoveredDelegate = (annotation: Image360Annotation, pointerEvent: PointerEventData, direction: Vector3) => void;
19
21
  /**
20
22
  * Delegate for 360 image annotation click events
21
23
  */
22
- export type Image360AnnotationClickedDelegate = (annotation: Image360Annotation) => void;
24
+ export type Image360AnnotationClickedDelegate = (annotation: Image360Annotation, pointerEvent: PointerEventData, direction: Vector3) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.2.0-dev.20230502",
3
+ "version": "4.2.0-dev.20230504",
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": {
@@ -70,17 +70,17 @@
70
70
  "html2canvas": "^1.4.1",
71
71
  "lodash": "4.17.21",
72
72
  "loglevel": "1.8.1",
73
- "mixpanel-browser": "2.46.0",
73
+ "mixpanel-browser": "2.47.0",
74
74
  "path-browserify": "1.0.1",
75
75
  "random-seed": "0.3.0",
76
- "rxjs": "7.8.0",
76
+ "rxjs": "7.8.1",
77
77
  "skmeans": "0.11.3",
78
78
  "sparse-octree": "7.1.6",
79
79
  "three-stdlib": "2.21.8"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@azure/msal-browser": "2.36.0",
83
- "@cognite/sdk": "8.0.1",
83
+ "@cognite/sdk": "8.1.0",
84
84
  "@microsoft/api-extractor": "^7.33.6",
85
85
  "@types/dat.gui": "0.7.9",
86
86
  "@types/gl": "^6.0.2",
@@ -91,21 +91,21 @@
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.1",
94
+ "@types/node": "18.16.3",
95
95
  "@types/random-seed": "0.3.3",
96
96
  "@types/skmeans": "0.11.4",
97
97
  "@types/stats": "0.16.30",
98
98
  "@types/three": "0.150.0",
99
99
  "@types/tween.js": "18.5.1",
100
- "@typescript-eslint/eslint-plugin": "5.59.0",
101
- "@typescript-eslint/parser": "5.59.0",
100
+ "@typescript-eslint/eslint-plugin": "5.59.1",
101
+ "@typescript-eslint/parser": "5.59.1",
102
102
  "concurrently": "8.0.1",
103
103
  "cross-env": "7.0.3",
104
104
  "dat.gui": "0.7.9",
105
105
  "eslint": "8.39.0",
106
106
  "eslint-config-prettier": "8.8.0",
107
107
  "eslint-plugin-header": "3.1.1",
108
- "eslint-plugin-jsdoc": "43.0.7",
108
+ "eslint-plugin-jsdoc": "43.1.1",
109
109
  "eslint-plugin-lodash": "7.4.0",
110
110
  "eslint-plugin-prettier": "4.2.1",
111
111
  "eslint-plugin-unused-imports": "2.0.0",
@@ -122,7 +122,7 @@
122
122
  "jest-puppeteer": "8.0.6",
123
123
  "jsdom": "21.1.1",
124
124
  "moq.ts": "10.0.2",
125
- "nock": "13.3.0",
125
+ "nock": "13.3.1",
126
126
  "prettier": "2.8.8",
127
127
  "process": "0.11.10",
128
128
  "puppeteer": "19.11.1",
@@ -135,10 +135,10 @@
135
135
  "three": "0.150.1",
136
136
  "ts-jest": "29.1.0",
137
137
  "ts-loader": "9.4.2",
138
- "tsc-alias": "1.8.5",
138
+ "tsc-alias": "1.8.6",
139
139
  "typescript": "5.0.4",
140
140
  "wasm-pack": "0.10.3",
141
- "webpack": "5.80.0",
141
+ "webpack": "5.81.0",
142
142
  "webpack-cli": "5.0.2",
143
143
  "webpack-dev-server": "4.13.3",
144
144
  "webpack-node-externals": "3.0.0",