@cognite/reveal 4.10.7 → 4.10.8
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/README.md +1 -1
- package/dist/index.js +44 -40
- package/dist/index.js.map +1 -1
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +2 -6
- package/dist/packages/camera-manager/index.d.ts +1 -0
- package/dist/packages/camera-manager/src/Flexible/FlexibleCameraManager.d.ts +2 -2
- package/dist/packages/camera-manager/src/Flexible/FlexibleControls.d.ts +11 -3
- package/dist/packages/camera-manager/src/Flexible/FlexibleControlsOptions.d.ts +4 -0
- package/dist/packages/camera-manager/src/Flexible/IFlexibleCameraManager.d.ts +1 -0
- package/dist/packages/camera-manager/src/Flexible/moveCamera.d.ts +1 -1
- package/dist/packages/camera-manager/src/utils/getWheelDelta.d.ts +4 -0
- package/dist/packages/utilities/src/customObject/CustomObjectIntersection.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2022 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import * as THREE from 'three';
|
|
5
1
|
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
6
2
|
import { Image360Collection, Image360Entity, Image360, IconsOptions, Image360RevisionEntity, Image360AnnotationIntersection, Image360AnnotationFilterOptions } from '../../../360-images';
|
|
7
3
|
import { Image360DataModelIdentifier } from '../../../data-providers';
|
|
@@ -17,7 +13,7 @@ export declare class Image360ApiHelper {
|
|
|
17
13
|
private readonly _eventHandlers;
|
|
18
14
|
private readonly _debouncePreLoad;
|
|
19
15
|
private readonly _activeCameraManager;
|
|
20
|
-
private readonly
|
|
16
|
+
private readonly _stationaryCameraManager;
|
|
21
17
|
private readonly _onBeforeSceneRenderedEvent;
|
|
22
18
|
private _cachedCameraManager;
|
|
23
19
|
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, iconsOptions?: IconsOptions);
|
|
@@ -32,7 +28,7 @@ export declare class Image360ApiHelper {
|
|
|
32
28
|
private transition;
|
|
33
29
|
private tweenVisualizationAlpha;
|
|
34
30
|
private tweenVisualizationZoom;
|
|
35
|
-
private
|
|
31
|
+
private setStationaryCameraManager;
|
|
36
32
|
exit360Image(): void;
|
|
37
33
|
dispose(): void;
|
|
38
34
|
private findRevisionIdToEnter;
|
|
@@ -17,4 +17,5 @@ export { FlexibleControlsOptions } from './src/Flexible/FlexibleControlsOptions'
|
|
|
17
17
|
export { FlexibleWheelZoomType } from './src/Flexible/FlexibleWheelZoomType';
|
|
18
18
|
export { FlexibleControlsType } from './src/Flexible/FlexibleControlsType';
|
|
19
19
|
export { FlexibleMouseActionType } from './src/Flexible/FlexibleMouseActionType';
|
|
20
|
+
export { asFlexibleCameraManager } from './src/Flexible/IFlexibleCameraManager';
|
|
20
21
|
export * from './src/types';
|
|
@@ -19,8 +19,6 @@ export declare class FlexibleCameraManager implements IFlexibleCameraManager {
|
|
|
19
19
|
private readonly _triggers;
|
|
20
20
|
private readonly _stopEventTrigger;
|
|
21
21
|
private readonly _controls;
|
|
22
|
-
private readonly _camera;
|
|
23
|
-
private readonly _domElement;
|
|
24
22
|
private readonly _inputHandler;
|
|
25
23
|
private readonly _markers?;
|
|
26
24
|
private readonly _currentBoundingBox;
|
|
@@ -65,6 +63,7 @@ export declare class FlexibleCameraManager implements IFlexibleCameraManager {
|
|
|
65
63
|
private getPosition;
|
|
66
64
|
private getTarget;
|
|
67
65
|
setPositionAndTarget(position: Vector3, target: Vector3): void;
|
|
66
|
+
setPosition(position: Vector3): void;
|
|
68
67
|
private readonly getPickedPointByPixelCoordinates;
|
|
69
68
|
private getTargetByBoundingBox;
|
|
70
69
|
private addEventListeners;
|
|
@@ -79,5 +78,6 @@ export declare class FlexibleCameraManager implements IFlexibleCameraManager {
|
|
|
79
78
|
private setTargetAndCameraPosition;
|
|
80
79
|
private updateCameraNearAndFar;
|
|
81
80
|
private updateControlsSensitivity;
|
|
81
|
+
static as(manager: CameraManager): FlexibleCameraManager | undefined;
|
|
82
82
|
}
|
|
83
83
|
export {};
|
|
@@ -14,6 +14,7 @@ import { GetPickedPointByPixelCoordinates } from './GetPickedPointByPixelCoordin
|
|
|
14
14
|
export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEvent> {
|
|
15
15
|
private _isEnabled;
|
|
16
16
|
private _isInitialized;
|
|
17
|
+
private _isStationary;
|
|
17
18
|
temporarlyDisableKeyboard: boolean;
|
|
18
19
|
private readonly _options;
|
|
19
20
|
private readonly _domElement;
|
|
@@ -31,10 +32,11 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
31
32
|
private readonly _reusableVector3s;
|
|
32
33
|
private readonly _rotationHelper;
|
|
33
34
|
private _mouseDragInfo;
|
|
34
|
-
constructor(camera: PerspectiveCamera |
|
|
35
|
+
constructor(camera: PerspectiveCamera | undefined, domElement: HTMLElement, options: FlexibleControlsOptions);
|
|
35
36
|
dispose(): void;
|
|
36
37
|
get options(): FlexibleControlsOptions;
|
|
37
38
|
get camera(): PerspectiveCamera | OrthographicCamera;
|
|
39
|
+
get domElement(): HTMLElement;
|
|
38
40
|
get target(): DampedVector3;
|
|
39
41
|
get cameraVector(): DampedSpherical;
|
|
40
42
|
get cameraPosition(): DampedVector3;
|
|
@@ -43,6 +45,9 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
43
45
|
get isInitialized(): boolean;
|
|
44
46
|
set isInitialized(value: boolean);
|
|
45
47
|
get controlsType(): FlexibleControlsType;
|
|
48
|
+
get isStationary(): boolean;
|
|
49
|
+
set isStationary(value: boolean);
|
|
50
|
+
get fov(): number;
|
|
46
51
|
set getPickedPointByPixelCoordinates(getPickedPointByPixelCoordinates: GetPickedPointByPixelCoordinates | undefined);
|
|
47
52
|
get getPickedPointByPixelCoordinates(): GetPickedPointByPixelCoordinates | undefined;
|
|
48
53
|
getTarget(): Vector3;
|
|
@@ -56,7 +61,9 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
56
61
|
getNormalizedPixelCoordinates(event: PointerEvent): Vector2;
|
|
57
62
|
setScrollCursor(value: Vector3 | undefined): void;
|
|
58
63
|
setTempTarget(value: Vector3 | undefined): void;
|
|
64
|
+
setFov(value: number, triggerCameraChangeEvent?: boolean): boolean;
|
|
59
65
|
setPositionAndTarget(position: Vector3, target: Vector3): void;
|
|
66
|
+
setPosition(position: Vector3): void;
|
|
60
67
|
setPositionAndDirection(position: Vector3, direction: Vector3): void;
|
|
61
68
|
setPositionAndRotation(position: Vector3, rotation: Quaternion): void;
|
|
62
69
|
setControlsType(controlsType: FlexibleControlsType): boolean;
|
|
@@ -69,11 +76,11 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
69
76
|
triggerControlsTypeChangeEvent(): void;
|
|
70
77
|
rotateCameraTo(startDirection: Spherical, endDirection: Spherical, factor: number): void;
|
|
71
78
|
private readonly onPointerDown;
|
|
72
|
-
private
|
|
79
|
+
private onMouseDown;
|
|
73
80
|
private readonly onPointerMove;
|
|
74
81
|
private readonly onPointerUp;
|
|
75
82
|
private readonly onMouseWheel;
|
|
76
|
-
private
|
|
83
|
+
private onTouchStart;
|
|
77
84
|
private readonly onFocusChanged;
|
|
78
85
|
private readonly onContextMenu;
|
|
79
86
|
addEventListeners(): void;
|
|
@@ -95,6 +102,7 @@ export declare class FlexibleControls extends EventDispatcher<FlexibleControlsEv
|
|
|
95
102
|
private getTranslationByDirection;
|
|
96
103
|
private getTranslationByScrollCursor;
|
|
97
104
|
private getStep;
|
|
105
|
+
private zoomCameraByFov;
|
|
98
106
|
private handleKeyboard;
|
|
99
107
|
private handleRotationFromKeyboard;
|
|
100
108
|
private handleMoveFromKeyboard;
|
|
@@ -46,12 +46,16 @@ export declare class FlexibleControlsOptions {
|
|
|
46
46
|
pinchEpsilon: number;
|
|
47
47
|
pinchPanSpeed: number;
|
|
48
48
|
orthographicCameraDollyFactor: number;
|
|
49
|
+
minimumFov: number;
|
|
50
|
+
maximumFov: number;
|
|
51
|
+
defaultFov: number;
|
|
49
52
|
showTarget: boolean;
|
|
50
53
|
relativeMarkerSize: number;
|
|
51
54
|
outerMarkerColor: string;
|
|
52
55
|
innerMarkerColor: string;
|
|
53
56
|
get realMouseWheelAction(): FlexibleWheelZoomType;
|
|
54
57
|
get shouldPick(): boolean;
|
|
58
|
+
getLegalFov(fov: number): number;
|
|
55
59
|
getLegalAzimuthAngle(azimuthAngle: number): number;
|
|
56
60
|
getLegalPolarAngle(polarAngle: number): number;
|
|
57
61
|
getLegalSensitivity(controlsSensitivity: number): number;
|
|
@@ -42,3 +42,4 @@ export interface IFlexibleCameraManager extends CameraManager {
|
|
|
42
42
|
*/
|
|
43
43
|
removeControlsTypeChangeListener(callback: FlexibleControlsTypeChangeDelegate): void;
|
|
44
44
|
}
|
|
45
|
+
export declare function asFlexibleCameraManager(manager: CameraManager): IFlexibleCameraManager | undefined;
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Vector3 } from 'three';
|
|
5
5
|
import { FlexibleCameraManager } from './FlexibleCameraManager';
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function moveCameraPositionAndTargetTo(manager: FlexibleCameraManager, position: Vector3, target: Vector3, duration?: number): void;
|
|
7
7
|
export declare function moveCameraTargetTo(manager: FlexibleCameraManager, target: Vector3, duration?: number): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.8",
|
|
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": {
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"ts-jest": "29.1.2",
|
|
137
137
|
"ts-loader": "9.5.1",
|
|
138
138
|
"tsc-alias": "1.8.8",
|
|
139
|
-
"typescript": "5.
|
|
139
|
+
"typescript": "5.4.2",
|
|
140
140
|
"wasm-pack": "0.12.1",
|
|
141
141
|
"webpack": "5.90.3",
|
|
142
142
|
"webpack-cli": "5.1.4",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"files": [
|
|
158
158
|
"dist"
|
|
159
159
|
],
|
|
160
|
-
"packageManager": "yarn@4.1.
|
|
160
|
+
"packageManager": "yarn@4.1.1"
|
|
161
161
|
}
|