@cognite/reveal 4.10.0 → 4.10.2
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 +211 -207
- package/dist/index.js.map +1 -1
- package/dist/packages/camera-manager/src/Flexible/FlexibleCameraManager.d.ts +1 -1
- package/dist/packages/camera-manager/src/Flexible/FlexibleControls.d.ts +21 -8
- package/dist/packages/camera-manager/src/Flexible/FlexibleControlsTranslator.d.ts +19 -0
- package/dist/packages/camera-manager/src/Flexible/GetPickedPointByPixelCoordinates.d.ts +5 -0
- package/dist/packages/utilities/index.d.ts +1 -1
- package/dist/packages/utilities/src/events/clickOrTouchEventOffset.d.ts +10 -2
- package/dist/packages/utilities/src/events/index.d.ts +1 -1
- package/package.json +9 -9
|
@@ -63,7 +63,7 @@ export declare class FlexibleCameraManager implements IFlexibleCameraManager {
|
|
|
63
63
|
getBoundingBoxDiagonal(): number;
|
|
64
64
|
getHorizontalDiagonal(): number;
|
|
65
65
|
setPositionAndTarget(position: Vector3, target: Vector3): void;
|
|
66
|
-
private
|
|
66
|
+
private readonly getPickedPointByPixelCoordinates;
|
|
67
67
|
private getTargetByBoundingBox;
|
|
68
68
|
private addEventListeners;
|
|
69
69
|
private removeEventListeners;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2024 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { EventDispatcher, OrthographicCamera, PerspectiveCamera, Quaternion, Vector3 } from 'three';
|
|
4
|
+
import { EventDispatcher, OrthographicCamera, PerspectiveCamera, Quaternion, Vector2, Vector3 } from 'three';
|
|
5
5
|
import { FlexibleControlsType } from './FlexibleControlsType';
|
|
6
6
|
import { FlexibleControlsOptions } from './FlexibleControlsOptions';
|
|
7
|
+
import { DampedVector3 } from './DampedVector3';
|
|
8
|
+
import { DampedSpherical } from './DampedSpherical';
|
|
7
9
|
import { FlexibleControlsEvent } from './FlexibleControlsEvent';
|
|
10
|
+
import { GetPickedPointByPixelCoordinates } from './GetPickedPointByPixelCoordinates';
|
|
8
11
|
/**
|
|
9
12
|
* @beta
|
|
10
13
|
*/
|
|
11
14
|
export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEvent> {
|
|
12
15
|
private _isEnabled;
|
|
16
|
+
private _isInitialized;
|
|
13
17
|
temporarlyDisableKeyboard: boolean;
|
|
14
18
|
private readonly _options;
|
|
15
19
|
private readonly _domElement;
|
|
@@ -22,20 +26,30 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
22
26
|
private _tempTarget;
|
|
23
27
|
private readonly _keyboard;
|
|
24
28
|
private readonly _pointEventCache;
|
|
29
|
+
private _getPickedPointByPixelCoordinates;
|
|
25
30
|
private readonly _reusableVector3s;
|
|
26
31
|
constructor(camera: PerspectiveCamera | OrthographicCamera, domElement: HTMLElement, options: FlexibleControlsOptions);
|
|
27
32
|
dispose(): void;
|
|
28
33
|
get options(): FlexibleControlsOptions;
|
|
34
|
+
get camera(): PerspectiveCamera | OrthographicCamera;
|
|
35
|
+
get cameraVector(): DampedSpherical;
|
|
36
|
+
get cameraPosition(): DampedVector3;
|
|
29
37
|
get isEnabled(): boolean;
|
|
30
|
-
set isEnabled(
|
|
38
|
+
set isEnabled(value: boolean);
|
|
39
|
+
get isInitialized(): boolean;
|
|
40
|
+
set isInitialized(value: boolean);
|
|
31
41
|
get controlsType(): FlexibleControlsType;
|
|
42
|
+
set getPickedPointByPixelCoordinates(getPickedPointByPixelCoordinates: GetPickedPointByPixelCoordinates | undefined);
|
|
43
|
+
get getPickedPointByPixelCoordinates(): GetPickedPointByPixelCoordinates | undefined;
|
|
32
44
|
getTarget(): Vector3;
|
|
33
45
|
setTarget(value: Vector3): void;
|
|
34
|
-
getLookAt
|
|
46
|
+
private getLookAt;
|
|
35
47
|
getState(): {
|
|
36
48
|
target: Vector3;
|
|
37
49
|
position: Vector3;
|
|
38
50
|
};
|
|
51
|
+
private getMousePosition;
|
|
52
|
+
getNormalizedPixelCoordinates(event: PointerEvent): Vector2;
|
|
39
53
|
setScrollCursor(value: Vector3 | undefined): void;
|
|
40
54
|
setTempTarget(value: Vector3 | undefined): void;
|
|
41
55
|
setPositionAndTarget(position: Vector3, target: Vector3): void;
|
|
@@ -51,6 +65,7 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
51
65
|
triggerControlsTypeChangeEvent(): void;
|
|
52
66
|
private readonly onPointerDown;
|
|
53
67
|
private readonly onMouseDown;
|
|
68
|
+
private startMouse;
|
|
54
69
|
private readonly onPointerUp;
|
|
55
70
|
private readonly onMouseWheel;
|
|
56
71
|
private readonly onTouchStart;
|
|
@@ -58,16 +73,14 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
58
73
|
private readonly onContextMenu;
|
|
59
74
|
addEventListeners(): void;
|
|
60
75
|
private removeEventListeners;
|
|
61
|
-
private startMouseRotation;
|
|
62
76
|
private startTouchRotation;
|
|
63
77
|
private rotate;
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
getAzimuthCompensationFactor(): number;
|
|
79
|
+
rotateByAngles(deltaAzimuth: number, deltaPolar: number): void;
|
|
66
80
|
private rawRotateByAngles;
|
|
67
81
|
private startTouchPinch;
|
|
68
|
-
private startMousePan;
|
|
69
82
|
private pan;
|
|
70
|
-
|
|
83
|
+
translate(delta: Vector3): void;
|
|
71
84
|
private dollyOrthographicCamera;
|
|
72
85
|
private dollyWithWheelScroll;
|
|
73
86
|
private getTranslation;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { FlexibleControls } from './FlexibleControls';
|
|
5
|
+
/**
|
|
6
|
+
* @beta
|
|
7
|
+
* This class handles the translation of the camera.
|
|
8
|
+
* It tries to translate the camera so the same (x,y, z) point is below the mouse
|
|
9
|
+
*/
|
|
10
|
+
export declare class FlexibleControlsTranslator {
|
|
11
|
+
private readonly _controls;
|
|
12
|
+
private readonly _prevPickedPoint;
|
|
13
|
+
private readonly _plane;
|
|
14
|
+
private readonly _raycaster;
|
|
15
|
+
private _camera;
|
|
16
|
+
constructor(controls: FlexibleControls);
|
|
17
|
+
initialize(event: PointerEvent): Promise<boolean>;
|
|
18
|
+
translate(event: PointerEvent): boolean;
|
|
19
|
+
}
|
|
@@ -5,7 +5,7 @@ export { traverseDepthFirst } from './src/objectTraversal';
|
|
|
5
5
|
export { transformCameraConfiguration } from './src/transformCameraConfiguration';
|
|
6
6
|
export { RandomColors } from './src/RandomColors';
|
|
7
7
|
export { CameraConfiguration } from './src/CameraConfiguration';
|
|
8
|
-
export { EventTrigger, clickOrTouchEventOffset, InputHandler, disposeOfAllEventListeners } from './src/events';
|
|
8
|
+
export { EventTrigger, clickOrTouchEventOffset, getClickOrTouchEventPoint, InputHandler, disposeOfAllEventListeners } from './src/events';
|
|
9
9
|
export { DisposedDelegate, BeforeSceneRenderedDelegate, SceneRenderedDelegate, PointerEventDelegate, PointerEventData } from './src/events/types';
|
|
10
10
|
export { assertNever } from './src/assertNever';
|
|
11
11
|
export { NumericRange } from './src/NumericRange';
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import { Vector2 } from 'three';
|
|
4
5
|
/**
|
|
5
6
|
* Determines clicked or touched coordinate as offset
|
|
6
|
-
* @param
|
|
7
|
+
* @param event An PointerEvent or WheelEvent.
|
|
7
8
|
* @param target HTML element to find coordinates relative to.
|
|
8
9
|
* @returns A struct containing coordinates relative to the HTML element provided.
|
|
9
10
|
*/
|
|
10
|
-
export declare function clickOrTouchEventOffset(
|
|
11
|
+
export declare function clickOrTouchEventOffset(event: PointerEvent | WheelEvent, target: HTMLElement): {
|
|
11
12
|
offsetX: number;
|
|
12
13
|
offsetY: number;
|
|
13
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Determines clicked or touched coordinate as offset
|
|
17
|
+
* @param event An PointerEvent or WheelEvent.
|
|
18
|
+
* @param target HTML element to find coordinates relative to.
|
|
19
|
+
* @returns A Vector2 containing coordinates relative to the HTML element provided.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getClickOrTouchEventPoint(event: PointerEvent | WheelEvent, target: HTMLElement): Vector2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
export { clickOrTouchEventOffset } from './clickOrTouchEventOffset';
|
|
4
|
+
export { clickOrTouchEventOffset, getClickOrTouchEventPoint } from './clickOrTouchEventOffset';
|
|
5
5
|
export { EventTrigger } from './EventTrigger';
|
|
6
6
|
export { InputHandler, disposeOfAllEventListeners } from './InputHandler';
|
|
7
7
|
export * from './types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.2",
|
|
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": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"html2canvas": "^1.4.1",
|
|
72
72
|
"lodash": "4.17.21",
|
|
73
73
|
"loglevel": "1.9.1",
|
|
74
|
-
"mixpanel-browser": "2.
|
|
74
|
+
"mixpanel-browser": "2.49.0",
|
|
75
75
|
"path-browserify": "1.0.1",
|
|
76
76
|
"random-seed": "0.3.0",
|
|
77
77
|
"rxjs": "7.8.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@azure/msal-browser": "2.38.3",
|
|
83
83
|
"@cognite/sdk": "8.3.0",
|
|
84
|
-
"@microsoft/api-extractor": "7.
|
|
84
|
+
"@microsoft/api-extractor": "7.40.1",
|
|
85
85
|
"@types/dat.gui": "0.7.12",
|
|
86
86
|
"@types/gl": "^6.0.2",
|
|
87
87
|
"@types/glob": "8.1.0",
|
|
@@ -90,15 +90,15 @@
|
|
|
90
90
|
"@types/jest-image-snapshot": "6.4.0",
|
|
91
91
|
"@types/jsdom": "21.1.6",
|
|
92
92
|
"@types/lodash": "4.14.202",
|
|
93
|
-
"@types/mixpanel-browser": "2.
|
|
94
|
-
"@types/node": "18.19.
|
|
93
|
+
"@types/mixpanel-browser": "2.49.0",
|
|
94
|
+
"@types/node": "18.19.15",
|
|
95
95
|
"@types/random-seed": "0.3.5",
|
|
96
96
|
"@types/skmeans": "0.11.7",
|
|
97
97
|
"@types/stats": "0.16.30",
|
|
98
98
|
"@types/three": "0.158.2",
|
|
99
99
|
"@types/tween.js": "18.5.1",
|
|
100
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
101
|
-
"@typescript-eslint/parser": "6.
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "6.21.0",
|
|
101
|
+
"@typescript-eslint/parser": "6.21.0",
|
|
102
102
|
"concurrently": "8.2.2",
|
|
103
103
|
"cross-env": "7.0.3",
|
|
104
104
|
"dat.gui": "0.7.9",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"eslint-plugin-jsdoc": "46.10.1",
|
|
109
109
|
"eslint-plugin-lodash": "7.4.0",
|
|
110
110
|
"eslint-plugin-prettier": "5.1.3",
|
|
111
|
-
"eslint-plugin-unused-imports": "3.
|
|
111
|
+
"eslint-plugin-unused-imports": "3.1.0",
|
|
112
112
|
"file-loader": "6.2.0",
|
|
113
113
|
"gl": "6.0.2",
|
|
114
114
|
"glob": "10.3.10",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"jsdom": "23.2.0",
|
|
124
124
|
"moq.ts": "10.0.8",
|
|
125
125
|
"nock": "13.5.1",
|
|
126
|
-
"prettier": "3.2.
|
|
126
|
+
"prettier": "3.2.5",
|
|
127
127
|
"process": "0.11.10",
|
|
128
128
|
"puppeteer": "21.11.0",
|
|
129
129
|
"random-seed": "0.3.0",
|