@cognite/reveal 4.0.0-dev.20221128 → 4.0.0-dev.20221129
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 +41 -33
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/Image360VisualizationBox.d.ts +1 -0
- package/dist/packages/api/src/public/RevealManager.d.ts +6 -2
- package/dist/packages/api/src/public/createRevealManager.d.ts +5 -2
- package/dist/packages/api/src/storage/RevealManagerHelper.d.ts +6 -3
- package/dist/packages/camera-manager/index.d.ts +2 -1
- package/dist/packages/camera-manager/src/CameraManager.d.ts +11 -5
- package/dist/packages/camera-manager/src/ComboControls.d.ts +50 -4
- package/dist/packages/camera-manager/src/DefaultCameraManager.d.ts +14 -10
- package/dist/packages/camera-manager/src/ProxyCameraManager.d.ts +9 -6
- package/dist/packages/camera-manager/src/StationaryCameraManager.d.ts +8 -5
- package/dist/packages/camera-manager/src/types.d.ts +17 -0
- package/dist/packages/camera-manager/src/utils/DebouncedCameraStopEventTrigger.d.ts +12 -0
- package/package.json +3 -3
|
@@ -11,6 +11,7 @@ export declare class Image360VisualizationBox implements Image360Visualization {
|
|
|
11
11
|
private _faceMaterials;
|
|
12
12
|
private readonly _sceneHandler;
|
|
13
13
|
private readonly _visualizationState;
|
|
14
|
+
get opacity(): number;
|
|
14
15
|
set opacity(alpha: number);
|
|
15
16
|
set visible(isVisible: boolean);
|
|
16
17
|
set scale(newScale: THREE.Vector3);
|
|
@@ -8,6 +8,7 @@ import { PointCloudManager, PointCloudNode } from '../../../pointclouds';
|
|
|
8
8
|
import { CadManager, CadModelBudget } from '../../../cad-geometry-loaders';
|
|
9
9
|
import { NodeAppearanceProvider } from '../../../cad-styling';
|
|
10
10
|
import { RenderMode, RenderPipelineExecutor, CadMaterialManager, RenderPipelineProvider } from '../../../rendering';
|
|
11
|
+
import { CameraManager } from '../../../camera-manager';
|
|
11
12
|
import { ModelIdentifier } from '../../../data-providers';
|
|
12
13
|
export type AddCadModelOptions = {
|
|
13
14
|
nodeAppearanceProvider?: NodeAppearanceProvider;
|
|
@@ -18,12 +19,15 @@ export declare class RevealManager {
|
|
|
18
19
|
private readonly _pointCloudManager;
|
|
19
20
|
private readonly _pipelineExecutor;
|
|
20
21
|
private readonly _renderPipeline;
|
|
21
|
-
private
|
|
22
|
+
private _cameraInMotion;
|
|
22
23
|
private _isDisposed;
|
|
23
24
|
private readonly _subscriptions;
|
|
24
25
|
private readonly _events;
|
|
25
26
|
private readonly _updateSubject;
|
|
26
|
-
|
|
27
|
+
private readonly _cameraManager;
|
|
28
|
+
private readonly _onCameraChange;
|
|
29
|
+
private readonly _onCameraStop;
|
|
30
|
+
constructor(cadManager: CadManager, pointCloudManager: PointCloudManager, pipelineExecutor: RenderPipelineExecutor, renderPipeline: RenderPipelineProvider, cameraManager: CameraManager);
|
|
27
31
|
dispose(): void;
|
|
28
32
|
requestRedraw(): void;
|
|
29
33
|
resetRedraw(): void;
|
|
@@ -6,19 +6,22 @@ import { RevealOptions } from './types';
|
|
|
6
6
|
import { RevealManager } from './RevealManager';
|
|
7
7
|
import { CogniteClient } from '@cognite/sdk';
|
|
8
8
|
import { SceneHandler } from '../../../utilities';
|
|
9
|
+
import { CameraManager } from '../../../camera-manager';
|
|
9
10
|
/**
|
|
10
11
|
* Used to create an instance of reveal manager that works with localhost.
|
|
11
12
|
* @param renderer
|
|
12
13
|
* @param sceneHandler
|
|
14
|
+
* @param cameraManager
|
|
13
15
|
* @param revealOptions
|
|
14
16
|
* @returns RevealManager instance.
|
|
15
17
|
*/
|
|
16
|
-
export declare function createLocalRevealManager(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, revealOptions?: RevealOptions): RevealManager;
|
|
18
|
+
export declare function createLocalRevealManager(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, cameraManager: CameraManager, revealOptions?: RevealOptions): RevealManager;
|
|
17
19
|
/**
|
|
18
20
|
* Used to create an instance of reveal manager that works with the CDF.
|
|
19
21
|
* @param client
|
|
20
22
|
* @param renderer
|
|
21
23
|
* @param sceneHandler
|
|
24
|
+
* @param cameraManager
|
|
22
25
|
* @param revealOptions
|
|
23
26
|
*/
|
|
24
|
-
export declare function createCdfRevealManager(client: CogniteClient, renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, revealOptions?: RevealOptions): RevealManager;
|
|
27
|
+
export declare function createCdfRevealManager(client: CogniteClient, renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, cameraManager: CameraManager, revealOptions?: RevealOptions): RevealManager;
|
|
@@ -10,6 +10,7 @@ import { SceneHandler } from '../../../utilities';
|
|
|
10
10
|
import { CadNode } from '../../../cad-model';
|
|
11
11
|
import { CogniteClient } from '@cognite/sdk';
|
|
12
12
|
import { PointCloudNode } from '../../../pointclouds';
|
|
13
|
+
import { CameraManager } from '../../../camera-manager';
|
|
13
14
|
/**
|
|
14
15
|
* Helper for {@link RevealManager} for creating a uniform interface for
|
|
15
16
|
* working with instances that fetch models from CDF or instances that fetch
|
|
@@ -26,18 +27,20 @@ export declare class RevealManagerHelper {
|
|
|
26
27
|
* meant for use in debugging and development.
|
|
27
28
|
* @param renderer
|
|
28
29
|
* @param sceneHandler
|
|
30
|
+
* @param cameraManager
|
|
29
31
|
* @param revealOptions
|
|
30
32
|
*/
|
|
31
|
-
static createLocalHelper(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, revealOptions: RevealOptions): RevealManagerHelper;
|
|
33
|
+
static createLocalHelper(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, cameraManager: CameraManager, revealOptions: RevealOptions): RevealManagerHelper;
|
|
32
34
|
/**
|
|
33
35
|
* Creates a helper for RevealManager that loads models from CDF.
|
|
34
36
|
* @param renderer
|
|
35
37
|
* @param sceneHandler
|
|
38
|
+
* @param cameraManager
|
|
36
39
|
* @param revealOptions
|
|
37
40
|
* @param sdkClient
|
|
38
41
|
*/
|
|
39
|
-
static createCdfHelper(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, revealOptions: RevealOptions, sdkClient: CogniteClient): RevealManagerHelper;
|
|
40
|
-
static createCustomDataSourceHelper(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, revealOptions: RevealOptions, dataSource: DataSource): RevealManagerHelper;
|
|
42
|
+
static createCdfHelper(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, cameraManager: CameraManager, revealOptions: RevealOptions, sdkClient: CogniteClient): RevealManagerHelper;
|
|
43
|
+
static createCustomDataSourceHelper(renderer: THREE.WebGLRenderer, sceneHandler: SceneHandler, cameraManager: CameraManager, revealOptions: RevealOptions, dataSource: DataSource): RevealManagerHelper;
|
|
41
44
|
get revealManager(): RevealManager;
|
|
42
45
|
/**
|
|
43
46
|
* Adds a local CAD model.
|
|
@@ -6,5 +6,6 @@ export { ProxyCameraManager } from './src/ProxyCameraManager';
|
|
|
6
6
|
export { StationaryCameraManager } from './src/StationaryCameraManager';
|
|
7
7
|
export { CameraManagerHelper } from './src/CameraManagerHelper';
|
|
8
8
|
export { CameraManager } from './src/CameraManager';
|
|
9
|
-
export { ComboControls } from './src/ComboControls';
|
|
9
|
+
export { ComboControls, ComboControlsOptions } from './src/ComboControls';
|
|
10
|
+
export { DebouncedCameraStopEventTrigger } from './src/utils/DebouncedCameraStopEventTrigger';
|
|
10
11
|
export * from './src/types';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { CameraState, CameraChangeDelegate } from './types';
|
|
5
|
+
import { CameraState, CameraChangeDelegate, CameraStopDelegate, CameraManagerEventType, CameraEventDelegate } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* Interface for manager responsible for all manipulations to the camera,
|
|
8
8
|
* including animations and modification of state. Implementations are responsible for
|
|
@@ -56,20 +56,26 @@ export interface CameraManager {
|
|
|
56
56
|
*/
|
|
57
57
|
deactivate(): void;
|
|
58
58
|
/**
|
|
59
|
-
* Subscribes to
|
|
60
|
-
*
|
|
59
|
+
* Subscribes to events on this camera manager. There are several event types:
|
|
60
|
+
* 'cameraChange' - Subscribes to changes of the camera. This is used by Reveal to react on changes of the camera.
|
|
61
|
+
* 'cameraStop' - Subscribes to events indicating the camera has stopped
|
|
62
|
+
* @param event The event type.
|
|
61
63
|
* @param callback Callback to be called when the event is fired.
|
|
62
64
|
*/
|
|
63
65
|
on(event: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
66
|
+
on(event: 'cameraStop', callback: CameraStopDelegate): void;
|
|
67
|
+
on(event: CameraManagerEventType, callback: CameraEventDelegate): void;
|
|
64
68
|
/**
|
|
65
69
|
* Unsubscribes from changes of the camera event.
|
|
66
|
-
* @param event
|
|
70
|
+
* @param event The event type.
|
|
67
71
|
* @param callback Callback function to be unsubscribed.
|
|
68
72
|
*/
|
|
69
73
|
off(event: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
74
|
+
off(event: 'cameraStop', callback: CameraStopDelegate): void;
|
|
75
|
+
off(event: CameraManagerEventType, callback: CameraEventDelegate): void;
|
|
70
76
|
/**
|
|
71
77
|
* Moves camera to a place where the content of a bounding box is visible to the camera.
|
|
72
|
-
* @param
|
|
78
|
+
* @param boundingBox The bounding box in world space.
|
|
73
79
|
* @param duration The duration of the animation moving the camera.
|
|
74
80
|
* @param radiusFactor The ratio of the distance from camera to center of box and radius of the box.
|
|
75
81
|
*/
|
|
@@ -1,22 +1,42 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { EventDispatcher,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { EventDispatcher, OrthographicCamera, PerspectiveCamera, Quaternion, Vector3 } from 'three';
|
|
5
|
+
/**
|
|
6
|
+
* Exposed options for Combo Controls
|
|
7
|
+
*/
|
|
8
|
+
export type ComboControlsOptions = {
|
|
7
9
|
enableDamping: boolean;
|
|
8
10
|
dampingFactor: number;
|
|
9
11
|
dynamicTarget: boolean;
|
|
10
12
|
minDistance: number;
|
|
11
13
|
minZoomDistance: number;
|
|
12
14
|
dollyFactor: number;
|
|
15
|
+
/**
|
|
16
|
+
* Radians
|
|
17
|
+
*/
|
|
13
18
|
minPolarAngle: number;
|
|
19
|
+
/**
|
|
20
|
+
* Radians
|
|
21
|
+
*/
|
|
14
22
|
maxPolarAngle: number;
|
|
23
|
+
/**
|
|
24
|
+
* Radians
|
|
25
|
+
*/
|
|
15
26
|
minAzimuthAngle: number;
|
|
27
|
+
/**
|
|
28
|
+
* Radians
|
|
29
|
+
*/
|
|
16
30
|
maxAzimuthAngle: number;
|
|
17
31
|
panDollyMinDistanceFactor: number;
|
|
18
32
|
firstPersonRotationFactor: number;
|
|
33
|
+
/**
|
|
34
|
+
* Radians per pixel
|
|
35
|
+
*/
|
|
19
36
|
pointerRotationSpeedAzimuth: number;
|
|
37
|
+
/**
|
|
38
|
+
* Radians per pixel
|
|
39
|
+
*/
|
|
20
40
|
pointerRotationSpeedPolar: number;
|
|
21
41
|
enableKeyboardNavigation: boolean;
|
|
22
42
|
keyboardRotationSpeedAzimuth: number;
|
|
@@ -24,11 +44,13 @@ export declare class ComboControls extends EventDispatcher {
|
|
|
24
44
|
mouseFirstPersonRotationSpeed: number;
|
|
25
45
|
keyboardDollySpeed: number;
|
|
26
46
|
keyboardPanSpeed: number;
|
|
47
|
+
/**
|
|
48
|
+
* How much quicker keyboard navigation will be with 'shift' pressed
|
|
49
|
+
*/
|
|
27
50
|
keyboardSpeedFactor: number;
|
|
28
51
|
pinchEpsilon: number;
|
|
29
52
|
pinchPanSpeed: number;
|
|
30
53
|
EPSILON: number;
|
|
31
|
-
dispose: () => void;
|
|
32
54
|
minZoom: number;
|
|
33
55
|
maxZoom: number;
|
|
34
56
|
orthographicCameraDollyFactor: number;
|
|
@@ -39,6 +61,9 @@ export declare class ComboControls extends EventDispatcher {
|
|
|
39
61
|
maxDeltaRatio: number;
|
|
40
62
|
minDeltaDownscaleCoefficient: number;
|
|
41
63
|
maxDeltaDownscaleCoefficient: number;
|
|
64
|
+
};
|
|
65
|
+
export declare class ComboControls extends EventDispatcher {
|
|
66
|
+
dispose: () => void;
|
|
42
67
|
private _temporarilyDisableDamping;
|
|
43
68
|
private readonly _camera;
|
|
44
69
|
private _firstPersonMode;
|
|
@@ -60,6 +85,27 @@ export declare class ComboControls extends EventDispatcher {
|
|
|
60
85
|
private readonly _raycaster;
|
|
61
86
|
private readonly _targetFPS;
|
|
62
87
|
private _targetFPSOverActualFPS;
|
|
88
|
+
private _enabled;
|
|
89
|
+
private _options;
|
|
90
|
+
private static readonly DefaultControlsOptions;
|
|
91
|
+
/**
|
|
92
|
+
* Gets current Combo Controls options.
|
|
93
|
+
*/
|
|
94
|
+
get options(): Readonly<ComboControlsOptions>;
|
|
95
|
+
/**
|
|
96
|
+
* Sets Combo Controls options.
|
|
97
|
+
*
|
|
98
|
+
* Only the provided options will be changed, any undefined options will be kept as is.
|
|
99
|
+
*/
|
|
100
|
+
set options(options: Partial<ComboControlsOptions>);
|
|
101
|
+
/**
|
|
102
|
+
* Returns true if these controls are enabled.
|
|
103
|
+
*/
|
|
104
|
+
get enabled(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Sets the enabled state of these controls.
|
|
107
|
+
*/
|
|
108
|
+
set enabled(enabled: boolean);
|
|
63
109
|
constructor(camera: PerspectiveCamera | OrthographicCamera, domElement: HTMLElement);
|
|
64
110
|
update: (deltaTime: number, forceUpdate?: boolean) => boolean;
|
|
65
111
|
getState: () => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import {
|
|
6
|
-
import { CameraControlsOptions, CameraState,
|
|
5
|
+
import { ComboControlsOptions } from './ComboControls';
|
|
6
|
+
import { CameraControlsOptions, CameraState, CameraManagerEventType, CameraEventDelegate } from './types';
|
|
7
7
|
import { CameraManager } from './CameraManager';
|
|
8
8
|
/**
|
|
9
9
|
* Default implementation of {@link CameraManager}. Uses target-based orbit controls combined with
|
|
@@ -12,6 +12,7 @@ import { CameraManager } from './CameraManager';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class DefaultCameraManager implements CameraManager {
|
|
14
14
|
private readonly _events;
|
|
15
|
+
private readonly _stopEventTrigger;
|
|
15
16
|
private readonly _controls;
|
|
16
17
|
private readonly _camera;
|
|
17
18
|
private readonly _domElement;
|
|
@@ -57,15 +58,9 @@ export declare class DefaultCameraManager implements CameraManager {
|
|
|
57
58
|
* and `viewer.cameraManager.cameraControls.maxDistance`.
|
|
58
59
|
*/
|
|
59
60
|
automaticControlsSensitivity: boolean;
|
|
60
|
-
on(event:
|
|
61
|
-
off(event:
|
|
61
|
+
on(event: CameraManagerEventType, callback: CameraEventDelegate): void;
|
|
62
|
+
off(event: CameraManagerEventType, callback: CameraEventDelegate): void;
|
|
62
63
|
fitCameraToBoundingBox(box: THREE.Box3, duration?: number, radiusFactor?: number): void;
|
|
63
|
-
/**
|
|
64
|
-
* Gets instance of camera controls that are used by camera manager. See {@link ComboControls} for more
|
|
65
|
-
* information on all adjustable properties.
|
|
66
|
-
* @deprecated Will be removed in 4.0.0.
|
|
67
|
-
*/
|
|
68
|
-
get cameraControls(): ComboControls;
|
|
69
64
|
/**
|
|
70
65
|
* Sets whether camera controls through mouse, touch and keyboard are enabled.
|
|
71
66
|
*/
|
|
@@ -74,6 +69,15 @@ export declare class DefaultCameraManager implements CameraManager {
|
|
|
74
69
|
* Gets whether camera controls through mouse, touch and keyboard are enabled.
|
|
75
70
|
*/
|
|
76
71
|
get enabled(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Gets current Combo Controls options.
|
|
74
|
+
*/
|
|
75
|
+
getComboControlsOptions(): Readonly<ComboControlsOptions>;
|
|
76
|
+
/**
|
|
77
|
+
* Sets Combo Controls options.
|
|
78
|
+
* Only provided options will be changed, any undefined options will be kept as is.
|
|
79
|
+
*/
|
|
80
|
+
setComboControlsOptions(options: Partial<ComboControlsOptions>): void;
|
|
77
81
|
/**
|
|
78
82
|
* Sets whether keyboard control of the camera is enabled/disabled.
|
|
79
83
|
*/
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { CameraManager } from './CameraManager';
|
|
6
|
-
import { CameraChangeDelegate, CameraState } from './types';
|
|
6
|
+
import { CameraChangeDelegate, CameraState, CameraStopDelegate } from './types';
|
|
7
7
|
export declare class ProxyCameraManager implements CameraManager {
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly _cameraEventListeners;
|
|
9
|
+
private readonly _activeCameraEventHandlers;
|
|
9
10
|
private _activeCameraManager;
|
|
10
|
-
private readonly _activeCameraEventHandler;
|
|
11
11
|
get enabled(): boolean;
|
|
12
12
|
get innerCameraManager(): CameraManager;
|
|
13
13
|
constructor(initialActiveCamera: CameraManager);
|
|
@@ -17,10 +17,13 @@ export declare class ProxyCameraManager implements CameraManager {
|
|
|
17
17
|
getCameraState(): Required<CameraState>;
|
|
18
18
|
activate(cameraManager?: CameraManager): void;
|
|
19
19
|
deactivate(): void;
|
|
20
|
-
on(
|
|
21
|
-
|
|
20
|
+
on(eventType: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
21
|
+
on(eventType: 'cameraStop', callback: CameraStopDelegate): void;
|
|
22
|
+
off(eventType: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
23
|
+
off(eventType: 'cameraStop', callback: CameraStopDelegate): void;
|
|
22
24
|
fitCameraToBoundingBox(boundingBox: THREE.Box3, duration?: number | undefined, radiusFactor?: number | undefined): void;
|
|
23
25
|
update(deltaTime: number, boundingBox: THREE.Box3): void;
|
|
24
26
|
dispose(): void;
|
|
25
|
-
private
|
|
27
|
+
private onActiveCameraManagerChangeFired;
|
|
28
|
+
private onActiveCameraManagerStopFired;
|
|
26
29
|
}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { CameraManager } from './CameraManager';
|
|
6
|
-
import { CameraChangeDelegate, CameraState } from './types';
|
|
6
|
+
import { CameraChangeDelegate, CameraEventDelegate, CameraManagerEventType, CameraState } from './types';
|
|
7
7
|
export declare class StationaryCameraManager implements CameraManager {
|
|
8
8
|
private readonly _camera;
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly _cameraChangedListeners;
|
|
10
10
|
private readonly _domElement;
|
|
11
|
+
private _defaultFOV;
|
|
12
|
+
private readonly _stopEventTrigger;
|
|
11
13
|
private _isEnabled;
|
|
12
14
|
private _isDragging;
|
|
13
15
|
constructor(domElement: HTMLElement, camera: THREE.PerspectiveCamera);
|
|
@@ -15,10 +17,10 @@ export declare class StationaryCameraManager implements CameraManager {
|
|
|
15
17
|
getCamera(): THREE.PerspectiveCamera;
|
|
16
18
|
setCameraState(state: CameraState): void;
|
|
17
19
|
getCameraState(): Required<CameraState>;
|
|
18
|
-
activate(): void;
|
|
20
|
+
activate(cameraManager: CameraManager): void;
|
|
19
21
|
deactivate(): void;
|
|
20
|
-
on(
|
|
21
|
-
off(
|
|
22
|
+
on(eventType: CameraManagerEventType, callback: CameraEventDelegate): void;
|
|
23
|
+
off(eventType: CameraManagerEventType, callback: CameraChangeDelegate): void;
|
|
22
24
|
fitCameraToBoundingBox(boundingBox: THREE.Box3, _?: number, radiusFactor?: number): void;
|
|
23
25
|
moveTo(targetPosition: THREE.Vector3, duration?: number): Promise<void>;
|
|
24
26
|
update(_: number, boundingBox: THREE.Box3): void;
|
|
@@ -26,4 +28,5 @@ export declare class StationaryCameraManager implements CameraManager {
|
|
|
26
28
|
private readonly enableDragging;
|
|
27
29
|
private readonly disableDragging;
|
|
28
30
|
private readonly rotateCamera;
|
|
31
|
+
private readonly zoomCamera;
|
|
29
32
|
}
|
|
@@ -48,6 +48,15 @@ export type CameraState = {
|
|
|
48
48
|
* @module @cognite/reveal
|
|
49
49
|
*/
|
|
50
50
|
export type CameraChangeDelegate = (position: THREE.Vector3, target: THREE.Vector3) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Delegate for camera update events.
|
|
53
|
+
* @module @cognite/reveal
|
|
54
|
+
*/
|
|
55
|
+
export type CameraStopDelegate = () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Union type of all camera event delegates
|
|
58
|
+
*/
|
|
59
|
+
export type CameraEventDelegate = CameraChangeDelegate | CameraStopDelegate;
|
|
51
60
|
export type CameraManagerCallbackData = {
|
|
52
61
|
intersection: {
|
|
53
62
|
/**
|
|
@@ -64,3 +73,11 @@ export type CameraManagerCallbackData = {
|
|
|
64
73
|
*/
|
|
65
74
|
modelsBoundingBox: THREE.Box3;
|
|
66
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* List of supported event types (adapted from https://stackoverflow.com/questions/44480644/string-union-to-string-array)
|
|
78
|
+
*/
|
|
79
|
+
export declare const CAMERA_MANAGER_EVENT_TYPE_LIST: readonly ["cameraChange", "cameraStop"];
|
|
80
|
+
/**
|
|
81
|
+
* Union type of the supported camera manager event types
|
|
82
|
+
*/
|
|
83
|
+
export type CameraManagerEventType = typeof CAMERA_MANAGER_EVENT_TYPE_LIST[number];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CameraManager } from '../CameraManager';
|
|
5
|
+
import { CameraStopDelegate } from '../types';
|
|
6
|
+
import { EventTrigger } from '../../../utilities';
|
|
7
|
+
export declare class DebouncedCameraStopEventTrigger extends EventTrigger<CameraStopDelegate> {
|
|
8
|
+
private readonly _debouncedFireEvent;
|
|
9
|
+
private readonly _cameraManager;
|
|
10
|
+
constructor(cameraManager: CameraManager, debounceTimeMs?: number);
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.20221129",
|
|
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": {
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@types/jest-environment-puppeteer": "5.0.3",
|
|
95
95
|
"@types/jest-image-snapshot": "5.1.0",
|
|
96
96
|
"@types/jsdom": "20.0.1",
|
|
97
|
-
"@types/lodash": "4.14.
|
|
97
|
+
"@types/lodash": "4.14.190",
|
|
98
98
|
"@types/mixpanel-browser": "2.38.0",
|
|
99
99
|
"@types/node": "18.11.3",
|
|
100
100
|
"@types/proj4": "2.5.2",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@types/tween.js": "18.5.1",
|
|
105
105
|
"@typescript-eslint/eslint-plugin": "5.43.0",
|
|
106
106
|
"@typescript-eslint/parser": "5.43.0",
|
|
107
|
-
"concurrently": "7.
|
|
107
|
+
"concurrently": "7.6.0",
|
|
108
108
|
"cross-env": "7.0.3",
|
|
109
109
|
"cross-var": "1.1.0",
|
|
110
110
|
"dat.gui": "0.7.9",
|