@cognite/reveal 4.1.1-dev.20230313 → 4.1.1-dev.20230315

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.
@@ -5,6 +5,7 @@ import * as THREE from 'three';
5
5
  import { Image360Entity } from './entity/Image360Entity';
6
6
  import { Image360CollectionFactory } from './collection/Image360CollectionFactory';
7
7
  import { DefaultImage360Collection } from './collection/DefaultImage360Collection';
8
+ import { IconCullingScheme } from './icons/IconCollection';
8
9
  export declare class Image360Facade<T> {
9
10
  private readonly _entityFactory;
10
11
  private readonly _image360Collections;
@@ -13,6 +14,7 @@ export declare class Image360Facade<T> {
13
14
  get collections(): DefaultImage360Collection[];
14
15
  set allIconsVisibility(visible: boolean);
15
16
  set allHoverIconsVisibility(visible: boolean);
17
+ set allIconCullingScheme(scheme: IconCullingScheme);
16
18
  constructor(_entityFactory: Image360CollectionFactory<T>);
17
19
  create(dataProviderFilter: T, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection>;
18
20
  delete(entity: Image360Entity): Promise<void>;
@@ -5,7 +5,7 @@ import { EventTrigger } from '../../../utilities';
5
5
  import { Image360Collection } from './Image360Collection';
6
6
  import { Image360Entity } from '../entity/Image360Entity';
7
7
  import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
8
- import { IconCollection } from '../icons/IconCollection';
8
+ import { IconCollection, IconCullingScheme } from '../icons/IconCollection';
9
9
  /**
10
10
  * Default implementation of {@link Image360Collection}. Used for events when entering
11
11
  * and exiting 360 image mode
@@ -34,6 +34,12 @@ export declare class DefaultImage360Collection implements Image360Collection {
34
34
  */
35
35
  on(event: 'image360Entered', callback: Image360EnteredDelegate): void;
36
36
  on(event: 'image360Exited', callback: Image360ExitedDelegate): void;
37
+ /**
38
+ * Specify parameters used to determine the number of icons that are visible when entering 360 Images.
39
+ * @param radius Only icons within the given radius will be made visible.
40
+ * @param pointLimit Limit the number of points within the given radius. Points closer to the camera will be prioritized.
41
+ */
42
+ set360IconCullingRestrictions(radius: number, pointLimit: number): void;
37
43
  /**
38
44
  * Unsubscribes from 360 image dataset event.
39
45
  * @param event The event type.
@@ -43,6 +49,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
43
49
  off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
44
50
  setIconsVisibility(visible: boolean): void;
45
51
  setSelectedVisibility(visible: boolean): void;
52
+ setCullingScheme(scheme: IconCullingScheme): void;
46
53
  remove(entity: Image360Entity): void;
47
54
  dispose(): void;
48
55
  }
@@ -11,6 +11,12 @@ export interface Image360Collection {
11
11
  * A list containing all the 360 images in this set.
12
12
  */
13
13
  readonly image360Entities: Image360[];
14
+ /**
15
+ * Specify parameters used to determine the number of icons that are visible when entering 360 Images.
16
+ * @param radius Only icons within the given radius will be made visible.
17
+ * @param pointLimit Limit the number of points within the given radius. Points closer to the camera will be prioritized.
18
+ */
19
+ set360IconCullingRestrictions(radius: number, pointLimit: number): void;
14
20
  /**
15
21
  * Subscribes to events on 360 Image datasets. There are several event types:
16
22
  * 'image360Entered' - Subscribes to a event for entering 360 image mode.
@@ -4,6 +4,7 @@
4
4
  import { Vector3 } from 'three';
5
5
  import { BeforeSceneRenderedDelegate, EventTrigger, SceneHandler } from '../../../utilities';
6
6
  import { Image360Icon } from './Image360Icon';
7
+ export type IconCullingScheme = 'clustered' | 'proximity';
7
8
  export declare class IconCollection {
8
9
  private readonly MIN_PIXEL_SIZE;
9
10
  private readonly MAX_PIXEL_SIZE;
@@ -13,10 +14,19 @@ export declare class IconCollection {
13
14
  private readonly _icons;
14
15
  private readonly _iconsSprite;
15
16
  private readonly _computeClustersEventHandler;
17
+ private readonly _computeProximityPointsEventHandler;
16
18
  private readonly _onBeforeSceneRenderedEvent;
19
+ private readonly _iconRadius;
20
+ private _activeCullingSchemeEventHandeler;
21
+ private _iconCullingScheme;
22
+ private _proximityRadius;
23
+ private _proximityPointLimit;
17
24
  get icons(): Image360Icon[];
25
+ setCullingScheme(scheme: IconCullingScheme): void;
26
+ set360IconCullingRestrictions(radius: number, pointLimit: number): void;
18
27
  constructor(points: Vector3[], sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>);
19
28
  private setIconClustersByLOD;
29
+ private computeProximityPoints;
20
30
  private initializeImage360Icons;
21
31
  dispose(): void;
22
32
  private createOuterRingsTexture;
@@ -10,11 +10,12 @@ export declare class Image360Icon {
10
10
  private readonly _sceneHandler;
11
11
  private readonly _minPixelSize;
12
12
  private readonly _maxPixelSize;
13
+ private readonly _iconRadius;
13
14
  private readonly _setAdaptiveScale;
14
15
  private readonly _onRenderTrigger;
15
16
  private _adaptiveScale;
16
17
  private _visible;
17
- constructor(position: THREE.Vector3, hoverIconTexture: THREE.CanvasTexture, sceneHandler: SceneHandler, minPixelSize: number, maxPixelSize: number, onRenderTrigger: EventTrigger<BeforeSceneRenderedDelegate>);
18
+ constructor(position: THREE.Vector3, hoverIconTexture: THREE.CanvasTexture, sceneHandler: SceneHandler, minPixelSize: number, maxPixelSize: number, iconRadius: number, onRenderTrigger: EventTrigger<BeforeSceneRenderedDelegate>);
18
19
  set visible(visible: boolean);
19
20
  get visible(): boolean;
20
21
  get position(): Vector3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.1.1-dev.20230313",
3
+ "version": "4.1.1-dev.20230315",
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": {
@@ -78,7 +78,7 @@
78
78
  "three-stdlib": "2.21.8"
79
79
  },
80
80
  "devDependencies": {
81
- "@azure/msal-browser": "2.33.0",
81
+ "@azure/msal-browser": "2.34.0",
82
82
  "@cognite/sdk": "7.19.1",
83
83
  "@microsoft/api-extractor": "^7.33.6",
84
84
  "@types/dat.gui": "0.7.7",
@@ -90,14 +90,14 @@
90
90
  "@types/jsdom": "21.1.0",
91
91
  "@types/lodash": "4.14.191",
92
92
  "@types/mixpanel-browser": "2.38.1",
93
- "@types/node": "18.14.6",
93
+ "@types/node": "18.15.0",
94
94
  "@types/random-seed": "0.3.3",
95
95
  "@types/skmeans": "0.11.4",
96
96
  "@types/stats": "0.16.30",
97
97
  "@types/three": "0.149.0",
98
98
  "@types/tween.js": "18.5.1",
99
- "@typescript-eslint/eslint-plugin": "5.54.0",
100
- "@typescript-eslint/parser": "5.54.0",
99
+ "@typescript-eslint/eslint-plugin": "5.54.1",
100
+ "@typescript-eslint/parser": "5.54.1",
101
101
  "concurrently": "7.6.0",
102
102
  "cross-env": "7.0.3",
103
103
  "dat.gui": "0.7.9",
@@ -113,18 +113,18 @@
113
113
  "glob": "9.2.1",
114
114
  "glslify-loader": "2.0.0",
115
115
  "html-webpack-plugin": "5.5.0",
116
- "jest": "29.4.3",
116
+ "jest": "29.5.0",
117
117
  "jest-canvas-mock": "2.4.0",
118
- "jest-environment-jsdom": "29.4.3",
118
+ "jest-environment-jsdom": "29.5.0",
119
119
  "jest-extended": "3.2.4",
120
120
  "jest-image-snapshot": "6.1.0",
121
- "jest-puppeteer": "8.0.4",
121
+ "jest-puppeteer": "8.0.5",
122
122
  "jsdom": "21.1.0",
123
123
  "moq.ts": "10.0.2",
124
124
  "nock": "13.3.0",
125
125
  "prettier": "2.8.4",
126
126
  "process": "0.11.10",
127
- "puppeteer": "19.7.2",
127
+ "puppeteer": "19.7.4",
128
128
  "random-seed": "0.3.0",
129
129
  "raw-loader": "4.0.2",
130
130
  "remove-files-webpack-plugin": "1.5.0",
@@ -134,10 +134,10 @@
134
134
  "three": "0.149.0",
135
135
  "ts-jest": "29.0.5",
136
136
  "ts-loader": "9.4.2",
137
- "tsc-alias": "1.8.2",
137
+ "tsc-alias": "1.8.3",
138
138
  "typescript": "4.9.5",
139
139
  "wasm-pack": "0.10.3",
140
- "webpack": "5.75.0",
140
+ "webpack": "5.76.0",
141
141
  "webpack-cli": "5.0.1",
142
142
  "webpack-dev-server": "4.11.1",
143
143
  "webpack-node-externals": "3.0.0",