@cognite/reveal 4.19.1-dev.20241028 → 4.19.1-dev.20241029

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.
@@ -15,3 +15,5 @@ export { Image360AnnotationIntersection } from './src/annotation/Image360Annotat
15
15
  export { Image360Annotation } from './src/annotation/Image360Annotation';
16
16
  export { DefaultImage360Collection } from './src/collection/DefaultImage360Collection';
17
17
  export { IconsOptions } from './src/icons/IconCollection';
18
+ export { Image360History } from './src/Image360History';
19
+ export { Image360Action } from './src/Image360Action';
@@ -0,0 +1,25 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ /**
5
+ * 360 image action to be used by the CogniteViewer.canDo360Action and do360Action
6
+ * @beta
7
+ */
8
+ export declare enum Image360Action {
9
+ /**
10
+ * When inside 360 image, forwards on the history list.
11
+ */
12
+ Forward = 0,
13
+ /**
14
+ * When inside 360 image, backwards on the history list.
15
+ */
16
+ Backward = 1,
17
+ /**
18
+ * When outside 360 image, go to current in the history list (where you exit from).
19
+ */
20
+ Enter = 2,
21
+ /**
22
+ * When inside 360, exit.
23
+ */
24
+ Exit = 3
25
+ }
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright 2022 Cognite AS
3
+ */
4
+ import { Image360 } from './entity/Image360';
5
+ import { Image360Action } from './Image360Action';
6
+ export declare class Image360History {
7
+ private readonly _history;
8
+ private _currentIndex;
9
+ start(history: Image360): void;
10
+ private current;
11
+ clear(): void;
12
+ private isLegalIndex;
13
+ canDoAction(action: Image360Action): boolean;
14
+ doAction(action: Image360Action): Image360 | undefined;
15
+ }
@@ -8,6 +8,7 @@ import { DataSourceType, Image360DataModelIdentifier } from '../../../data-provi
8
8
  import { BeforeSceneRenderedDelegate, EventTrigger, InputHandler, PointerEventData, SceneHandler } from '../../../utilities';
9
9
  import { ProxyCameraManager } from '../../../camera-manager';
10
10
  import { Image360WithCollection } from '../public/types';
11
+ import { Image360Action } from '../../../360-images/src/Image360Action';
11
12
  export declare class Image360ApiHelper<DataSourceT extends DataSourceType> {
12
13
  private readonly _image360Facade;
13
14
  private readonly _domElement;
@@ -16,15 +17,16 @@ export declare class Image360ApiHelper<DataSourceT extends DataSourceType> {
16
17
  private _needsRedraw;
17
18
  private readonly _hasEventListeners;
18
19
  private readonly _inputHandler?;
20
+ private readonly _history;
19
21
  private readonly _interactionState;
20
22
  private readonly _debouncePreLoad;
21
23
  private readonly _activeCameraManager;
22
24
  private readonly _stationaryCameraManager;
23
25
  private readonly _onBeforeSceneRenderedEvent;
24
26
  private _cachedCameraManager;
25
- private readonly exit360ImageOnEscapeKey;
26
- readonly setHoverIconEventHandler: (event: MouseEvent) => void;
27
- readonly enter360ImageHandler: (event: PointerEventData) => Promise<boolean>;
27
+ private readonly onKeyPressed;
28
+ readonly onHover: (event: MouseEvent) => void;
29
+ readonly onClick: (event: PointerEventData) => Promise<boolean>;
28
30
  private readonly updateHoverStateOnRenderHandler;
29
31
  constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, hasEventListeners?: boolean, iconsOptions?: IconsOptions);
30
32
  get needsRedraw(): boolean;
@@ -35,13 +37,15 @@ export declare class Image360ApiHelper<DataSourceT extends DataSourceType> {
35
37
  remove360ImageCollection(collection: Image360Collection<DataSourceT>): void;
36
38
  getCurrentlyEnteredImageInfo(): Image360WithCollection<DataSourceT> | undefined;
37
39
  enter360Image(image360Entity: Image360Entity<DataSourceT>, revision?: Image360RevisionEntity<DataSourceT>): Promise<void>;
38
- enter360ImageInternal(image360Entity: Image360Entity<DataSourceT>, revision?: Image360RevisionEntity<DataSourceT>): Promise<boolean>;
40
+ enter360ImageInternal(image360Entity: Image360Entity<DataSourceT>, revision?: Image360RevisionEntity<DataSourceT>, updateHistory?: boolean): Promise<boolean>;
39
41
  private applyFullResolutionTextures;
40
42
  private transition;
41
43
  private tweenVisualizationAlpha;
42
44
  private tweenVisualizationZoom;
43
45
  private setStationaryCameraManager;
44
46
  exit360Image(): void;
47
+ canDoAction(action: Image360Action): boolean;
48
+ doAction(action: Image360Action): Promise<void>;
45
49
  dispose(): void;
46
50
  private findRevisionIdToEnter;
47
51
  private enter360ImageOnIntersect;
@@ -13,6 +13,7 @@ import { Image360DataModelIdentifier } from '../../../../data-providers';
13
13
  import { SupportedModelTypes } from '../../../../model-base';
14
14
  import { Image360Collection, Image360, Image360Revision, Image360AnnotationIntersection } from '../../../../360-images';
15
15
  import { ClassicDataSourceType, DataSourceType } from '../../../../data-providers';
16
+ import { Image360Action } from '../../../../360-images/src/Image360Action';
16
17
  /**
17
18
  * @example
18
19
  * ```js
@@ -324,6 +325,18 @@ export declare class Cognite3DViewer<DataSourceT extends DataSourceType = Classi
324
325
  * Exit visualization of the 360 image.
325
326
  */
326
327
  exit360Image(): void;
328
+ /**
329
+ * Check if a 360 image action can be done.
330
+ * @param action The action to check if can be done.
331
+ * @beta
332
+ */
333
+ canDo360Action(action: Image360Action): boolean;
334
+ /**
335
+ * Do a 360 image action.
336
+ * @param action The action to do.
337
+ * @beta
338
+ */
339
+ do360Action(action: Image360Action): Promise<void>;
327
340
  /**
328
341
  * Removes a model that was previously added using {@link Cognite3DViewer.addModel},
329
342
  * {@link Cognite3DViewer.addCadModel} or {@link Cognite3DViewer.addPointCloudModel}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.19.1-dev.20241028",
3
+ "version": "4.19.1-dev.20241029",
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": {