@cognite/reveal 4.8.0 → 4.9.1
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/index.js +188 -180
- package/dist/index.js.map +1 -1
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +0 -1
- package/dist/packages/cad-model/src/wrappers/CogniteCadModel.d.ts +3 -2
- package/dist/packages/cad-styling/src/NodeAppearanceProvider.d.ts +2 -2
- package/dist/packages/camera-manager/index.d.ts +2 -1
- package/dist/packages/camera-manager/src/ComboControls.d.ts +45 -115
- package/dist/packages/camera-manager/src/ComboControlsOptions.d.ts +64 -0
- package/dist/packages/camera-manager/src/DefaultCameraManager.d.ts +6 -9
- package/dist/packages/camera-manager/src/types.d.ts +12 -0
- package/dist/packages/metrics/src/Fingerprint.d.ts +8 -0
- package/dist/packages/metrics/src/MetricsLogger.d.ts +2 -1
- package/dist/packages/utilities/index.d.ts +1 -1
- package/dist/packages/utilities/src/worldToViewport.d.ts +2 -1
- package/package.json +24 -23
|
@@ -23,7 +23,6 @@ export declare class Image360ApiHelper {
|
|
|
23
23
|
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, iconsOptions?: IconsOptions);
|
|
24
24
|
get needsRedraw(): boolean;
|
|
25
25
|
resetRedraw(): void;
|
|
26
|
-
private getNormalizedOffset;
|
|
27
26
|
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform: THREE.Matrix4, preMultipliedRotation: boolean, annotationOptions?: Image360AnnotationFilterOptions): Promise<Image360Collection>;
|
|
28
27
|
getImageCollections(): Image360Collection[];
|
|
29
28
|
remove360Images(entities: Image360[]): Promise<void>;
|
|
@@ -48,7 +48,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
48
48
|
private readonly cadModel;
|
|
49
49
|
private readonly nodesApiClient;
|
|
50
50
|
private readonly nodeIdAndTreeIndexMaps;
|
|
51
|
-
private
|
|
51
|
+
private _styledNodeCollections;
|
|
52
52
|
private readonly customSectorBounds;
|
|
53
53
|
/**
|
|
54
54
|
* Sets the default appearance for nodes that are not styled using
|
|
@@ -90,6 +90,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
90
90
|
*
|
|
91
91
|
* @param nodeCollection Dynamic set of nodes to apply the provided appearance to.
|
|
92
92
|
* @param appearance Appearance to style the provided set with.
|
|
93
|
+
* @param importance The importance of this style. Can be used to manually order the order of styles, this can avoid the order of adding styles affecting the outcome. Optional and defaults to 0.
|
|
93
94
|
* @example
|
|
94
95
|
* ```js
|
|
95
96
|
* model.setDefaultNodeAppearance({ rendererGhosted: true });
|
|
@@ -97,7 +98,7 @@ export declare class CogniteCadModel implements CdfModelNodeCollectionDataProvid
|
|
|
97
98
|
* model.assignStyledNodeCollection(visibleSet, { rendererGhosted: false });
|
|
98
99
|
* ```
|
|
99
100
|
*/
|
|
100
|
-
assignStyledNodeCollection(nodeCollection: NodeCollection, appearance: NodeAppearance): void;
|
|
101
|
+
assignStyledNodeCollection(nodeCollection: NodeCollection, appearance: NodeAppearance, importance?: number): void;
|
|
101
102
|
/**
|
|
102
103
|
* Removes styling for previously added styled collection, resetting the style to the default (or
|
|
103
104
|
* the style imposed by other styled collections).
|
|
@@ -12,7 +12,7 @@ import { IndexSet } from '../../utilities';
|
|
|
12
12
|
*/
|
|
13
13
|
export type ApplyStyleDelegate = (treeIndices: IndexSet, appearance: NodeAppearance) => void;
|
|
14
14
|
export declare class NodeAppearanceProvider {
|
|
15
|
-
private
|
|
15
|
+
private _styledCollections;
|
|
16
16
|
private _lastFiredLoadingState?;
|
|
17
17
|
private _cachedPrioritizedAreas?;
|
|
18
18
|
private readonly _events;
|
|
@@ -21,7 +21,7 @@ export declare class NodeAppearanceProvider {
|
|
|
21
21
|
on(event: 'prioritizedAreasChanged', listener: () => void): void;
|
|
22
22
|
off(event: 'changed', listener: () => void): void;
|
|
23
23
|
off(event: 'loadingStateChanged', listener: (isLoading: boolean) => void): void;
|
|
24
|
-
assignStyledNodeCollection(nodeCollection: NodeCollection, appearance: NodeAppearance): void;
|
|
24
|
+
assignStyledNodeCollection(nodeCollection: NodeCollection, appearance: NodeAppearance, importance?: number): void;
|
|
25
25
|
unassignStyledNodeCollection(nodeCollection: NodeCollection): void;
|
|
26
26
|
applyStyles(applyCb: ApplyStyleDelegate): void;
|
|
27
27
|
getPrioritizedAreas(): PrioritizedArea[];
|
|
@@ -6,6 +6,7 @@ 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,
|
|
9
|
+
export { ComboControls, ComboControlsEventType } from './src/ComboControls';
|
|
10
|
+
export { ComboControlsOptions } from './src/ComboControlsOptions';
|
|
10
11
|
export { DebouncedCameraStopEventTrigger } from './src/utils/DebouncedCameraStopEventTrigger';
|
|
11
12
|
export * from './src/types';
|
|
@@ -2,66 +2,7 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { EventDispatcher, OrthographicCamera, PerspectiveCamera, Quaternion, Vector3 } from 'three';
|
|
5
|
-
|
|
6
|
-
* Exposed options for Combo Controls
|
|
7
|
-
*/
|
|
8
|
-
export type ComboControlsOptions = {
|
|
9
|
-
enableDamping: boolean;
|
|
10
|
-
dampingFactor: number;
|
|
11
|
-
dynamicTarget: boolean;
|
|
12
|
-
minDistance: number;
|
|
13
|
-
minZoomDistance: number;
|
|
14
|
-
dollyFactor: number;
|
|
15
|
-
/**
|
|
16
|
-
* Radians
|
|
17
|
-
*/
|
|
18
|
-
minPolarAngle: number;
|
|
19
|
-
/**
|
|
20
|
-
* Radians
|
|
21
|
-
*/
|
|
22
|
-
maxPolarAngle: number;
|
|
23
|
-
/**
|
|
24
|
-
* Radians
|
|
25
|
-
*/
|
|
26
|
-
minAzimuthAngle: number;
|
|
27
|
-
/**
|
|
28
|
-
* Radians
|
|
29
|
-
*/
|
|
30
|
-
maxAzimuthAngle: number;
|
|
31
|
-
panDollyMinDistanceFactor: number;
|
|
32
|
-
firstPersonRotationFactor: number;
|
|
33
|
-
/**
|
|
34
|
-
* Radians per pixel
|
|
35
|
-
*/
|
|
36
|
-
pointerRotationSpeedAzimuth: number;
|
|
37
|
-
/**
|
|
38
|
-
* Radians per pixel
|
|
39
|
-
*/
|
|
40
|
-
pointerRotationSpeedPolar: number;
|
|
41
|
-
enableKeyboardNavigation: boolean;
|
|
42
|
-
keyboardRotationSpeedAzimuth: number;
|
|
43
|
-
keyboardRotationSpeedPolar: number;
|
|
44
|
-
mouseFirstPersonRotationSpeed: number;
|
|
45
|
-
keyboardDollySpeed: number;
|
|
46
|
-
keyboardPanSpeed: number;
|
|
47
|
-
/**
|
|
48
|
-
* How much quicker keyboard navigation will be with 'shift' pressed
|
|
49
|
-
*/
|
|
50
|
-
keyboardSpeedFactor: number;
|
|
51
|
-
pinchEpsilon: number;
|
|
52
|
-
pinchPanSpeed: number;
|
|
53
|
-
EPSILON: number;
|
|
54
|
-
minZoom: number;
|
|
55
|
-
maxZoom: number;
|
|
56
|
-
orthographicCameraDollyFactor: number;
|
|
57
|
-
lookAtViewTarget: boolean;
|
|
58
|
-
useScrollTarget: boolean;
|
|
59
|
-
zoomToCursor: boolean;
|
|
60
|
-
minDeltaRatio: number;
|
|
61
|
-
maxDeltaRatio: number;
|
|
62
|
-
minDeltaDownscaleCoefficient: number;
|
|
63
|
-
maxDeltaDownscaleCoefficient: number;
|
|
64
|
-
};
|
|
5
|
+
import { ComboControlsOptions } from './ComboControlsOptions';
|
|
65
6
|
/**
|
|
66
7
|
* The event type for events emitted by {@link ComboControls}.
|
|
67
8
|
*/
|
|
@@ -75,31 +16,25 @@ export type ComboControlsEventType = {
|
|
|
75
16
|
};
|
|
76
17
|
export declare class ComboControls extends EventDispatcher<ComboControlsEventType> {
|
|
77
18
|
dispose: () => void;
|
|
19
|
+
private _enabled;
|
|
20
|
+
private _options;
|
|
78
21
|
private _temporarilyDisableDamping;
|
|
22
|
+
private readonly _domElement;
|
|
79
23
|
private readonly _camera;
|
|
80
|
-
private _firstPersonMode;
|
|
81
24
|
private readonly _reusableCamera;
|
|
82
|
-
private readonly _reusableVector3;
|
|
83
|
-
private readonly _accumulatedMouseMove;
|
|
84
|
-
private readonly _domElement;
|
|
85
25
|
private readonly _target;
|
|
86
|
-
private readonly _viewTarget;
|
|
87
|
-
private readonly _scrollTarget;
|
|
88
26
|
private readonly _targetEnd;
|
|
89
27
|
private readonly _spherical;
|
|
90
28
|
private readonly _sphericalEnd;
|
|
91
|
-
private readonly
|
|
29
|
+
private readonly _scrollTarget;
|
|
30
|
+
private readonly _viewTarget;
|
|
92
31
|
private readonly _rawCameraRotation;
|
|
32
|
+
private readonly _accumulatedMouseMove;
|
|
93
33
|
private readonly _keyboard;
|
|
94
|
-
private readonly _offsetVector;
|
|
95
|
-
private readonly _panVector;
|
|
96
|
-
private readonly _raycaster;
|
|
97
|
-
private readonly _targetFPS;
|
|
98
|
-
private _targetFPSOverActualFPS;
|
|
99
34
|
private readonly _pointEventCache;
|
|
100
|
-
private
|
|
101
|
-
private
|
|
102
|
-
|
|
35
|
+
private readonly _reusableVector3s;
|
|
36
|
+
private readonly _raycaster;
|
|
37
|
+
constructor(camera: PerspectiveCamera | OrthographicCamera, domElement: HTMLElement);
|
|
103
38
|
/**
|
|
104
39
|
* Gets current Combo Controls options.
|
|
105
40
|
*/
|
|
@@ -118,13 +53,6 @@ export declare class ComboControls extends EventDispatcher<ComboControlsEventTyp
|
|
|
118
53
|
* Sets the enabled state of these controls.
|
|
119
54
|
*/
|
|
120
55
|
set enabled(newEnabledValue: boolean);
|
|
121
|
-
constructor(camera: PerspectiveCamera | OrthographicCamera, domElement: HTMLElement);
|
|
122
|
-
update: (deltaTimeS: number, forceUpdate?: boolean) => boolean;
|
|
123
|
-
getState: () => {
|
|
124
|
-
target: Vector3;
|
|
125
|
-
position: Vector3;
|
|
126
|
-
};
|
|
127
|
-
setState: (position: Vector3, target: Vector3) => void;
|
|
128
56
|
/**
|
|
129
57
|
* Camera rotation to be used by the camera instead of target-based rotation.
|
|
130
58
|
* This rotation is used only when set to non-default quaternion value (not identity rotation quaternion).
|
|
@@ -132,12 +60,25 @@ export declare class ComboControls extends EventDispatcher<ComboControlsEventTyp
|
|
|
132
60
|
* resets to default value when `setState` method is called with no rotation value.
|
|
133
61
|
*/
|
|
134
62
|
get cameraRawRotation(): Quaternion;
|
|
135
|
-
setViewTarget: (target: Vector3) => void;
|
|
136
|
-
setScrollTarget: (target: Vector3) => void;
|
|
137
63
|
getScrollTarget: () => Vector3;
|
|
64
|
+
getState: () => {
|
|
65
|
+
target: Vector3;
|
|
66
|
+
position: Vector3;
|
|
67
|
+
};
|
|
68
|
+
setScrollTarget: (target: Vector3) => void;
|
|
69
|
+
setState: (position: Vector3, target: Vector3) => void;
|
|
70
|
+
setViewTarget: (target: Vector3) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Converts deltaTimeS to a time scale based on the target frames per second (FPS).
|
|
73
|
+
*
|
|
74
|
+
* @param deltaTimeS - The elapsed time since the last frame in seconds.
|
|
75
|
+
* @returns The time scale, which is a factor representing the relationship of deltaTimeS to the target FPS.
|
|
76
|
+
*/
|
|
77
|
+
private getTimeScale;
|
|
78
|
+
private getDollyDeltaDistance;
|
|
79
|
+
private newVector3;
|
|
80
|
+
update: (deltaTimeS: number, forceUpdate?: boolean) => boolean;
|
|
138
81
|
triggerCameraChangeEvent: () => void;
|
|
139
|
-
private calculateShortestDeltaTheta;
|
|
140
|
-
private readonly convertPixelCoordinatesToNormalized;
|
|
141
82
|
private readonly onPointerDown;
|
|
142
83
|
private readonly onMouseDown;
|
|
143
84
|
private readonly onPointerUp;
|
|
@@ -146,36 +87,25 @@ export declare class ComboControls extends EventDispatcher<ComboControlsEventTyp
|
|
|
146
87
|
private readonly onTouchStart;
|
|
147
88
|
private readonly onFocusChanged;
|
|
148
89
|
private readonly onContextMenu;
|
|
149
|
-
private
|
|
150
|
-
private
|
|
151
|
-
private
|
|
152
|
-
private
|
|
153
|
-
private
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
private
|
|
90
|
+
private addEventListeners;
|
|
91
|
+
private removeEventListeners;
|
|
92
|
+
private startMouseRotation;
|
|
93
|
+
private startTouchRotation;
|
|
94
|
+
private rotate;
|
|
95
|
+
private rotateFirstPersonMode;
|
|
96
|
+
private startTouchPinch;
|
|
97
|
+
private startMousePan;
|
|
98
|
+
private pan;
|
|
99
|
+
private panLeft;
|
|
100
|
+
private panUp;
|
|
101
|
+
private dolly;
|
|
102
|
+
private dollyOrthographicCamera;
|
|
103
|
+
private dollyPerspectiveCamera;
|
|
104
|
+
private dollyWithWheelScroll;
|
|
105
|
+
private calculateNewRadiusAndTargetOffsetLerp;
|
|
106
|
+
private calculateNewRadiusAndTargetOffsetScrollTarget;
|
|
161
107
|
private handleRotationFromKeyboard;
|
|
162
108
|
private handleDollyFromKeyboard;
|
|
163
109
|
private handlePanFromKeyboard;
|
|
164
|
-
private
|
|
165
|
-
private readonly rotateSpherical;
|
|
166
|
-
private readonly rotateFirstPersonMode;
|
|
167
|
-
private readonly pan;
|
|
168
|
-
private readonly dollyOrthographicCamera;
|
|
169
|
-
private readonly calculateNewRadiusAndTargetOffsetLerp;
|
|
170
|
-
private readonly clampedMap;
|
|
171
|
-
private readonly calculateNewRadiusAndTargetOffsetScrollTarget;
|
|
172
|
-
private readonly dollyWithWheelScroll;
|
|
173
|
-
private readonly dollyPerspectiveCamera;
|
|
174
|
-
private readonly dolly;
|
|
175
|
-
private readonly getDollyDeltaDistance;
|
|
176
|
-
private readonly panLeft;
|
|
177
|
-
private readonly panUp;
|
|
178
|
-
private isIdentityQuaternion;
|
|
179
|
-
private addEventListeners;
|
|
180
|
-
private removeEventListeners;
|
|
110
|
+
private handleKeyboard;
|
|
181
111
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Exposed options for Combo Controls
|
|
6
|
+
*/
|
|
7
|
+
export type ComboControlsOptions = {
|
|
8
|
+
enableDamping: boolean;
|
|
9
|
+
dampingFactor: number;
|
|
10
|
+
dynamicTarget: boolean;
|
|
11
|
+
minDistance: number;
|
|
12
|
+
minZoomDistance: number;
|
|
13
|
+
dollyFactor: number;
|
|
14
|
+
/**
|
|
15
|
+
* Radians
|
|
16
|
+
*/
|
|
17
|
+
minPolarAngle: number;
|
|
18
|
+
/**
|
|
19
|
+
* Radians
|
|
20
|
+
*/
|
|
21
|
+
maxPolarAngle: number;
|
|
22
|
+
/**
|
|
23
|
+
* Radians
|
|
24
|
+
*/
|
|
25
|
+
minAzimuthAngle: number;
|
|
26
|
+
/**
|
|
27
|
+
* Radians
|
|
28
|
+
*/
|
|
29
|
+
maxAzimuthAngle: number;
|
|
30
|
+
panDollyMinDistanceFactor: number;
|
|
31
|
+
firstPersonRotationFactor: number;
|
|
32
|
+
/**
|
|
33
|
+
* Radians per pixel
|
|
34
|
+
*/
|
|
35
|
+
pointerRotationSpeedAzimuth: number;
|
|
36
|
+
/**
|
|
37
|
+
* Radians per pixel
|
|
38
|
+
*/
|
|
39
|
+
pointerRotationSpeedPolar: number;
|
|
40
|
+
enableKeyboardNavigation: boolean;
|
|
41
|
+
keyboardRotationSpeedAzimuth: number;
|
|
42
|
+
keyboardRotationSpeedPolar: number;
|
|
43
|
+
mouseFirstPersonRotationSpeed: number;
|
|
44
|
+
keyboardDollySpeed: number;
|
|
45
|
+
keyboardPanSpeed: number;
|
|
46
|
+
/**
|
|
47
|
+
* How much quicker keyboard navigation will be with 'shift' pressed
|
|
48
|
+
*/
|
|
49
|
+
keyboardSpeedFactor: number;
|
|
50
|
+
pinchEpsilon: number;
|
|
51
|
+
pinchPanSpeed: number;
|
|
52
|
+
EPSILON: number;
|
|
53
|
+
minZoom: number;
|
|
54
|
+
maxZoom: number;
|
|
55
|
+
orthographicCameraDollyFactor: number;
|
|
56
|
+
lookAtViewTarget: boolean;
|
|
57
|
+
useScrollTarget: boolean;
|
|
58
|
+
zoomToCursor: boolean;
|
|
59
|
+
minDeltaRatio: number;
|
|
60
|
+
maxDeltaRatio: number;
|
|
61
|
+
minDeltaDownscaleCoefficient: number;
|
|
62
|
+
maxDeltaDownscaleCoefficient: number;
|
|
63
|
+
};
|
|
64
|
+
export declare function CreateDefaultControlsOptions(): Readonly<Required<ComboControlsOptions>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { ComboControlsOptions } from './
|
|
5
|
+
import { ComboControlsOptions } from './ComboControlsOptions';
|
|
6
6
|
import { CameraControlsOptions, CameraState, CameraManagerEventType, CameraEventDelegate } from './types';
|
|
7
7
|
import { CameraManager } from './CameraManager';
|
|
8
8
|
/**
|
|
@@ -18,12 +18,13 @@ export declare class DefaultCameraManager implements CameraManager {
|
|
|
18
18
|
private readonly _domElement;
|
|
19
19
|
private readonly _inputHandler;
|
|
20
20
|
private readonly _raycaster;
|
|
21
|
-
private
|
|
21
|
+
private _isDisposed;
|
|
22
22
|
private _nearAndFarNeedsUpdate;
|
|
23
|
-
private
|
|
23
|
+
private _isEnabled;
|
|
24
24
|
private readonly _modelRaycastCallback;
|
|
25
25
|
private _onClick;
|
|
26
26
|
private _onWheel;
|
|
27
|
+
private _onDoubleClick;
|
|
27
28
|
private static readonly AnimationDuration;
|
|
28
29
|
private static readonly MinAnimationDuration;
|
|
29
30
|
private static readonly MaxAnimationDuration;
|
|
@@ -126,11 +127,7 @@ export declare class DefaultCameraManager implements CameraManager {
|
|
|
126
127
|
* Method for setting up camera controls listeners and values inside current controls class.
|
|
127
128
|
*/
|
|
128
129
|
private setupControls;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
* @param pixelX
|
|
132
|
-
* @param pixelY
|
|
133
|
-
*/
|
|
134
|
-
private convertPixelCoordinatesToNormalized;
|
|
130
|
+
private readonly onClick;
|
|
131
|
+
private readonly onDoubleClick;
|
|
135
132
|
private calculateDefaultDuration;
|
|
136
133
|
}
|
|
@@ -24,6 +24,14 @@ export type CameraControlsOptions = {
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
changeCameraTargetOnClick?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Enables or disables change of camera position on mouse doubke click. New target is then set to the point of the model under current cursor
|
|
29
|
+
* position and the a camera position is set half way to this point
|
|
30
|
+
*
|
|
31
|
+
* Default is false.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
changeCameraPositionOnDoubleClick?: boolean;
|
|
27
35
|
};
|
|
28
36
|
export type ControlsState = {
|
|
29
37
|
position: THREE.Vector3;
|
|
@@ -72,6 +80,10 @@ export type CameraManagerCallbackData = {
|
|
|
72
80
|
* Bounding box for all models on the scene
|
|
73
81
|
*/
|
|
74
82
|
modelsBoundingBox: THREE.Box3;
|
|
83
|
+
/**
|
|
84
|
+
* Bounding box for the object (node in a model) that was picked
|
|
85
|
+
*/
|
|
86
|
+
pickedBoundingBox: THREE.Box3 | undefined;
|
|
75
87
|
};
|
|
76
88
|
/**
|
|
77
89
|
* List of supported event types (adapted from https://stackoverflow.com/questions/44480644/string-union-to-string-array)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a fingerprint based on the current browser. This is can be used to
|
|
3
|
+
* distinguish between different users. However, it is not 100% reliable,
|
|
4
|
+
* and can produce duplicates for distinct users.
|
|
5
|
+
*
|
|
6
|
+
* See https://broprintjs.netlify.app/
|
|
7
|
+
*/
|
|
8
|
+
export declare function getUserFingerprint(): Promise<string>;
|
|
@@ -6,13 +6,14 @@ import * as THREE from 'three';
|
|
|
6
6
|
import { TrackedEvents, EventProps } from './types';
|
|
7
7
|
export declare class MetricsLogger {
|
|
8
8
|
private readonly _sessionProps;
|
|
9
|
+
private readonly _initPromise;
|
|
9
10
|
private static readonly TrackCameraNavigationThrottleDelay;
|
|
10
11
|
private static readonly TrackCadNodeTransformOverriddenThrottleDelay;
|
|
11
12
|
static globalMetricsLogger: MetricsLogger;
|
|
12
13
|
private constructor();
|
|
13
14
|
static init(logMetrics: boolean, project: string, applicationId: string, eventProps: EventProps): void;
|
|
14
15
|
private innerTrackEvent;
|
|
15
|
-
static trackEvent(eventName: TrackedEvents, eventProps: EventProps): void
|
|
16
|
+
static trackEvent(eventName: TrackedEvents, eventProps: EventProps): Promise<void>;
|
|
16
17
|
static trackCreateTool(toolName: string): void;
|
|
17
18
|
static trackLoadModel(eventProps: EventProps, modelIdentifier: any, modelVersion: number): void;
|
|
18
19
|
static trackCadModelStyled(nodeCollectionClassToken: string, appearance: any): void;
|
|
@@ -33,7 +33,7 @@ export { disposeAttributeArrayOnUpload } from './src/disposeAttributeArrayOnUplo
|
|
|
33
33
|
export { incrementOrInsertIndex, decrementOrDeleteIndex } from './src/counterMap';
|
|
34
34
|
export { calculateVolumeOfMesh } from './src/calculateVolumeOfMesh';
|
|
35
35
|
export { getApproximateProjectedBounds, getScreenArea } from './src/projectedBounds';
|
|
36
|
-
export { worldToNormalizedViewportCoordinates, worldToViewportCoordinates,
|
|
36
|
+
export { worldToNormalizedViewportCoordinates, worldToViewportCoordinates, getNormalizedPixelCoordinatesBySize, getNormalizedPixelCoordinates } from './src/worldToViewport';
|
|
37
37
|
export { Line2 } from './src/three/lines/Line2';
|
|
38
38
|
export { LineGeometry } from './src/three/lines/LineGeometry';
|
|
39
39
|
export { LineMaterial } from './src/three/lines/LineMaterial';
|
|
@@ -31,4 +31,5 @@ export declare function worldToViewportCoordinates(canvas: HTMLCanvasElement, ca
|
|
|
31
31
|
/**
|
|
32
32
|
* Converts a pixel coordinate to normalized device coordinate (in range [-1, 1])
|
|
33
33
|
*/
|
|
34
|
-
export declare function
|
|
34
|
+
export declare function getNormalizedPixelCoordinatesBySize(pixelX: number, pixelY: number, width: number, height: number): THREE.Vector2;
|
|
35
|
+
export declare function getNormalizedPixelCoordinates(domElement: HTMLElement, pixelX: number, pixelY: number): THREE.Vector2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.1",
|
|
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": {
|
|
@@ -62,9 +62,10 @@
|
|
|
62
62
|
"ws:lint": "cd $INIT_CWD && eslint . --ext .ts,.js --max-warnings 0 --cache"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
+
"@rajesh896/broprint.js": "^2.1.1",
|
|
65
66
|
"@tweenjs/tween.js": "19.0.0",
|
|
66
67
|
"assert": "2.1.0",
|
|
67
|
-
"async-mutex": "0.4.
|
|
68
|
+
"async-mutex": "0.4.1",
|
|
68
69
|
"glslify": "7.1.1",
|
|
69
70
|
"glslify-import": "3.1.0",
|
|
70
71
|
"html2canvas": "^1.4.1",
|
|
@@ -80,51 +81,51 @@
|
|
|
80
81
|
"devDependencies": {
|
|
81
82
|
"@azure/msal-browser": "2.38.3",
|
|
82
83
|
"@cognite/sdk": "8.3.0",
|
|
83
|
-
"@microsoft/api-extractor": "7.
|
|
84
|
+
"@microsoft/api-extractor": "7.39.4",
|
|
84
85
|
"@types/dat.gui": "0.7.12",
|
|
85
86
|
"@types/gl": "^6.0.2",
|
|
86
87
|
"@types/glob": "8.1.0",
|
|
87
|
-
"@types/jest": "29.5.
|
|
88
|
+
"@types/jest": "29.5.12",
|
|
88
89
|
"@types/jest-environment-puppeteer": "5.0.6",
|
|
89
|
-
"@types/jest-image-snapshot": "6.
|
|
90
|
+
"@types/jest-image-snapshot": "6.4.0",
|
|
90
91
|
"@types/jsdom": "21.1.6",
|
|
91
92
|
"@types/lodash": "4.14.202",
|
|
92
|
-
"@types/mixpanel-browser": "2.
|
|
93
|
-
"@types/node": "18.19.
|
|
93
|
+
"@types/mixpanel-browser": "2.48.1",
|
|
94
|
+
"@types/node": "18.19.14",
|
|
94
95
|
"@types/random-seed": "0.3.5",
|
|
95
96
|
"@types/skmeans": "0.11.7",
|
|
96
97
|
"@types/stats": "0.16.30",
|
|
97
98
|
"@types/three": "0.158.2",
|
|
98
99
|
"@types/tween.js": "18.5.1",
|
|
99
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
100
|
-
"@typescript-eslint/parser": "6.
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "6.19.1",
|
|
101
|
+
"@typescript-eslint/parser": "6.19.1",
|
|
101
102
|
"concurrently": "8.2.2",
|
|
102
103
|
"cross-env": "7.0.3",
|
|
103
104
|
"dat.gui": "0.7.9",
|
|
104
|
-
"eslint": "8.
|
|
105
|
-
"eslint-config-prettier": "9.
|
|
105
|
+
"eslint": "8.56.0",
|
|
106
|
+
"eslint-config-prettier": "9.1.0",
|
|
106
107
|
"eslint-plugin-header": "3.1.1",
|
|
107
|
-
"eslint-plugin-jsdoc": "46.
|
|
108
|
+
"eslint-plugin-jsdoc": "46.10.1",
|
|
108
109
|
"eslint-plugin-lodash": "7.4.0",
|
|
109
|
-
"eslint-plugin-prettier": "5.
|
|
110
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
110
111
|
"eslint-plugin-unused-imports": "3.0.0",
|
|
111
112
|
"file-loader": "6.2.0",
|
|
112
113
|
"gl": "6.0.2",
|
|
113
114
|
"glob": "10.3.10",
|
|
114
115
|
"glslify-loader": "2.0.0",
|
|
115
|
-
"html-webpack-plugin": "5.
|
|
116
|
+
"html-webpack-plugin": "5.6.0",
|
|
116
117
|
"jest": "29.7.0",
|
|
117
118
|
"jest-canvas-mock": "2.5.2",
|
|
118
119
|
"jest-environment-jsdom": "29.7.0",
|
|
119
120
|
"jest-extended": "4.0.2",
|
|
120
|
-
"jest-image-snapshot": "6.
|
|
121
|
-
"jest-puppeteer": "9.0.
|
|
122
|
-
"jsdom": "
|
|
121
|
+
"jest-image-snapshot": "6.4.0",
|
|
122
|
+
"jest-puppeteer": "9.0.2",
|
|
123
|
+
"jsdom": "23.2.0",
|
|
123
124
|
"moq.ts": "10.0.8",
|
|
124
|
-
"nock": "13.
|
|
125
|
-
"prettier": "3.
|
|
125
|
+
"nock": "13.5.1",
|
|
126
|
+
"prettier": "3.2.4",
|
|
126
127
|
"process": "0.11.10",
|
|
127
|
-
"puppeteer": "21.
|
|
128
|
+
"puppeteer": "21.11.0",
|
|
128
129
|
"random-seed": "0.3.0",
|
|
129
130
|
"raw-loader": "4.0.2",
|
|
130
131
|
"remove-files-webpack-plugin": "1.5.0",
|
|
@@ -132,16 +133,16 @@
|
|
|
132
133
|
"shx": "0.3.4",
|
|
133
134
|
"stats.js": "0.17.0",
|
|
134
135
|
"three": "0.158.0",
|
|
135
|
-
"ts-jest": "29.1.
|
|
136
|
+
"ts-jest": "29.1.2",
|
|
136
137
|
"ts-loader": "9.5.1",
|
|
137
138
|
"tsc-alias": "1.8.8",
|
|
138
|
-
"typescript": "5.3.
|
|
139
|
+
"typescript": "5.3.3",
|
|
139
140
|
"wasm-pack": "0.12.1",
|
|
140
141
|
"webpack": "5.89.0",
|
|
141
142
|
"webpack-cli": "5.1.4",
|
|
142
143
|
"webpack-dev-server": "4.15.1",
|
|
143
144
|
"webpack-node-externals": "3.0.0",
|
|
144
|
-
"whatwg-fetch": "3.6.
|
|
145
|
+
"whatwg-fetch": "3.6.20",
|
|
145
146
|
"workerize-loader": "2.0.2"
|
|
146
147
|
},
|
|
147
148
|
"peerDependencies": {
|