@cognite/reveal 4.19.1 → 4.20.0-dev.20241030
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 +4 -4
- package/dist/index.js +209 -169
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/index.d.ts +2 -0
- package/dist/packages/360-images/src/Image360Action.d.ts +25 -0
- package/dist/packages/360-images/src/Image360Facade.d.ts +10 -9
- package/dist/packages/360-images/src/Image360History.d.ts +15 -0
- package/dist/packages/360-images/src/annotation/Image360Annotation.d.ts +3 -3
- package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +3 -3
- package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +9 -8
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +6 -6
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +7 -7
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +4 -3
- package/dist/packages/360-images/src/entity/Image360.d.ts +4 -3
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +8 -8
- package/dist/packages/360-images/src/entity/Image360Revision.d.ts +3 -2
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +4 -4
- package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +2 -2
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +16 -12
- package/dist/packages/api/src/public/RevealManager.d.ts +4 -3
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +33 -19
- package/dist/packages/api/src/public/migration/types.d.ts +14 -9
- package/dist/packages/api/src/public/types.d.ts +5 -4
- package/dist/packages/api/src/storage/RevealManagerHelper.d.ts +5 -4
- package/dist/packages/api/src/utilities/ViewStateHelper.d.ts +3 -2
- package/dist/packages/api/src/utilities/utils.d.ts +11 -0
- package/dist/packages/data-providers/index.d.ts +8 -2
- package/dist/packages/data-providers/src/DataSourceType.d.ts +127 -0
- package/dist/packages/data-providers/src/ModelIdentifier.d.ts +2 -0
- package/dist/packages/data-providers/src/PointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/model-identifiers/DMModelIdentifier.d.ts +12 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/cdfAnnotationsToObjects.d.ts +2 -1
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/CdfPointCloudDMStylableObjectProvider.d.ts +12 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/DummyPointCloudDMStylableObjectProvider.d.ts +9 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudObjects.d.ts +4 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudVolumeCollectionQuery.d.ts +81 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/types.d.ts +32 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/utils.d.ts +6 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/types.d.ts +25 -22
- package/dist/packages/data-providers/src/requests/fetchDMModelIdFromRevisionId.d.ts +8 -0
- package/dist/packages/data-providers/src/utilities/constants.d.ts +29 -0
- package/dist/packages/data-providers/src/utilities/internalAddModelOptions.d.ts +23 -0
- package/dist/packages/data-providers/src/utilities/utils.d.ts +32 -0
- package/dist/packages/pointcloud-styling/index.d.ts +4 -2
- package/dist/packages/pointcloud-styling/src/AnnotationIdPointCloudObjectCollection.d.ts +3 -3
- package/dist/packages/pointcloud-styling/src/PointCloudDMVolumeCollection.d.ts +19 -0
- package/dist/packages/pointcloud-styling/src/PointCloudObjectCollection.d.ts +15 -3
- package/dist/packages/pointcloud-styling/src/StyledPointCloudVolumeCollection.d.ts +41 -0
- package/dist/packages/pointcloud-styling/src/utils.d.ts +7 -0
- package/dist/packages/pointclouds/index.d.ts +1 -0
- package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +33 -9
- package/dist/packages/pointclouds/src/PointCloudFactory.d.ts +5 -3
- package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +12 -2
- package/dist/packages/pointclouds/src/PointCloudLoadingStateHandler.d.ts +2 -1
- package/dist/packages/pointclouds/src/PointCloudManager.d.ts +3 -3
- package/dist/packages/pointclouds/src/PointCloudNode.d.ts +8 -7
- package/dist/packages/pointclouds/src/PointCloudPickingHandler.d.ts +3 -32
- package/dist/packages/pointclouds/src/createPointCloudManager.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/Potree.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/loading/EptLoader.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/types/IPotree.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/utils/createObjectIdMaps.d.ts +2 -2
- package/dist/packages/pointclouds/src/typeGuards.d.ts +17 -0
- package/dist/packages/pointclouds/src/types.d.ts +29 -0
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectAppearanceTexture.d.ts +4 -3
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectIdMaps.d.ts +3 -2
- package/dist/packages/tools/src/AxisGizmo/AxisGizmoTool.d.ts +2 -1
- package/dist/packages/tools/src/DebugCameraTool.d.ts +2 -1
- package/dist/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +2 -1
- package/dist/packages/tools/src/Measurement/MeasurementTool.d.ts +2 -1
- package/package.json +3 -2
- package/dist/packages/pointcloud-styling/src/StyledPointCloudObjectCollection.d.ts +0 -13
|
@@ -5,13 +5,15 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { PointerEventDelegate, SceneRenderedDelegate, DisposedDelegate, BeforeSceneRenderedDelegate, CustomObjectIntersectInput, ICustomObject } from '../../../../utilities';
|
|
6
6
|
import { CogniteCadModel } from '../../../../cad-model';
|
|
7
7
|
import { PointCloudBudget, CognitePointCloudModel } from '../../../../pointclouds';
|
|
8
|
-
import { AddImage360Options,
|
|
8
|
+
import { AddImage360Options, Cognite3DViewerOptions, Intersection, CadModelBudget, ResolutionOptions, RenderParameters, AnyIntersection, AddModelOptions } from './types';
|
|
9
9
|
import { CogniteModel, Image360WithCollection } from '../types';
|
|
10
10
|
import { ViewerState } from '../../utilities/ViewStateHelper';
|
|
11
11
|
import { CameraManager, CameraChangeDelegate, CameraStopDelegate } from '../../../../camera-manager';
|
|
12
12
|
import { Image360DataModelIdentifier } from '../../../../data-providers';
|
|
13
13
|
import { SupportedModelTypes } from '../../../../model-base';
|
|
14
14
|
import { Image360Collection, Image360, Image360Revision, Image360AnnotationIntersection } from '../../../../360-images';
|
|
15
|
+
import { ClassicDataSourceType, DataSourceType } from '../../../../data-providers';
|
|
16
|
+
import { Image360Action } from '../../../../360-images/src/Image360Action';
|
|
15
17
|
/**
|
|
16
18
|
* @example
|
|
17
19
|
* ```js
|
|
@@ -22,7 +24,7 @@ import { Image360Collection, Image360, Image360Revision, Image360AnnotationInter
|
|
|
22
24
|
* ```
|
|
23
25
|
* @module @cognite/reveal
|
|
24
26
|
*/
|
|
25
|
-
export declare class Cognite3DViewer {
|
|
27
|
+
export declare class Cognite3DViewer<DataSourceT extends DataSourceType = ClassicDataSourceType> {
|
|
26
28
|
private readonly _domElementResizeObserver;
|
|
27
29
|
private readonly _image360ApiHelper;
|
|
28
30
|
/**
|
|
@@ -98,7 +100,7 @@ export declare class Cognite3DViewer {
|
|
|
98
100
|
/**
|
|
99
101
|
* Gets a list of models currently added to the viewer.
|
|
100
102
|
*/
|
|
101
|
-
get models(): CogniteModel[];
|
|
103
|
+
get models(): CogniteModel<DataSourceT>[];
|
|
102
104
|
constructor(options: Cognite3DViewerOptions);
|
|
103
105
|
/**
|
|
104
106
|
* Set options to control resolution of the viewer. This includes
|
|
@@ -239,7 +241,7 @@ export declare class Cognite3DViewer {
|
|
|
239
241
|
* });
|
|
240
242
|
* ```
|
|
241
243
|
*/
|
|
242
|
-
addModel(options: AddModelOptions): Promise<CogniteModel
|
|
244
|
+
addModel(options: AddModelOptions<DataSourceT>): Promise<CogniteModel<DataSourceT>>;
|
|
243
245
|
/**
|
|
244
246
|
* Add a new CAD 3D model to the viewer.
|
|
245
247
|
* Call {@link Cognite3DViewer.fitCameraToModel} to see the model after the model has loaded.
|
|
@@ -255,7 +257,7 @@ export declare class Cognite3DViewer {
|
|
|
255
257
|
* });
|
|
256
258
|
* ```
|
|
257
259
|
*/
|
|
258
|
-
addCadModel(options: AddModelOptions): Promise<CogniteCadModel>;
|
|
260
|
+
addCadModel<T extends DataSourceT>(options: AddModelOptions<T>): Promise<CogniteCadModel>;
|
|
259
261
|
private addCadModelWithSequencer;
|
|
260
262
|
/**
|
|
261
263
|
* Add a new pointcloud 3D model to the viewer.
|
|
@@ -272,14 +274,14 @@ export declare class Cognite3DViewer {
|
|
|
272
274
|
* });
|
|
273
275
|
* ```
|
|
274
276
|
*/
|
|
275
|
-
addPointCloudModel(options: AddModelOptions): Promise<CognitePointCloudModel
|
|
277
|
+
addPointCloudModel(options: AddModelOptions<DataSourceT>): Promise<CognitePointCloudModel<DataSourceT>>;
|
|
276
278
|
private addPointCloudModelWithSequencer;
|
|
277
279
|
/**
|
|
278
280
|
* Adds a set of 360 images to the scene from the /datamodels API in Cognite Data Fusion.
|
|
279
281
|
* @param datasource The data data source which holds the references to the 360 image sets.
|
|
280
282
|
* @param dataModelIdentifier The search parameters to apply when querying Cognite Datamodels that contains the 360 images.
|
|
281
283
|
*/
|
|
282
|
-
add360ImageSet(datasource: 'datamodels', dataModelIdentifier: Image360DataModelIdentifier): Promise<Image360Collection
|
|
284
|
+
add360ImageSet(datasource: 'datamodels', dataModelIdentifier: Image360DataModelIdentifier): Promise<Image360Collection<DataSourceT & ClassicDataSourceType>>;
|
|
283
285
|
/**
|
|
284
286
|
* Adds a set of 360 images to the scene from the /events API in Cognite Data Fusion.
|
|
285
287
|
* @param datasource The CDF data source which holds the references to the 360 image sets.
|
|
@@ -293,43 +295,55 @@ export declare class Cognite3DViewer {
|
|
|
293
295
|
*/
|
|
294
296
|
add360ImageSet(datasource: 'events', eventFilter: {
|
|
295
297
|
[key: string]: string;
|
|
296
|
-
}, add360ImageOptions?: AddImage360Options): Promise<Image360Collection
|
|
298
|
+
}, add360ImageOptions?: AddImage360Options): Promise<Image360Collection<DataSourceT & ClassicDataSourceType>>;
|
|
297
299
|
/**
|
|
298
300
|
* Returns a list of added 360 image collections.
|
|
299
301
|
*/
|
|
300
|
-
get360ImageCollections(): Image360Collection[];
|
|
302
|
+
get360ImageCollections(): Image360Collection<DataSourceT>[];
|
|
301
303
|
/**
|
|
302
304
|
* Returns the currently entered 360 image.
|
|
303
305
|
*/
|
|
304
|
-
getActive360ImageInfo(): Image360WithCollection | undefined;
|
|
306
|
+
getActive360ImageInfo(): Image360WithCollection<DataSourceT> | undefined;
|
|
305
307
|
/**
|
|
306
308
|
* Remove a set of 360 images.
|
|
307
309
|
* @param image360Entities
|
|
308
310
|
* @deprecated
|
|
309
311
|
*/
|
|
310
|
-
remove360Images(...image360Entities: Image360[]): Promise<void>;
|
|
312
|
+
remove360Images(...image360Entities: Image360<DataSourceT>[]): Promise<void>;
|
|
311
313
|
/**
|
|
312
314
|
* Removes a previously added 360 image collection from the viewer.
|
|
313
315
|
* @param imageCollection Collection to remove.
|
|
314
316
|
*/
|
|
315
|
-
remove360ImageSet(imageCollection: Image360Collection): void;
|
|
317
|
+
remove360ImageSet(imageCollection: Image360Collection<DataSourceT>): void;
|
|
316
318
|
/**
|
|
317
319
|
* Enter visualization of a 360 image.
|
|
318
320
|
* @param image360 The 360 image to enter.
|
|
319
321
|
* @param revision The image revision to use. If not provided the newest revision will be shown.
|
|
320
322
|
*/
|
|
321
|
-
enter360Image(image360: Image360
|
|
323
|
+
enter360Image(image360: Image360<DataSourceT>, revision?: Image360Revision<DataSourceT>): Promise<void>;
|
|
322
324
|
/**
|
|
323
325
|
* Exit visualization of the 360 image.
|
|
324
326
|
*/
|
|
325
327
|
exit360Image(): void;
|
|
328
|
+
/**
|
|
329
|
+
* Check if a 360 image action can be done.
|
|
330
|
+
* @param action The action to check if can be done.
|
|
331
|
+
* @beta
|
|
332
|
+
*/
|
|
333
|
+
canDo360Action(action: Image360Action): boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Do a 360 image action.
|
|
336
|
+
* @param action The action to do.
|
|
337
|
+
* @beta
|
|
338
|
+
*/
|
|
339
|
+
do360Action(action: Image360Action): Promise<void>;
|
|
326
340
|
/**
|
|
327
341
|
* Removes a model that was previously added using {@link Cognite3DViewer.addModel},
|
|
328
342
|
* {@link Cognite3DViewer.addCadModel} or {@link Cognite3DViewer.addPointCloudModel}
|
|
329
343
|
* .
|
|
330
344
|
* @param model
|
|
331
345
|
*/
|
|
332
|
-
removeModel(model: CogniteModel): void;
|
|
346
|
+
removeModel(model: CogniteModel<DataSourceT>): void;
|
|
333
347
|
/**
|
|
334
348
|
* Use to determine of which type the model is.
|
|
335
349
|
*
|
|
@@ -487,7 +501,7 @@ export declare class Cognite3DViewer {
|
|
|
487
501
|
* is used as a fallback.
|
|
488
502
|
* @param model The model to load camera settings from.
|
|
489
503
|
*/
|
|
490
|
-
loadCameraFromModel(model: CogniteModel): void;
|
|
504
|
+
loadCameraFromModel(model: CogniteModel<DataSourceT>): void;
|
|
491
505
|
/**
|
|
492
506
|
* Move camera to a place where the 3D model is visible.
|
|
493
507
|
* It uses the bounding box of the 3D model and calls {@link Cognite3DViewer.fitCameraToBoundingBox}.
|
|
@@ -507,14 +521,14 @@ export declare class Cognite3DViewer {
|
|
|
507
521
|
* viewer.fitCameraToModel(model, 0);
|
|
508
522
|
* ```
|
|
509
523
|
*/
|
|
510
|
-
fitCameraToModel(model: CogniteModel
|
|
524
|
+
fitCameraToModel(model: CogniteModel<DataSourceT>, duration?: number): void;
|
|
511
525
|
/**
|
|
512
526
|
* Move camera to a place where a set of 3D models are visible.
|
|
513
527
|
* @param models Optional 3D models to focus the camera on. If no models are provided the camera will fit to all models.
|
|
514
528
|
* @param duration The duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
|
|
515
529
|
* @param restrictToMostGeometry If true, attempt to remove junk geometry from the boundingBox to allow setting a good camera position.
|
|
516
530
|
*/
|
|
517
|
-
fitCameraToModels(models?: CogniteModel[], duration?: number, restrictToMostGeometry?: boolean): void;
|
|
531
|
+
fitCameraToModels(models?: CogniteModel<DataSourceT>[], duration?: number, restrictToMostGeometry?: boolean): void;
|
|
518
532
|
/**
|
|
519
533
|
* Move camera to a place where a all objects in the scene are visible.
|
|
520
534
|
* @param duration The duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
|
|
@@ -654,7 +668,7 @@ export declare class Cognite3DViewer {
|
|
|
654
668
|
* );
|
|
655
669
|
* ```
|
|
656
670
|
*/
|
|
657
|
-
getIntersectionFromPixel(offsetX: number, offsetY: number): Promise<null | Intersection
|
|
671
|
+
getIntersectionFromPixel(offsetX: number, offsetY: number): Promise<null | Intersection<DataSourceT>>;
|
|
658
672
|
/**
|
|
659
673
|
* Raycasting model(s) for finding where the ray intersects with all models, including custom objects.
|
|
660
674
|
* @param pixelCoords Pixel coordinate in pixels (relative to the domElement).
|
|
@@ -668,7 +682,7 @@ export declare class Cognite3DViewer {
|
|
|
668
682
|
getAnyIntersectionFromPixel(pixelCoords: THREE.Vector2, options?: {
|
|
669
683
|
stopOnHitting360Icon?: boolean;
|
|
670
684
|
predicate?: (customObject: ICustomObject) => boolean;
|
|
671
|
-
}): Promise<AnyIntersection | undefined>;
|
|
685
|
+
}): Promise<AnyIntersection<DataSourceT> | undefined>;
|
|
672
686
|
/**
|
|
673
687
|
* Event function to click on 360 images.
|
|
674
688
|
* @param event The event type.
|
|
@@ -5,12 +5,14 @@ import { CogniteClient } from '@cognite/sdk';
|
|
|
5
5
|
import { CadModelBudget } from '../../../../cad-geometry-loaders';
|
|
6
6
|
import { PointCloudBudget, PointCloudIntersection } from '../../../../pointclouds';
|
|
7
7
|
import { CameraManager } from '../../../../camera-manager';
|
|
8
|
-
import {
|
|
8
|
+
import { CogniteCadModel } from '../../../../cad-model';
|
|
9
9
|
import { DataSource } from '../../../../data-source';
|
|
10
10
|
import { EdlOptions } from '../../../../rendering';
|
|
11
|
+
import { CommonModelOptions } from '../../../../data-providers';
|
|
11
12
|
import { Image360AnnotationFilterOptions } from '../../../../360-images';
|
|
12
13
|
import type { Vector2, WebGLRenderTarget, WebGLRenderer, Matrix4, Vector3 } from 'three';
|
|
13
14
|
import { CustomObjectIntersection } from '../../../../utilities';
|
|
15
|
+
import { ClassicDataSourceType, DataSourceType, DMDataSourceType } from '../../../../data-providers';
|
|
14
16
|
/**
|
|
15
17
|
* Callback to monitor loaded requests and progress.
|
|
16
18
|
* Use OnLoadingCallback instead of onProgress/onComplete.
|
|
@@ -160,12 +162,15 @@ export interface Cognite3DViewerOptions {
|
|
|
160
162
|
/**
|
|
161
163
|
* @module @cognite/reveal
|
|
162
164
|
*/
|
|
163
|
-
export
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
export type AddModelOptions<T extends DataSourceType = ClassicDataSourceType> = CommonModelOptions & T['modelIdentifier'];
|
|
166
|
+
/**
|
|
167
|
+
* Add model options for models of classic format, identified by modelId and revisionId.
|
|
168
|
+
*/
|
|
169
|
+
export type ClassicAddModelOptions = AddModelOptions<ClassicDataSourceType>;
|
|
170
|
+
/**
|
|
171
|
+
* Add model options for models of DM format, identified by revisionExternalId and revisionSpace.
|
|
172
|
+
*/
|
|
173
|
+
export type DMAddModelOptions = AddModelOptions<DMDataSourceType>;
|
|
169
174
|
export type AddImage360Options = {
|
|
170
175
|
/**
|
|
171
176
|
* An optional transformation which will be applied to all 360 images that are fetched.
|
|
@@ -231,13 +236,13 @@ export type ResolutionOptions = {
|
|
|
231
236
|
* Represents the result from {@link Cognite3DViewer.getIntersectionFromPixel}.
|
|
232
237
|
* @module @cognite/reveal
|
|
233
238
|
*/
|
|
234
|
-
export type Intersection = CadIntersection | PointCloudIntersection
|
|
239
|
+
export type Intersection<T extends DataSourceType = ClassicDataSourceType> = CadIntersection | PointCloudIntersection<T>;
|
|
235
240
|
/**
|
|
236
241
|
* Represents the result from {@link Cognite3DViewer.getAnyIntersectionFromPixel}.
|
|
237
242
|
* @module @cognite/reveal
|
|
238
243
|
* @beta
|
|
239
244
|
*/
|
|
240
|
-
export type AnyIntersection = CadIntersection | PointCloudIntersection | CustomObjectIntersection;
|
|
245
|
+
export type AnyIntersection<T extends DataSourceType = DataSourceType> = CadIntersection | PointCloudIntersection<T> | CustomObjectIntersection;
|
|
241
246
|
/**
|
|
242
247
|
* @module @cognite/reveal
|
|
243
248
|
*/
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360, Image360Collection } from '../../../360-images';
|
|
5
5
|
import { CogniteCadModel } from '../../../cad-model';
|
|
6
|
+
import { ClassicDataSourceType, DataSourceType } from '../../../data-providers/src/DataSourceType';
|
|
6
7
|
import { CognitePointCloudModel } from '../../../pointclouds';
|
|
7
8
|
/**
|
|
8
9
|
* Type abstraction for CogniteCadModel or CognitePointCloudModel;.
|
|
9
10
|
*/
|
|
10
|
-
export type CogniteModel = CogniteCadModel | CognitePointCloudModel
|
|
11
|
+
export type CogniteModel<T extends DataSourceType = ClassicDataSourceType> = CogniteCadModel | CognitePointCloudModel<T>;
|
|
11
12
|
export { WellKnownAsprsPointClassCodes } from '../../../pointclouds';
|
|
12
13
|
export { PointShape, PointColorType, PointSizeType } from '../../../rendering';
|
|
13
14
|
/**
|
|
14
15
|
* A tuple of a 360 image and its collection.
|
|
15
16
|
*/
|
|
16
|
-
export type Image360WithCollection = {
|
|
17
|
-
image360Collection: Image360Collection
|
|
18
|
-
image360: Image360
|
|
17
|
+
export type Image360WithCollection<T extends DataSourceType = ClassicDataSourceType> = {
|
|
18
|
+
image360Collection: Image360Collection<T>;
|
|
19
|
+
image360: Image360<T>;
|
|
19
20
|
};
|
|
20
21
|
export * from './migration/types';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { AddModelOptions } from '../public/migration/types';
|
|
6
5
|
import { RevealManager } from '../public/RevealManager';
|
|
7
6
|
import { RevealOptions } from '../public/RevealOptions';
|
|
7
|
+
import { InternalDataSourceType, DataSourceType, AddModelOptionsWithModelRevisionId } from '../../../data-providers';
|
|
8
8
|
import { DataSource } from '../../../data-source';
|
|
9
9
|
import { SceneHandler } from '../../../utilities';
|
|
10
10
|
import { CadNode } from '../../../cad-model';
|
|
@@ -18,8 +18,9 @@ import { CameraManager } from '../../../camera-manager';
|
|
|
18
18
|
*/
|
|
19
19
|
export declare class RevealManagerHelper {
|
|
20
20
|
private readonly _revealManager;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
addPointCloudModel<T extends DataSourceType>(model: AddModelOptionsWithModelRevisionId<T>): Promise<PointCloudNode<T>>;
|
|
22
|
+
addCadModel<T extends InternalDataSourceType>(model: AddModelOptionsWithModelRevisionId<T>): Promise<CadNode>;
|
|
23
|
+
private readonly _type;
|
|
23
24
|
private constructor();
|
|
24
25
|
private constructor();
|
|
25
26
|
/**
|
|
@@ -57,7 +58,7 @@ export declare class RevealManagerHelper {
|
|
|
57
58
|
private static addLocalPointCloudModel;
|
|
58
59
|
/**
|
|
59
60
|
* Add a CDF hosted point cloud model.
|
|
60
|
-
* @param
|
|
61
|
+
* @param identifier
|
|
61
62
|
* @param revealManager
|
|
62
63
|
*/
|
|
63
64
|
private static addCdfPointCloudModel;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Cognite3DViewer } from '../public/migration/Cognite3DViewer';
|
|
2
2
|
import { CogniteClient } from '@cognite/sdk';
|
|
3
3
|
import { SerializableNodeAppearance } from '../../../cad-styling/src/NodeAppearance';
|
|
4
|
+
import { DataSourceType } from '../../../data-providers';
|
|
4
5
|
export type ViewerState = {
|
|
5
6
|
camera?: {
|
|
6
7
|
position: {
|
|
@@ -34,11 +35,11 @@ export type ModelState = {
|
|
|
34
35
|
appearance: SerializableNodeAppearance;
|
|
35
36
|
}[];
|
|
36
37
|
};
|
|
37
|
-
export declare class ViewStateHelper {
|
|
38
|
+
export declare class ViewStateHelper<T extends DataSourceType> {
|
|
38
39
|
private readonly _viewer;
|
|
39
40
|
private readonly _cdfClient;
|
|
40
41
|
private get _cameraManager();
|
|
41
|
-
constructor(viewer: Cognite3DViewer
|
|
42
|
+
constructor(viewer: Cognite3DViewer<T>, cdfClient: CogniteClient);
|
|
42
43
|
getCurrentState(): ViewerState;
|
|
43
44
|
setState(viewerState: ViewerState): Promise<void>;
|
|
44
45
|
private getModelsState;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
+
import { AddModelOptions } from '../public/migration/types';
|
|
6
|
+
import { DataSourceType } from '../../../data-providers';
|
|
7
|
+
import { LocalAddModelOptions } from '../../../data-providers/src/utilities/internalAddModelOptions';
|
|
8
|
+
export declare function getModelAndRevisionId(options: AddModelOptions<DataSourceType> | LocalAddModelOptions, sdk: CogniteClient | undefined): Promise<{
|
|
9
|
+
modelId: number;
|
|
10
|
+
revisionId: number;
|
|
11
|
+
}>;
|
|
@@ -12,13 +12,19 @@ export { LocalModelDataProvider } from './src/model-data-providers/LocalModelDat
|
|
|
12
12
|
export { LocalModelIdentifier } from './src/model-identifiers/LocalModelIdentifier';
|
|
13
13
|
export { LocalModelMetadataProvider } from './src/metadata-providers/LocalModelMetadataProvider';
|
|
14
14
|
export { Local360ImageProvider } from './src/image-360-data-providers/Local360ImageProvider';
|
|
15
|
-
export { ModelIdentifier } from './src/ModelIdentifier';
|
|
15
|
+
export { ModelIdentifier, createModelIdentifier } from './src/ModelIdentifier';
|
|
16
16
|
export { ModelMetadataProvider } from './src/ModelMetadataProvider';
|
|
17
17
|
export { ModelDataProvider } from './src/ModelDataProvider';
|
|
18
|
-
export { PointCloudObjectMetadata, PointCloudObject } from './src/pointcloud-stylable-object-providers/types';
|
|
18
|
+
export { PointCloudObjectMetadata, PointCloudObject, DMInstanceRef } from './src/pointcloud-stylable-object-providers/types';
|
|
19
19
|
export { PointCloudStylableObjectProvider } from './src/PointCloudStylableObjectProvider';
|
|
20
20
|
export { StylableObject, SerializableStylableObject } from './src/pointcloud-stylable-object-providers/StylableObject';
|
|
21
21
|
export { CdfPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider';
|
|
22
22
|
export { DummyPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider';
|
|
23
|
+
export { CdfPointCloudDMStylableObjectProvider } from './src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/CdfPointCloudDMStylableObjectProvider';
|
|
24
|
+
export { DummyPointCloudDMStylableObjectProvider } from './src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/DummyPointCloudDMStylableObjectProvider';
|
|
23
25
|
export { Image360Provider, Image360DataProvider } from './src/Image360Provider';
|
|
24
26
|
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture, Image360FileDescriptor, ImageAssetLinkAnnotationInfo } from './src/types';
|
|
27
|
+
export { fetchDMModelIdFromRevisionId } from './src/requests/fetchDMModelIdFromRevisionId';
|
|
28
|
+
export { isDMPointCloudVolumeObject, isClassicPointCloudVolumeObject, isDMPointCloudVolume, isClassicPointCloudVolume } from './src/utilities/utils';
|
|
29
|
+
export { DataSourceType, ClassicDataSourceType, DMDataSourceType, ClassicModelIdentifierType, DMModelIdentifierType, isClassicIdentifier, isDMIdentifier, InternalDataSourceType, LocalDataSourceType, LocalModelIdentifierType, isLocalIdentifier, GenericDataSourceType } from './src/DataSourceType';
|
|
30
|
+
export { LocalAddModelOptions, CommonModelOptions, InternalAddModelOptions, AddModelOptionsWithModelRevisionId } from './src/utilities/internalAddModelOptions';
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { AnnotationModel, AnnotationsAssetRef } from '@cognite/sdk';
|
|
5
|
+
import { Image360DataModelIdentifier } from './image-360-data-providers/descriptor-providers/datamodels/Cdf360DataModelsDescriptorProvider';
|
|
6
|
+
import { DMInstanceRef } from './pointcloud-stylable-object-providers/types';
|
|
7
|
+
import { PointCloudAnnotationVolumeCollection, PointCloudDMVolumeCollection } from '../../pointcloud-styling';
|
|
8
|
+
/**
|
|
9
|
+
* Model identifier for classic CDF models, referenced by modelId and revisionId
|
|
10
|
+
*/
|
|
11
|
+
export type ClassicModelIdentifierType = {
|
|
12
|
+
modelId: number;
|
|
13
|
+
revisionId: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Model identifier for DM-based models, referenced by externalId and space of the model revision
|
|
17
|
+
*/
|
|
18
|
+
export type DMModelIdentifierType = {
|
|
19
|
+
revisionExternalId: string;
|
|
20
|
+
revisionSpace: string;
|
|
21
|
+
};
|
|
22
|
+
export type LocalModelIdentifierType = {
|
|
23
|
+
localPath: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Data source type for classic models
|
|
27
|
+
*/
|
|
28
|
+
export type ClassicDataSourceType = {
|
|
29
|
+
/**
|
|
30
|
+
* The classic point cloud model identifier associated with the object which include modelId and revisionId.
|
|
31
|
+
*/
|
|
32
|
+
modelIdentifier: ClassicModelIdentifierType;
|
|
33
|
+
/**
|
|
34
|
+
* The classic point cloud volume metadata containing reference associated with the object which includes annotationId
|
|
35
|
+
* and asset reference if any.
|
|
36
|
+
*/
|
|
37
|
+
pointCloudVolumeMetadata: {
|
|
38
|
+
annotationId: number;
|
|
39
|
+
assetRef?: AnnotationsAssetRef;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Point cloud volume collection type
|
|
43
|
+
*/
|
|
44
|
+
pointCloudCollectionType: PointCloudAnnotationVolumeCollection;
|
|
45
|
+
/**
|
|
46
|
+
* Identifier type for Event- or DM-based 360 images
|
|
47
|
+
*/
|
|
48
|
+
image360Identifier: {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
} | Image360DataModelIdentifier;
|
|
51
|
+
/**
|
|
52
|
+
* Type of classic 360 annotations
|
|
53
|
+
*/
|
|
54
|
+
image360AnnotationType: AnnotationModel;
|
|
55
|
+
/**
|
|
56
|
+
* Marker to make this type inconstructable
|
|
57
|
+
*/
|
|
58
|
+
_never: never;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Data source type for DM models
|
|
62
|
+
*/
|
|
63
|
+
export type DMDataSourceType = {
|
|
64
|
+
/**
|
|
65
|
+
* The CDF point cloud volume metadata containing reference associated with the object which includes externalId, space
|
|
66
|
+
* and asset reference if any.
|
|
67
|
+
*/
|
|
68
|
+
pointCloudVolumeMetadata: {
|
|
69
|
+
volumeInstanceRef: DMInstanceRef;
|
|
70
|
+
assetRef?: DMInstanceRef;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Point cloud volume collection type
|
|
74
|
+
*/
|
|
75
|
+
pointCloudCollectionType: PointCloudDMVolumeCollection;
|
|
76
|
+
/**
|
|
77
|
+
* The DM point cloud model identifier associated with the object, consisting of revision externalId and revision space
|
|
78
|
+
*/
|
|
79
|
+
modelIdentifier: DMModelIdentifierType;
|
|
80
|
+
/**
|
|
81
|
+
* Identifier type for DM 360 collections
|
|
82
|
+
*/
|
|
83
|
+
image360Identifier: Image360DataModelIdentifier;
|
|
84
|
+
/**
|
|
85
|
+
* Type of CoreDM 360 image annotations (to be defined)
|
|
86
|
+
*/
|
|
87
|
+
image360AnnotationType: never;
|
|
88
|
+
/**
|
|
89
|
+
* Marker to make this type inconstructable
|
|
90
|
+
*/
|
|
91
|
+
_never: never;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Data source type for local models
|
|
95
|
+
*/
|
|
96
|
+
export type LocalDataSourceType = {
|
|
97
|
+
modelIdentifier: LocalModelIdentifierType;
|
|
98
|
+
pointCloudVolumeMetadata: any;
|
|
99
|
+
pointCloudCollectionType: any;
|
|
100
|
+
_never: never;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Common data source type
|
|
104
|
+
*/
|
|
105
|
+
export type DataSourceType = ClassicDataSourceType | DMDataSourceType;
|
|
106
|
+
/**
|
|
107
|
+
* A DataSourceType used internally to allow for flexibility and generic testing
|
|
108
|
+
*/
|
|
109
|
+
export type GenericDataSourceType = {
|
|
110
|
+
modelIdentifier: any;
|
|
111
|
+
pointCloudVolumeMetadata: any;
|
|
112
|
+
pointCloudCollectionType: any;
|
|
113
|
+
image360Identifier: any;
|
|
114
|
+
image360AnnotationType: any;
|
|
115
|
+
_never: never;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Internal model identifiers
|
|
119
|
+
*/
|
|
120
|
+
export type InternalModelIdentifier = ClassicModelIdentifierType | DMModelIdentifierType | LocalModelIdentifierType;
|
|
121
|
+
/**
|
|
122
|
+
* Alias for internal + external data source types
|
|
123
|
+
*/
|
|
124
|
+
export type InternalDataSourceType = DataSourceType | LocalDataSourceType;
|
|
125
|
+
export declare function isClassicIdentifier(identifier: InternalModelIdentifier): identifier is ClassicModelIdentifierType;
|
|
126
|
+
export declare function isDMIdentifier(identifier: InternalModelIdentifier): identifier is DMModelIdentifierType;
|
|
127
|
+
export declare function isLocalIdentifier(identifier: InternalModelIdentifier): identifier is LocalModelIdentifierType;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import { ClassicModelIdentifierType, DMModelIdentifierType, LocalModelIdentifierType } from './DataSourceType';
|
|
4
5
|
/**
|
|
5
6
|
* Identifies a 3D model. Typically, implementations will use {@link CdfModelIdentifier}.
|
|
6
7
|
*/
|
|
@@ -10,3 +11,4 @@ export interface ModelIdentifier {
|
|
|
10
11
|
*/
|
|
11
12
|
readonly revealInternalId: symbol;
|
|
12
13
|
}
|
|
14
|
+
export declare function createModelIdentifier(identifier: ClassicModelIdentifierType | (DMModelIdentifierType & ClassicModelIdentifierType) | LocalModelIdentifierType): ModelIdentifier;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { ClassicDataSourceType, DataSourceType } from './DataSourceType';
|
|
5
5
|
import { PointCloudObject } from './pointcloud-stylable-object-providers/types';
|
|
6
|
-
export interface PointCloudStylableObjectProvider {
|
|
7
|
-
getPointCloudObjects(
|
|
6
|
+
export interface PointCloudStylableObjectProvider<T extends DataSourceType = ClassicDataSourceType> {
|
|
7
|
+
getPointCloudObjects(identifier: T['modelIdentifier']): Promise<PointCloudObject<T>[]>;
|
|
8
8
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { ClassicModelIdentifierType, DMModelIdentifierType } from '../DataSourceType';
|
|
5
|
+
import { CdfModelIdentifier } from './CdfModelIdentifier';
|
|
6
|
+
export declare class DMModelIdentifier extends CdfModelIdentifier {
|
|
7
|
+
readonly revealInternalId: symbol;
|
|
8
|
+
readonly revisionExternalId: string;
|
|
9
|
+
readonly revisionSpace: string;
|
|
10
|
+
constructor({ modelId, revisionId, revisionExternalId, revisionSpace }: DMModelIdentifierType & ClassicModelIdentifierType);
|
|
11
|
+
toString(): string;
|
|
12
|
+
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
-
import { ModelIdentifier } from '../ModelIdentifier';
|
|
6
5
|
import { PointCloudObject } from './types';
|
|
7
6
|
import { PointCloudStylableObjectProvider } from '../PointCloudStylableObjectProvider';
|
|
8
|
-
|
|
7
|
+
import { ClassicDataSourceType, ClassicModelIdentifierType } from '../DataSourceType';
|
|
8
|
+
export declare class CdfPointCloudStylableObjectProvider implements PointCloudStylableObjectProvider<ClassicDataSourceType> {
|
|
9
9
|
private readonly _sdk;
|
|
10
10
|
constructor(sdk: CogniteClient);
|
|
11
11
|
private annotationGeometryToRevealShapes;
|
|
12
12
|
private is3dObjectAnnotation;
|
|
13
13
|
private fetchAnnotations;
|
|
14
|
-
getPointCloudObjects(modelIdentifier:
|
|
14
|
+
getPointCloudObjects(modelIdentifier: ClassicModelIdentifierType): Promise<PointCloudObject[]>;
|
|
15
15
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { ClassicDataSourceType, ClassicModelIdentifierType } from '../DataSourceType';
|
|
5
5
|
import { PointCloudStylableObjectProvider } from '../PointCloudStylableObjectProvider';
|
|
6
6
|
import { PointCloudObject } from './types';
|
|
7
|
-
export declare class DummyPointCloudStylableObjectProvider implements PointCloudStylableObjectProvider {
|
|
8
|
-
getPointCloudObjects(_modelIdentifier:
|
|
7
|
+
export declare class DummyPointCloudStylableObjectProvider implements PointCloudStylableObjectProvider<ClassicDataSourceType> {
|
|
8
|
+
getPointCloudObjects(_modelIdentifier: ClassicModelIdentifierType): Promise<PointCloudObject[]>;
|
|
9
9
|
}
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { PointCloudObject, CdfPointCloudObjectAnnotation } from './types';
|
|
5
|
-
|
|
5
|
+
import { DataSourceType } from '../DataSourceType';
|
|
6
|
+
export declare function cdfAnnotationsToObjectInfo<T extends DataSourceType>(annotations: CdfPointCloudObjectAnnotation[]): PointCloudObject<T>[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
+
import { PointCloudStylableObjectProvider } from '../../PointCloudStylableObjectProvider';
|
|
6
|
+
import { PointCloudObject } from '../types';
|
|
7
|
+
import { DMDataSourceType, DMModelIdentifierType } from '../../DataSourceType';
|
|
8
|
+
export declare class CdfPointCloudDMStylableObjectProvider implements PointCloudStylableObjectProvider<DMDataSourceType> {
|
|
9
|
+
private readonly _dmsSdk;
|
|
10
|
+
constructor(sdk: CogniteClient);
|
|
11
|
+
getPointCloudObjects(modelIdentifier: DMModelIdentifierType): Promise<PointCloudObject<DMDataSourceType>[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { DMDataSourceType, DMModelIdentifierType } from '../../DataSourceType';
|
|
5
|
+
import { PointCloudStylableObjectProvider } from '../../PointCloudStylableObjectProvider';
|
|
6
|
+
import { PointCloudObject } from '../types';
|
|
7
|
+
export declare class DummyPointCloudDMStylableObjectProvider implements PointCloudStylableObjectProvider<DMDataSourceType> {
|
|
8
|
+
getPointCloudObjects(_modelIdentifier: DMModelIdentifierType): Promise<PointCloudObject<DMDataSourceType>[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataModelsSdk } from '../../DataModelsSdk';
|
|
2
|
+
import { CdfPointCloudObjectAnnotation } from '../types';
|
|
3
|
+
import { DMModelIdentifierType } from '../../DataSourceType';
|
|
4
|
+
export declare function getDMPointCloudObjects(dmsSdk: DataModelsSdk, modelIdentifier: DMModelIdentifierType): Promise<CdfPointCloudObjectAnnotation[]>;
|