@cognite/reveal 4.7.1 → 4.9.0
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 +195 -171
- package/dist/index.js.map +1 -1
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +2 -2
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +7 -0
- 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/data-providers/index.d.ts +4 -1
- package/dist/packages/data-providers/src/DataModelsSdk.d.ts +11 -0
- package/dist/packages/data-providers/src/image-360-data-providers/{Cdf360ImageEventProvider.d.ts → Cdf360ImageProvider.d.ts} +6 -10
- package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/Cdf360CombinedDescriptorProvider.d.ts +14 -0
- package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/datamodels/Cdf360DataModelsDescriptorProvider.d.ts +23 -0
- package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/datamodels/get360CollectionQuery.d.ts +103 -0
- package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/events/Cdf360EventDescriptorProvider.d.ts +15 -0
- package/dist/packages/data-providers/src/types.d.ts +87 -1
- package/dist/packages/metrics/src/Fingerprint.d.ts +8 -0
- package/dist/packages/metrics/src/MetricsLogger.d.ts +2 -1
- package/dist/packages/pointclouds/src/potree-three-loader/tree/PointAttributes.d.ts +5 -5
- package/dist/packages/utilities/index.d.ts +1 -1
- package/dist/packages/utilities/src/worldToViewport.d.ts +2 -1
- package/package.json +22 -21
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
6
6
|
import { Image360Collection, Image360Entity, Image360, IconsOptions, Image360RevisionEntity, Image360AnnotationIntersection, Image360AnnotationFilterOptions } from '../../../360-images';
|
|
7
|
+
import { Image360DataModelIdentifier } from '../../../data-providers';
|
|
7
8
|
import { BeforeSceneRenderedDelegate, EventTrigger, InputHandler, SceneHandler } from '../../../utilities';
|
|
8
9
|
import { ProxyCameraManager } from '../../../camera-manager';
|
|
9
10
|
export declare class Image360ApiHelper {
|
|
@@ -22,8 +23,7 @@ export declare class Image360ApiHelper {
|
|
|
22
23
|
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, iconsOptions?: IconsOptions);
|
|
23
24
|
get needsRedraw(): boolean;
|
|
24
25
|
resetRedraw(): void;
|
|
25
|
-
|
|
26
|
-
add360ImageSet(eventFilter: Metadata, collectionTransform: THREE.Matrix4, preMultipliedRotation: boolean, annotationOptions?: Image360AnnotationFilterOptions): Promise<Image360Collection>;
|
|
26
|
+
add360ImageSet(collectionIdentifier: Metadata | Image360DataModelIdentifier, collectionTransform: THREE.Matrix4, preMultipliedRotation: boolean, annotationOptions?: Image360AnnotationFilterOptions): Promise<Image360Collection>;
|
|
27
27
|
getImageCollections(): Image360Collection[];
|
|
28
28
|
remove360Images(entities: Image360[]): Promise<void>;
|
|
29
29
|
remove360ImageCollection(collection: Image360Collection): void;
|
|
@@ -9,6 +9,7 @@ import { AddImage360Options, AddModelOptions, Cognite3DViewerOptions, Intersecti
|
|
|
9
9
|
import { CogniteModel } from '../types';
|
|
10
10
|
import { ViewerState } from '../../utilities/ViewStateHelper';
|
|
11
11
|
import { CameraManager, CameraChangeDelegate, CameraStopDelegate } from '../../../../camera-manager';
|
|
12
|
+
import { Image360DataModelIdentifier } from '../../../../data-providers';
|
|
12
13
|
import { SupportedModelTypes } from '../../../../model-base';
|
|
13
14
|
import { Image360Collection, Image360, Image360Revision, Image360AnnotationIntersection } from '../../../../360-images';
|
|
14
15
|
/**
|
|
@@ -273,6 +274,12 @@ export declare class Cognite3DViewer {
|
|
|
273
274
|
*/
|
|
274
275
|
addPointCloudModel(options: AddModelOptions): Promise<CognitePointCloudModel>;
|
|
275
276
|
private addPointCloudModelWithSequencer;
|
|
277
|
+
/**
|
|
278
|
+
* Adds a set of 360 images to the scene from the /datamodels API in Cognite Data Fusion.
|
|
279
|
+
* @param datasource The data data source which holds the references to the 360 image sets.
|
|
280
|
+
* @param dataModelIdentifier The search parameters to apply when querying Cognite Datamodels that contains the 360 images.
|
|
281
|
+
*/
|
|
282
|
+
add360ImageSet(datasource: 'datamodels', dataModelIdentifier: Image360DataModelIdentifier): Promise<Image360Collection>;
|
|
276
283
|
/**
|
|
277
284
|
* Adds a set of 360 images to the scene from the /events API in Cognite Data Fusion.
|
|
278
285
|
* @param datasource The CDF data source which holds the references to the 360 image sets.
|
|
@@ -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)
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
export { CdfModelDataProvider } from './src/model-data-providers/CdfModelDataProvider';
|
|
5
5
|
export { CdfModelIdentifier } from './src/model-identifiers/CdfModelIdentifier';
|
|
6
6
|
export { CdfModelMetadataProvider } from './src/metadata-providers/CdfModelMetadataProvider';
|
|
7
|
-
export {
|
|
7
|
+
export { Cdf360ImageProvider } from './src/image-360-data-providers/Cdf360ImageProvider';
|
|
8
|
+
export { Cdf360EventDescriptorProvider } from './src/image-360-data-providers/descriptor-providers/events/Cdf360EventDescriptorProvider';
|
|
9
|
+
export { Cdf360DataModelsDescriptorProvider, Image360DataModelIdentifier } from './src/image-360-data-providers/descriptor-providers/datamodels/Cdf360DataModelsDescriptorProvider';
|
|
10
|
+
export { Cdf360CombinedDescriptorProvider } from './src/image-360-data-providers/descriptor-providers/Cdf360CombinedDescriptorProvider';
|
|
8
11
|
export { LocalModelDataProvider } from './src/model-data-providers/LocalModelDataProvider';
|
|
9
12
|
export { LocalModelIdentifier } from './src/model-identifiers/LocalModelIdentifier';
|
|
10
13
|
export { LocalModelMetadataProvider } from './src/metadata-providers/LocalModelMetadataProvider';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
+
import { Query, QueryNextCursors, QueryResult } from './types';
|
|
6
|
+
export declare class DataModelsSdk {
|
|
7
|
+
private readonly _sdk;
|
|
8
|
+
private readonly _queryEndpoint;
|
|
9
|
+
constructor(sdk: CogniteClient);
|
|
10
|
+
queryNodesAndEdges<const T extends Query>(query: T, nextCursor?: QueryNextCursors<T>): Promise<QueryResult<T>>;
|
|
11
|
+
}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { AnnotationModel, CogniteClient, IdEither,
|
|
5
|
-
import { Historical360ImageSet, Image360AnnotationFilterDelegate, Image360Face, Image360FileDescriptor, ImageAssetLinkAnnotationInfo } from '../types';
|
|
4
|
+
import { AnnotationModel, CogniteClient, IdEither, CogniteInternalId } from '@cognite/sdk';
|
|
5
|
+
import { Historical360ImageSet, Image360AnnotationFilterDelegate, Image360DescriptorProvider, Image360Face, Image360FileDescriptor, ImageAssetLinkAnnotationInfo } from '../types';
|
|
6
6
|
import { Image360Provider } from '../Image360Provider';
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class Cdf360ImageProvider<T> implements Image360Provider<T> {
|
|
8
8
|
private readonly _client;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
private readonly _descriptorProvider;
|
|
10
|
+
constructor(client: CogniteClient, descriptorProvider: Image360DescriptorProvider<T>);
|
|
11
|
+
get360ImageDescriptors(metadataFilter: T, preMultipliedRotation: boolean): Promise<Historical360ImageSet[]>;
|
|
11
12
|
get360ImageAnnotations(descriptors: Image360FileDescriptor[]): Promise<AnnotationModel[]>;
|
|
12
13
|
getFilesByAssetRef(assetRef: IdEither): Promise<CogniteInternalId[]>;
|
|
13
14
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
14
15
|
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
15
16
|
private getFileIds;
|
|
16
17
|
private createFaces;
|
|
17
|
-
private mergeDescriptors;
|
|
18
|
-
private listEvents;
|
|
19
|
-
private listFiles;
|
|
20
|
-
private sortFileInfoSetByNewest;
|
|
21
18
|
private getFileBuffers;
|
|
22
19
|
getIconBuffers(fileIds: {
|
|
23
20
|
id: number;
|
|
24
21
|
}[], abortSignal?: AbortSignal): Promise<ArrayBuffer[]>;
|
|
25
22
|
private getDownloadUrls;
|
|
26
|
-
private parseEventMetadata;
|
|
27
23
|
get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[], annotationFilter: Image360AnnotationFilterDelegate): Promise<ImageAssetLinkAnnotationInfo[]>;
|
|
28
24
|
private listFileAnnotations;
|
|
29
25
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Metadata } from '@cognite/sdk';
|
|
5
|
+
import { Historical360ImageSet, Image360DescriptorProvider } from '../../types';
|
|
6
|
+
import { Cdf360DataModelsDescriptorProvider, Image360DataModelIdentifier } from './datamodels/Cdf360DataModelsDescriptorProvider';
|
|
7
|
+
import { Cdf360EventDescriptorProvider } from './events/Cdf360EventDescriptorProvider';
|
|
8
|
+
export declare class Cdf360CombinedDescriptorProvider implements Image360DescriptorProvider<Metadata | Image360DataModelIdentifier> {
|
|
9
|
+
private readonly _eventProvider;
|
|
10
|
+
private readonly _fdmProvider;
|
|
11
|
+
static isFdmIdentifier(metadataFilter: Metadata | Image360DataModelIdentifier): metadataFilter is Image360DataModelIdentifier;
|
|
12
|
+
constructor(fdmProvider: Cdf360DataModelsDescriptorProvider, eventProvider: Cdf360EventDescriptorProvider);
|
|
13
|
+
get360ImageDescriptors(metadataFilter: Metadata | Image360DataModelIdentifier, preMultipliedRotation: boolean): Promise<Historical360ImageSet[]>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
+
import { Historical360ImageSet, Image360DescriptorProvider } from '../../../types';
|
|
6
|
+
/**
|
|
7
|
+
* An identifier uniquely determining an instance of a Cognite Data Model
|
|
8
|
+
*/
|
|
9
|
+
export type Image360DataModelIdentifier = {
|
|
10
|
+
space: string;
|
|
11
|
+
image360CollectionExternalId: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class Cdf360DataModelsDescriptorProvider implements Image360DescriptorProvider<Image360DataModelIdentifier> {
|
|
14
|
+
private readonly _dmsSdk;
|
|
15
|
+
private readonly _cogniteSdk;
|
|
16
|
+
constructor(sdk: CogniteClient);
|
|
17
|
+
get360ImageDescriptors(collectionIdentifier: Image360DataModelIdentifier, _: boolean): Promise<Historical360ImageSet[]>;
|
|
18
|
+
private queryCollection;
|
|
19
|
+
private getFileDescriptors;
|
|
20
|
+
private getHistorical360ImageSet;
|
|
21
|
+
private getImageRevision;
|
|
22
|
+
private getRevisionTransform;
|
|
23
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
declare const Image360CollectionQuery: {
|
|
5
|
+
readonly with: {
|
|
6
|
+
readonly image_collection: {
|
|
7
|
+
readonly nodes: {
|
|
8
|
+
readonly filter: {
|
|
9
|
+
readonly and: readonly [{
|
|
10
|
+
readonly equals: {
|
|
11
|
+
readonly property: readonly ["node", "externalId"];
|
|
12
|
+
readonly value: {
|
|
13
|
+
readonly parameter: "collectionExternalId";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
readonly equals: {
|
|
18
|
+
readonly property: readonly ["node", "space"];
|
|
19
|
+
readonly value: {
|
|
20
|
+
readonly parameter: "collectionSpace";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly limit: 1;
|
|
27
|
+
};
|
|
28
|
+
readonly images: {
|
|
29
|
+
readonly nodes: {
|
|
30
|
+
readonly from: "image_collection";
|
|
31
|
+
readonly through: {
|
|
32
|
+
readonly view: {
|
|
33
|
+
readonly type: "view";
|
|
34
|
+
readonly space: "cdf_360_image_schema";
|
|
35
|
+
readonly externalId: "Image360";
|
|
36
|
+
readonly version: "v1";
|
|
37
|
+
};
|
|
38
|
+
readonly identifier: "collection360";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly limit: 10000;
|
|
42
|
+
};
|
|
43
|
+
readonly stations: {
|
|
44
|
+
readonly nodes: {
|
|
45
|
+
readonly from: "images";
|
|
46
|
+
readonly through: {
|
|
47
|
+
readonly view: {
|
|
48
|
+
readonly type: "view";
|
|
49
|
+
readonly space: "cdf_360_image_schema";
|
|
50
|
+
readonly externalId: "Image360";
|
|
51
|
+
readonly version: "v1";
|
|
52
|
+
};
|
|
53
|
+
readonly identifier: "station";
|
|
54
|
+
};
|
|
55
|
+
readonly direction: "outwards";
|
|
56
|
+
};
|
|
57
|
+
readonly limit: 10000;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
readonly select: {
|
|
61
|
+
readonly image_collection: {
|
|
62
|
+
readonly sources: readonly [{
|
|
63
|
+
readonly source: {
|
|
64
|
+
readonly type: "view";
|
|
65
|
+
readonly space: "cdf_360_image_schema";
|
|
66
|
+
readonly externalId: "Image360Collection";
|
|
67
|
+
readonly version: "v1";
|
|
68
|
+
};
|
|
69
|
+
readonly properties: readonly ["label"];
|
|
70
|
+
}];
|
|
71
|
+
};
|
|
72
|
+
readonly images: {
|
|
73
|
+
readonly sources: readonly [{
|
|
74
|
+
readonly source: {
|
|
75
|
+
readonly type: "view";
|
|
76
|
+
readonly space: "cdf_360_image_schema";
|
|
77
|
+
readonly externalId: "Image360";
|
|
78
|
+
readonly version: "v1";
|
|
79
|
+
};
|
|
80
|
+
readonly properties: readonly ["translationX", "translationY", "translationZ", "eulerRotationX", "eulerRotationY", "eulerRotationZ", "scaleX", "scaleY", "scaleZ", "cubeMapFront", "cubeMapBack", "cubeMapLeft", "cubeMapRight", "cubeMapTop", "cubeMapBottom", "collection360", "station", "timeTaken", "label"];
|
|
81
|
+
}];
|
|
82
|
+
};
|
|
83
|
+
readonly stations: {
|
|
84
|
+
readonly sources: readonly [{
|
|
85
|
+
readonly source: {
|
|
86
|
+
readonly type: "view";
|
|
87
|
+
readonly space: "cdf_360_image_schema";
|
|
88
|
+
readonly externalId: "Station360";
|
|
89
|
+
readonly version: "v1";
|
|
90
|
+
};
|
|
91
|
+
readonly properties: readonly ["label"];
|
|
92
|
+
}];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export type Cdf360FdmQuery = typeof Image360CollectionQuery;
|
|
97
|
+
export declare function get360CollectionQuery(externalId: string, space: string): Cdf360FdmQuery & {
|
|
98
|
+
parameters: {
|
|
99
|
+
collectionExternalId: string;
|
|
100
|
+
collectionSpace: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient, Metadata } from '@cognite/sdk';
|
|
5
|
+
import { Historical360ImageSet, Image360DescriptorProvider } from '../../../types';
|
|
6
|
+
export declare class Cdf360EventDescriptorProvider implements Image360DescriptorProvider<Metadata> {
|
|
7
|
+
private readonly _client;
|
|
8
|
+
constructor(client: CogniteClient);
|
|
9
|
+
get360ImageDescriptors(metadataFilter: Metadata, preMultipliedRotation: boolean): Promise<Historical360ImageSet[]>;
|
|
10
|
+
private mergeDescriptors;
|
|
11
|
+
private listEvents;
|
|
12
|
+
private listFiles;
|
|
13
|
+
private sortFileInfoSetByNewest;
|
|
14
|
+
private parseEventMetadata;
|
|
15
|
+
}
|