@cognite/reveal 4.22.0 → 4.23.0-dev.20250122

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.
Files changed (79) hide show
  1. package/dist/api-entry-points/core.d.ts +3 -3
  2. package/dist/index.js +236 -204
  3. package/dist/index.js.map +1 -1
  4. package/dist/packages/360-images/index.d.ts +6 -2
  5. package/dist/packages/360-images/src/Image360Facade.d.ts +2 -2
  6. package/dist/packages/360-images/src/Image360History.d.ts +3 -2
  7. package/dist/packages/360-images/src/annotation/Image360AnnotationFilter.d.ts +2 -2
  8. package/dist/packages/360-images/src/annotation/Image360AnnotationIntersection.d.ts +3 -2
  9. package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +5 -5
  10. package/dist/packages/360-images/src/annotation/{BoxAnnotationData.d.ts → geometry/BoxAnnotationGeometryData.d.ts} +4 -4
  11. package/dist/packages/360-images/src/annotation/geometry/DmMesh3dAnnotationGeometryData.d.ts +15 -0
  12. package/dist/packages/360-images/src/annotation/geometry/ImageAnnotationGeometryData.d.ts +9 -0
  13. package/dist/packages/360-images/src/annotation/{PolygonAnnotationData.d.ts → geometry/PolygonAnnotationGeometryData.d.ts} +4 -4
  14. package/dist/packages/360-images/src/annotation/geometry/Vector3ArrayUtils.d.ts +9 -0
  15. package/dist/packages/360-images/src/annotation/geometry/createTriangleIndexesFromVectors.d.ts +5 -0
  16. package/dist/packages/360-images/src/annotation/geometry/utils.d.ts +5 -0
  17. package/dist/packages/360-images/src/annotation/getInstanceId.d.ts +6 -0
  18. package/dist/packages/360-images/src/annotation/typeGuards.d.ts +8 -0
  19. package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +12 -12
  20. package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +16 -11
  21. package/dist/packages/360-images/src/collection/Image360Collection.d.ts +34 -16
  22. package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +6 -6
  23. package/dist/packages/360-images/src/collection/createCollectionIdString.d.ts +5 -0
  24. package/dist/packages/360-images/src/entity/Image360.d.ts +2 -1
  25. package/dist/packages/360-images/src/entity/Image360Entity.d.ts +4 -4
  26. package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +9 -3
  27. package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +1 -0
  28. package/dist/packages/360-images/src/types.d.ts +6 -2
  29. package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +3 -5
  30. package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +1 -1
  31. package/dist/packages/data-providers/index.d.ts +11 -6
  32. package/dist/packages/data-providers/src/DataModelsSdk.d.ts +2 -1
  33. package/dist/packages/data-providers/src/DataSourceType.d.ts +7 -4
  34. package/dist/packages/data-providers/src/Image360Provider.d.ts +6 -4
  35. package/dist/packages/data-providers/src/Image360ProviderCombiner.d.ts +21 -0
  36. package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageAnnotationProvider.d.ts +20 -0
  37. package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageFileProvider.d.ts +10 -0
  38. package/dist/packages/data-providers/src/image-360-data-providers/CdfImageFileProvider.d.ts +15 -0
  39. package/dist/packages/data-providers/src/image-360-data-providers/CoreDm360ImageAnnotationProvider.d.ts +16 -0
  40. package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts +11 -6
  41. package/dist/packages/data-providers/src/image-360-data-providers/cdm/fetchAnnotationsForInstance.d.ts +98 -0
  42. package/dist/packages/data-providers/src/image-360-data-providers/cdm/fetchCoreDm360AnnotationsForCollection.d.ts +126 -0
  43. package/dist/packages/data-providers/src/image-360-data-providers/cdm/fetchCoreDm360AnnotationsForRevision.d.ts +103 -0
  44. package/dist/packages/data-providers/src/image-360-data-providers/cdm/getImage360Map.d.ts +8 -0
  45. package/dist/packages/data-providers/src/image-360-data-providers/cdm/getObject3dAssetMap.d.ts +9 -0
  46. package/dist/packages/data-providers/src/image-360-data-providers/cdm/properties.d.ts +36 -0
  47. package/dist/packages/data-providers/src/image-360-data-providers/cdm/queryFilters.d.ts +23 -0
  48. package/dist/packages/data-providers/src/image-360-data-providers/cdm/queryNodesAndEdges.d.ts +40 -0
  49. package/dist/packages/data-providers/src/image-360-data-providers/cdm/queryProperties.d.ts +4 -0
  50. package/dist/packages/data-providers/src/image-360-data-providers/cdm/sources.d.ts +42 -0
  51. package/dist/packages/data-providers/src/image-360-data-providers/cdm/transformCdmAnnotations.d.ts +4 -0
  52. package/dist/packages/data-providers/src/image-360-data-providers/cdm/types.d.ts +51 -0
  53. package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/datamodels/cdm/Cdf360CdmDescriptorProvider.d.ts +3 -2
  54. package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/datamodels/system-space/Cdf360DataModelsDescriptorProvider.d.ts +27 -5
  55. package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/events/Cdf360EventDescriptorProvider.d.ts +3 -2
  56. package/dist/packages/data-providers/src/image-360-data-providers/shared.d.ts +18 -0
  57. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudVolumeCollectionQuery.d.ts +1 -1
  58. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/types.d.ts +1 -1
  59. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/utils.d.ts +1 -1
  60. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/types.d.ts +2 -7
  61. package/dist/packages/data-providers/src/types.d.ts +41 -24
  62. package/dist/packages/data-providers/src/utilities/constants.d.ts +6 -0
  63. package/dist/packages/pointcloud-styling/src/PointCloudDMVolumeCollection.d.ts +1 -1
  64. package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +1 -1
  65. package/dist/packages/pointclouds/src/potree-three-loader/Potree.d.ts +0 -1
  66. package/dist/packages/pointclouds/src/potree-three-loader/tree/IPointCloudTreeNodeBase.d.ts +0 -1
  67. package/dist/packages/pointclouds/src/potree-three-loader/tree/PointCloudOctree.d.ts +0 -3
  68. package/dist/packages/pointclouds/src/potree-three-loader/tree/PointCloudOctreeNode.d.ts +1 -2
  69. package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectIdMaps.d.ts +2 -2
  70. package/dist/packages/utilities/index.d.ts +1 -0
  71. package/dist/packages/utilities/src/fdm/index.d.ts +6 -0
  72. package/dist/packages/utilities/src/fdm/toKey.d.ts +6 -0
  73. package/dist/packages/utilities/src/fdm/typeGuards.d.ts +5 -0
  74. package/dist/packages/utilities/src/fdm/types.d.ts +13 -0
  75. package/package.json +1 -1
  76. package/dist/packages/360-images/src/annotation/ImageAnnotationData.d.ts +0 -9
  77. package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageProvider.d.ts +0 -25
  78. package/dist/packages/data-providers/src/image-360-data-providers/descriptor-providers/Cdf360CombinedDescriptorProvider.d.ts +0 -16
  79. package/dist/packages/pointclouds/src/potree-three-loader/utils/box3-helper.d.ts +0 -13
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export { Image360, Image360IconStyle } from './src/entity/Image360';
5
5
  export { Image360Revision } from './src/entity/Image360Revision';
6
- export { Image360Collection, Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult, AssetAnnotationImage360Info } from './src/collection/Image360Collection';
6
+ export { Image360Collection, Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult, InstanceLinkable360ImageAnnotationType, AssetAnnotationImage360Info } from './src/collection/Image360Collection';
7
7
  export { Image360Facade } from './src/Image360Facade';
8
8
  export { Image360CollectionFactory } from './src/collection/Image360CollectionFactory';
9
9
  export { Image360Entity } from './src/entity/Image360Entity';
@@ -15,5 +15,9 @@ export { Image360AnnotationIntersection } from './src/annotation/Image360Annotat
15
15
  export { Image360Annotation } from './src/annotation/Image360Annotation';
16
16
  export { DefaultImage360Collection } from './src/collection/DefaultImage360Collection';
17
17
  export { IconsOptions } from './src/icons/IconCollection';
18
- export { Image360History } from './src/Image360History';
18
+ export { Image360CollectionSourceType, Image360IconIntersectionData } from './src/types';
19
+ export { Image360AnnotationFilter } from './src/annotation/Image360AnnotationFilter';
20
+ export { DEFAULT_IMAGE_360_OPACITY } from './src/entity/Image360VisualizationBox';
19
21
  export { Image360Action } from './src/Image360Action';
22
+ export { Image360History } from './src/Image360History';
23
+ export { createCollectionIdString } from './src/collection/createCollectionIdString';
@@ -22,8 +22,8 @@ export declare class Image360Facade<T extends DataSourceType> {
22
22
  setHoverIconVisibilityForEntity(entity: Image360Entity<T>, visible: boolean): void;
23
23
  hideAllHoverIcons(): boolean;
24
24
  set allIconCullingScheme(scheme: IconCullingScheme);
25
- constructor(_entityFactory: Image360CollectionFactory<T>);
26
- create(dataProviderFilter: T['image360Identifier'], annotationFilter?: Image360AnnotationFilterOptions, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection<T>>;
25
+ constructor(_entityFactory: Image360CollectionFactory);
26
+ create<Image360CollectionSourceType extends DataSourceType>(collectionIdentifier: Image360CollectionSourceType['image360Identifier'], annotationFilter?: Image360AnnotationFilterOptions, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection<T>>;
27
27
  removeSet(collection: DefaultImage360Collection<T>): void;
28
28
  delete(entity: Image360Entity<T>): Promise<void>;
29
29
  preload(entity: Image360Entity<T>, revision: Image360RevisionEntity<T>, lockDownload?: boolean): Promise<void>;
@@ -1,15 +1,16 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
+ import { DataSourceType } from '../../data-providers';
4
5
  import { Image360 } from './entity/Image360';
5
6
  import { Image360Action } from './Image360Action';
6
7
  export declare class Image360History {
7
8
  private readonly _images;
8
9
  private _currentIndex;
9
- start(image: Image360): void;
10
+ start(image: Image360<DataSourceType>): void;
10
11
  private current;
11
12
  clear(): void;
12
13
  private isLegalIndex;
13
14
  canDoAction(action: Image360Action): boolean;
14
- doAction(action: Image360Action): Image360 | undefined;
15
+ doAction(action: Image360Action): Image360<DataSourceType> | undefined;
15
16
  }
@@ -1,12 +1,12 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { AnnotationModel } from '@cognite/sdk';
5
4
  import { Image360AnnotationFilterOptions } from './types';
5
+ import { DataSourceType } from '../../../data-providers';
6
6
  export declare class Image360AnnotationFilter {
7
7
  private readonly _annotationFilter;
8
8
  private fillDefaultAnnotationOptionValues;
9
9
  constructor(options: Image360AnnotationFilterOptions);
10
10
  private filterStatus;
11
- filter(annotation: AnnotationModel): boolean;
11
+ filter(annotation: DataSourceType['image360AnnotationType']): boolean;
12
12
  }
@@ -1,12 +1,13 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
+ import { ClassicDataSourceType, DataSourceType } from '../../../data-providers';
4
5
  import { Image360Annotation } from './Image360Annotation';
5
6
  import { Vector3 } from 'three';
6
7
  /**
7
8
  * Describes an intersection with a 360 image annotation
8
9
  */
9
- export type Image360AnnotationIntersection = {
10
+ export type Image360AnnotationIntersection<T extends DataSourceType = ClassicDataSourceType> = {
10
11
  /**
11
12
  * The intersection type.
12
13
  */
@@ -14,7 +15,7 @@ export type Image360AnnotationIntersection = {
14
15
  /**
15
16
  * The intersected annotation
16
17
  */
17
- annotation: Image360Annotation;
18
+ annotation: Image360Annotation<T>;
18
19
  /**
19
20
  * The world direction from the camera to the intersection point
20
21
  */
@@ -1,9 +1,8 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { AnnotationModel } from '@cognite/sdk';
5
4
  import { DataSourceType, Image360FileDescriptor } from '../../../data-providers';
6
- import { Color, Vector3, Object3D, Raycaster } from 'three';
5
+ import { Color, Matrix4, Vector3, Object3D, Raycaster } from 'three';
7
6
  import { Image360Annotation } from './Image360Annotation';
8
7
  import { Image360AnnotationAppearance } from './types';
9
8
  type FaceType = Image360FileDescriptor['face'];
@@ -15,11 +14,12 @@ export declare class ImageAnnotationObject<T extends DataSourceType> implements
15
14
  private readonly _objectGroup;
16
15
  private _defaultAppearance;
17
16
  private readonly _appearance;
18
- get annotation(): AnnotationModel;
19
- static createAnnotationObject<StaticT extends DataSourceType>(annotation: AnnotationModel, face: FaceType): ImageAnnotationObject<StaticT> | undefined;
17
+ get annotation(): T['image360AnnotationType'];
18
+ static createAnnotationObject<StaticT extends DataSourceType>(annotation: StaticT['image360AnnotationType'], face: FaceType | undefined, visualizationBoxTransform: Matrix4): ImageAnnotationObject<StaticT> | undefined;
20
19
  private static createObjectData;
21
- private static createObjectDetectionAnnotationData;
20
+ private static createObjectDetectionAnnotationGeometry;
22
21
  private static createAssetLinkAnnotationData;
22
+ private static createFdmAnnotationData;
23
23
  private constructor();
24
24
  private getRotationFromFace;
25
25
  private initializeTransform;
@@ -1,10 +1,10 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { ImageAnnotationObjectData } from './ImageAnnotationData';
5
- import { BufferGeometry, Matrix4, PlaneGeometry, Vector2 } from 'three';
4
+ import { ImageAnnotationObjectGeometryData } from './ImageAnnotationGeometryData';
5
+ import { BufferGeometry, Matrix4, PlaneGeometry, Vector3 } from 'three';
6
6
  import { AnnotationsBoundingBox } from '@cognite/sdk';
7
- export declare class BoxAnnotationData implements ImageAnnotationObjectData {
7
+ export declare class BoxAnnotationGeometryData implements ImageAnnotationObjectGeometryData {
8
8
  private readonly _geometry;
9
9
  private readonly _initialTranslation;
10
10
  private readonly _outline;
@@ -12,5 +12,5 @@ export declare class BoxAnnotationData implements ImageAnnotationObjectData {
12
12
  createGeometry(annotationsBox: AnnotationsBoundingBox): PlaneGeometry;
13
13
  getGeometry(): BufferGeometry;
14
14
  getNormalizationMatrix(): Matrix4;
15
- getOutlinePoints(): Vector2[];
15
+ getOutlinePoints(): Vector3[];
16
16
  }
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { BufferGeometry, Matrix4, Vector3 } from 'three';
5
+ import { ImageAnnotationObjectGeometryData } from './ImageAnnotationGeometryData';
6
+ export declare class DmMesh3dAnnotationGeometryData implements ImageAnnotationObjectGeometryData {
7
+ private readonly _geometry;
8
+ private readonly _outlinePoints;
9
+ private readonly _inverseVisualizationBoxTransform;
10
+ constructor(positions: Vector3[], visualizationBoxTransform: Matrix4);
11
+ createGeometry(points: Vector3[]): BufferGeometry;
12
+ getGeometry(): BufferGeometry;
13
+ getNormalizationMatrix(): Matrix4;
14
+ getOutlinePoints(): Vector3[];
15
+ }
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { BufferGeometry, Matrix4, Vector3 } from 'three';
5
+ export interface ImageAnnotationObjectGeometryData {
6
+ getGeometry(): BufferGeometry;
7
+ getOutlinePoints(): Vector3[];
8
+ getNormalizationMatrix(): Matrix4;
9
+ }
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { BufferGeometry, Matrix4, ShapeGeometry, Vector2 } from 'three';
4
+ import { BufferGeometry, Matrix4, ShapeGeometry, Vector3 } from 'three';
5
5
  import { AnnotationsPolygon } from '@cognite/sdk';
6
- import { ImageAnnotationObjectData } from './ImageAnnotationData';
7
- export declare class PolygonAnnotationData implements ImageAnnotationObjectData {
6
+ import { ImageAnnotationObjectGeometryData } from './ImageAnnotationGeometryData';
7
+ export declare class PolygonAnnotationGeometryData implements ImageAnnotationObjectGeometryData {
8
8
  private readonly _geometry;
9
9
  private readonly _outlinePoints;
10
10
  constructor(polygon: AnnotationsPolygon);
11
11
  createGeometry(polygon: AnnotationsPolygon): ShapeGeometry;
12
12
  getGeometry(): BufferGeometry;
13
13
  getNormalizationMatrix(): Matrix4;
14
- getOutlinePoints(): Vector2[];
14
+ getOutlinePoints(): Vector3[];
15
15
  }
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { Box3, Vector3 } from 'three';
5
+ export declare class Vector3ArrayUtils {
6
+ static getSignedHorizontalArea(polygon: Vector3[]): number;
7
+ static getCenter(points: Vector3[]): Vector3;
8
+ static getBoundingBox(points: Vector3[]): Box3;
9
+ }
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { Vector3 } from 'three';
5
+ export declare function createTriangleIndexesFromVectors(vectors: Vector3[]): number[] | undefined;
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { Vector2, Vector3 } from 'three';
5
+ export declare function convertPointsTo3d(points: Vector2[]): Vector3[];
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { DataSourceType } from '../../../data-providers';
5
+ import { InstanceReference } from '../../../data-providers/src/types';
6
+ export declare function getInstanceIdFromAnnotation<T extends DataSourceType>(annotation: T['image360AnnotationType']): InstanceReference<T> | undefined;
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { AnnotationData, AnnotationsCogniteAnnotationTypesImagesAssetLink, AnnotationsObjectDetection, AnnotationType } from '@cognite/sdk';
5
+ import { DataSourceType, DMDataSourceType } from '../../../data-providers';
6
+ export declare function isCoreDmImage360Annotation(annotation: DataSourceType['image360AnnotationType']): annotation is DMDataSourceType['image360AnnotationType'];
7
+ export declare function isAnnotationsObjectDetection(annotationType: AnnotationType, annotation: AnnotationData): annotation is AnnotationsObjectDetection;
8
+ export declare function isAnnotationAssetLink(annotationType: AnnotationType, annotation: AnnotationData): annotation is AnnotationsCogniteAnnotationTypesImagesAssetLink;
@@ -4,29 +4,29 @@
4
4
  import { Image360Entity } from '../entity/Image360Entity';
5
5
  import { Image360RevisionEntity } from '../entity/Image360RevisionEntity';
6
6
  import { DataSourceType } from '../../../data-providers';
7
- export type DownloadRequest = {
8
- entity: Image360Entity<DataSourceType>;
9
- revision: Image360RevisionEntity<DataSourceType>;
7
+ export type DownloadRequest<T extends DataSourceType> = {
8
+ entity: Image360Entity<T>;
9
+ revision: Image360RevisionEntity<T>;
10
10
  anyCompleted: Promise<void>;
11
11
  allCompleted: Promise<void>;
12
12
  abort: () => void;
13
13
  };
14
- export type Loaded360Image = {
15
- entity: Image360Entity<DataSourceType>;
16
- revision: Image360RevisionEntity<DataSourceType>;
14
+ export type Loaded360Image<T extends DataSourceType> = {
15
+ entity: Image360Entity<T>;
16
+ revision: Image360RevisionEntity<T>;
17
17
  };
18
- export declare class Image360LoadingCache {
18
+ export declare class Image360LoadingCache<T extends DataSourceType> {
19
19
  private readonly _imageCacheSize;
20
20
  private readonly _downloadCacheSize;
21
21
  private readonly _loaded360Images;
22
22
  private readonly _inProgressDownloads;
23
23
  private _lockedDownload;
24
- get cachedRevisions(): Image360RevisionEntity<DataSourceType>[];
25
- get currentlyLoadingEntities(): DownloadRequest[];
26
- getDownloadInProgress(revision: Image360RevisionEntity<DataSourceType>): DownloadRequest | undefined;
24
+ get cachedRevisions(): Image360RevisionEntity<T>[];
25
+ get currentlyLoadingEntities(): DownloadRequest<T>[];
26
+ getDownloadInProgress(revision: Image360RevisionEntity<T>): DownloadRequest<T> | undefined;
27
27
  constructor(_imageCacheSize?: number, _downloadCacheSize?: number);
28
- cachedPreload(entity: Image360Entity<DataSourceType>, revision: Image360RevisionEntity<DataSourceType>, lockDownload?: boolean): Promise<void>;
29
- purge(entity: Image360Entity<DataSourceType>): Promise<void>;
28
+ cachedPreload(entity: Image360Entity<T>, revision: Image360RevisionEntity<T>, lockDownload?: boolean): Promise<void>;
29
+ purge(entity: Image360Entity<T>): Promise<void>;
30
30
  private cacheWhenAllComplete;
31
31
  private purgeFromInProgressDownloads;
32
32
  private addRevisionToCache;
@@ -7,10 +7,10 @@ import { Image360Entity } from '../entity/Image360Entity';
7
7
  import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
8
8
  import { IconCollection, IconCullingScheme } from '../icons/IconCollection';
9
9
  import { Image360AnnotationAppearance } from '../annotation/types';
10
- import { IdEither } from '@cognite/sdk';
11
- import { DataSourceType, Image360DataProvider } from '../../../data-providers';
10
+ import { ClassicDataSourceType, DataSourceType, DMDataSourceType, Image360FileDescriptor, Image360Provider } from '../../../data-providers';
12
11
  import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
13
12
  import { Matrix4 } from 'three';
13
+ import { InstanceReference } from '../../../data-providers/src/types';
14
14
  /**
15
15
  * Default implementation of {@link Image360Collection}. Used for events when entering
16
16
  * and exiting 360 image mode
@@ -35,6 +35,10 @@ export declare class DefaultImage360Collection<T extends DataSourceType> impleme
35
35
  private readonly _collectionId;
36
36
  private readonly _collectionLabel;
37
37
  private readonly _setNeedsRedraw;
38
+ get collectionId(): T['image360Identifier'];
39
+ /**
40
+ * @deprecated
41
+ */
38
42
  get id(): string;
39
43
  get label(): string | undefined;
40
44
  get targetRevisionDate(): Date | undefined;
@@ -43,11 +47,11 @@ export declare class DefaultImage360Collection<T extends DataSourceType> impleme
43
47
  * The events from the image collection.
44
48
  */
45
49
  get events(): {
46
- image360Entered: EventTrigger<Image360EnteredDelegate>;
50
+ image360Entered: EventTrigger<Image360EnteredDelegate<T>>;
47
51
  image360Exited: EventTrigger<Image360ExitedDelegate>;
48
52
  };
49
53
  get isCollectionVisible(): boolean;
50
- constructor(collectionId: string, collectionLabel: string | undefined, entities: Image360Entity<T>[], icons: IconCollection, annotationFilter: Image360AnnotationFilter, image360DataProvider: Image360DataProvider, setNeedsRedraw: () => void);
54
+ constructor(identifier: T['image360Identifier'], collectionLabel: string | undefined, entities: Image360Entity<T>[], icons: IconCollection, annotationFilter: Image360AnnotationFilter, image360DataProvider: Image360Provider<T>, setNeedsRedraw: () => void);
51
55
  getModelTransformation(out?: Matrix4): Matrix4;
52
56
  setModelTransformation(matrix: Matrix4): void;
53
57
  /**
@@ -57,7 +61,7 @@ export declare class DefaultImage360Collection<T extends DataSourceType> impleme
57
61
  * @param event The event type.
58
62
  * @param callback Callback to be called when the event is fired.
59
63
  */
60
- on(event: 'image360Entered', callback: Image360EnteredDelegate): void;
64
+ on(event: 'image360Entered', callback: Image360EnteredDelegate<T>): void;
61
65
  on(event: 'image360Exited', callback: Image360ExitedDelegate): void;
62
66
  /**
63
67
  * Specify parameters used to determine the number of icons that are visible when entering 360 Images.
@@ -78,7 +82,7 @@ export declare class DefaultImage360Collection<T extends DataSourceType> impleme
78
82
  * @param event The event type.
79
83
  * @param callback Callback function to be unsubscribed.
80
84
  */
81
- off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
85
+ off(event: 'image360Entered', callback: Image360EnteredDelegate<T>): void;
82
86
  off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
83
87
  setSelectedForAll(selected: boolean): void;
84
88
  setSelectedVisibility(visible: boolean): boolean;
@@ -89,9 +93,10 @@ export declare class DefaultImage360Collection<T extends DataSourceType> impleme
89
93
  resetRedraw(): void;
90
94
  getDefaultAnnotationStyle(): Image360AnnotationAppearance;
91
95
  setDefaultAnnotationStyle(defaultStyle: Image360AnnotationAppearance): void;
92
- findImageAnnotations(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
93
- getAssetIds(): Promise<IdEither[]>;
94
- getAnnotationsInfo(): Promise<AssetAnnotationImage360Info<T>[]>;
95
- private getAllFileDescriptors;
96
- private createFileIdToEntityRevisionMap;
96
+ findImageAnnotations(filter: Image360AnnotationAssetFilter<T>): Promise<Image360AnnotationAssetQueryResult<T>[]>;
97
+ getAssetIds(): Promise<InstanceReference<T>[]>;
98
+ getAnnotationsInfo(source: 'assets'): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[]>;
99
+ getAnnotationsInfo(source: 'cdm'): Promise<AssetAnnotationImage360Info<DMDataSourceType>[]>;
100
+ getAnnotationsInfo(source: 'all'): Promise<AssetAnnotationImage360Info<DataSourceType>[]>;
101
+ getAllFileDescriptors(): Image360FileDescriptor[];
97
102
  }
@@ -7,16 +7,22 @@ import { Image360AnnotationAppearance } from '../annotation/types';
7
7
  import { Image360Revision } from '../entity/Image360Revision';
8
8
  import { IdEither } from '@cognite/sdk';
9
9
  import { Image360Annotation } from '../annotation/Image360Annotation';
10
- import { ClassicDataSourceType, DataSourceType, ImageAssetLinkAnnotationInfo } from '../../../data-providers';
10
+ import { ClassicDataSourceType, DataSourceType, DMDataSourceType } from '../../../data-providers';
11
11
  import { Matrix4 } from 'three';
12
+ import { ImageAssetLinkAnnotationInfo, InstanceReference } from '../../../data-providers';
13
+ /**
14
+ * Annotation type that may be linked to assets. Only relevant for classic annotations, where some
15
+ * annotation types are visible in Reveal, but not linkable to assets
16
+ */
17
+ export type InstanceLinkable360ImageAnnotationType<T extends DataSourceType> = T extends ClassicDataSourceType ? ImageAssetLinkAnnotationInfo : T['image360AnnotationType'];
12
18
  /**
13
19
  * Filter for finding annotations related to an asset
14
20
  */
15
- export type Image360AnnotationAssetFilter = {
21
+ export type Image360AnnotationAssetFilter<T extends DataSourceType = ClassicDataSourceType> = {
16
22
  /**
17
23
  * Reference to the wanted asset
18
24
  */
19
- assetRef: IdEither;
25
+ assetRef: InstanceReference<T>;
20
26
  };
21
27
  /**
22
28
  * Asset search return type, including information about the image in which the asset is found
@@ -25,7 +31,7 @@ export type AssetAnnotationImage360Info<T extends DataSourceType = ClassicDataSo
25
31
  /**
26
32
  * Reference to the relevant asset
27
33
  */
28
- annotationInfo: ImageAssetLinkAnnotationInfo;
34
+ annotationInfo: InstanceLinkable360ImageAnnotationType<T>;
29
35
  /**
30
36
  * The image entity in which the asset was found
31
37
  */
@@ -38,19 +44,19 @@ export type AssetAnnotationImage360Info<T extends DataSourceType = ClassicDataSo
38
44
  /**
39
45
  * Result item from an asset annotation query
40
46
  */
41
- export type Image360AnnotationAssetQueryResult = {
47
+ export type Image360AnnotationAssetQueryResult<T extends DataSourceType = ClassicDataSourceType> = {
42
48
  /**
43
49
  * The Image360 to which the result annotation belongs
44
50
  */
45
- image: Image360;
51
+ image: Image360<T>;
46
52
  /**
47
53
  * The image revision to which the result annotation belongs
48
54
  */
49
- revision: Image360Revision;
55
+ revision: Image360Revision<T>;
50
56
  /**
51
57
  * The found annotation
52
58
  */
53
- annotation: Image360Annotation;
59
+ annotation: Image360Annotation<T>;
54
60
  };
55
61
  /**
56
62
  * A wrapper that represents a set of 360 images.
@@ -137,14 +143,14 @@ export interface Image360Collection<T extends DataSourceType = ClassicDataSource
137
143
  * @param event The event type.
138
144
  * @param callback Callback to be called when the event is fired.
139
145
  */
140
- on(event: 'image360Entered', callback: Image360EnteredDelegate): void;
146
+ on(event: 'image360Entered', callback: Image360EnteredDelegate<T>): void;
141
147
  on(event: 'image360Exited', callback: Image360ExitedDelegate): void;
142
148
  /**
143
149
  * Unsubscribes from 360 image dataset event.
144
150
  * @param event The event type.
145
151
  * @param callback Callback function to be unsubscribed.
146
152
  */
147
- off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
153
+ off(event: 'image360Entered', callback: Image360EnteredDelegate<T>): void;
148
154
  off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
149
155
  /**
150
156
  * Get the assigned default style affecting all annotations
@@ -157,18 +163,30 @@ export interface Image360Collection<T extends DataSourceType = ClassicDataSource
157
163
  /**
158
164
  * Find 360 images associated with an asset through CDF annotations
159
165
  */
160
- findImageAnnotations(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
166
+ findImageAnnotations(filter: Image360AnnotationAssetFilter<T>): Promise<Image360AnnotationAssetQueryResult<T>[]>;
161
167
  /**
162
168
  * Get IDs of all CDF assets associated with this 360 image collection through CDF annotations
163
169
  *
164
- * @deprecated Use {@link Image360Collection.getAnnotationsInfo}
170
+ * @deprecated Use {@link Image360Collection['getAnnotationsInfo']}
165
171
  */
166
172
  getAssetIds(): Promise<IdEither[]>;
167
173
  /**
168
- * Get IDs of all CDF assets and related image/revision associated with this
169
- * 360 image collection through CDF annotations
174
+ * Fetches annotations from all available sources
175
+ */
176
+ getAnnotationsInfo(source: 'all'): Promise<AssetAnnotationImage360Info<DataSourceType>[]>;
177
+ /**
178
+ * Fetches annotations from the CDF Annotation APIs, which are linked to CDF assets
179
+ */
180
+ getAnnotationsInfo(source: 'assets'): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[]>;
181
+ /**
182
+ * Fetches annotations from the CDF Core Data Model
183
+ */
184
+ getAnnotationsInfo(source: 'cdm'): Promise<AssetAnnotationImage360Info<DMDataSourceType>[]>;
185
+ /**
186
+ * Get info of assets and annotations associated with this
187
+ * 360 image collection through various sources
170
188
  *
171
- * @param source What source data to pull the annotation info from
189
+ * @param source What source data to pull the annotation info from. Must be `'asset'`, `'cdm'` or `'all'`
172
190
  */
173
- getAnnotationsInfo(source: 'assets'): Promise<AssetAnnotationImage360Info<T>[]>;
191
+ getAnnotationsInfo(source: 'assets' | 'cdm' | 'all'): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[] | AssetAnnotationImage360Info<DMDataSourceType> | AssetAnnotationImage360Info<DataSourceType>[]>;
174
192
  }
@@ -1,20 +1,20 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { Image360Provider } from '../../../data-providers';
4
+ import { DataSourceType } from '../../../data-providers';
5
5
  import { BeforeSceneRenderedDelegate, DeviceDescriptor, EventTrigger, SceneHandler } from '../../../utilities';
6
6
  import { DefaultImage360Collection } from './DefaultImage360Collection';
7
7
  import { IconsOptions } from '../icons/IconCollection';
8
8
  import { type Matrix4 } from 'three';
9
9
  import { Image360AnnotationFilterOptions } from '../annotation/types';
10
- import { GenericDataSourceType } from '../../../data-providers';
11
- export declare class Image360CollectionFactory<T extends GenericDataSourceType> {
12
- private readonly _image360DataProvider;
10
+ import { Image360ProviderMap } from '../../../data-providers/src/Image360Provider';
11
+ export declare class Image360CollectionFactory {
12
+ private readonly _image360ProviderMap;
13
13
  private readonly _sceneHandler;
14
14
  private readonly _onBeforeSceneRendered;
15
15
  private readonly _iconsOptions;
16
16
  private readonly _device;
17
17
  private readonly _setNeedsRedraw;
18
- constructor(image360DataProvider: Image360Provider<T['image360Identifier']>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, setNeedsRedraw: () => void, device: DeviceDescriptor, iconsOptions?: IconsOptions);
19
- create(dataProviderFilter: T['image360Identifier'], postTransform: Matrix4, preMultipliedRotation: boolean, annotationFilter: Image360AnnotationFilterOptions): Promise<DefaultImage360Collection<T>>;
18
+ constructor(image360ProviderMap: Image360ProviderMap, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, setNeedsRedraw: () => void, device: DeviceDescriptor, iconsOptions?: IconsOptions);
19
+ create<T extends DataSourceType>(image360Identifier: T['image360Identifier'], postTransform: Matrix4, preMultipliedRotation: boolean, annotationFilter: Image360AnnotationFilterOptions): Promise<DefaultImage360Collection<T>>;
20
20
  }
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { DataSourceType } from '../../../data-providers';
5
+ export declare function createCollectionIdString(id: DataSourceType['image360Identifier']): string;
@@ -5,6 +5,7 @@ import { ClassicDataSourceType, DataSourceType } from '../../../data-providers';
5
5
  import { Image360Revision } from './Image360Revision';
6
6
  import { Image360Visualization } from './Image360Visualization';
7
7
  import { Color, type Matrix4 } from 'three';
8
+ import { Image360Id } from '../../../data-providers/src/types';
8
9
  /**
9
10
  * Image360 icon style
10
11
  */
@@ -34,7 +35,7 @@ export interface Image360<T extends DataSourceType = ClassicDataSourceType> {
34
35
  * Get Id of 360 image entity.
35
36
  * @returns Station Id
36
37
  */
37
- readonly id: string;
38
+ readonly id: Image360Id<T>;
38
39
  /**
39
40
  * Get label of 360 image entity.
40
41
  * @returns Station label
@@ -2,9 +2,9 @@
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
4
  import { DeviceDescriptor, SceneHandler } from '../../../utilities';
5
- import { DataSourceType, Image360DataProvider } from '../../../data-providers';
5
+ import { DataSourceType, Image360Provider } from '../../../data-providers';
6
6
  import { Image360 } from './Image360';
7
- import { Historical360ImageSet } from '../../../data-providers/src/types';
7
+ import { Historical360ImageSet, Image360RevisionId } from '../../../data-providers/src/types';
8
8
  import { Image360RevisionEntity } from './Image360RevisionEntity';
9
9
  import { Image360VisualizationBox } from './Image360VisualizationBox';
10
10
  import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
@@ -41,13 +41,13 @@ export declare class Image360Entity<T extends DataSourceType> implements Image36
41
41
  * Get Id of 360 image entity.
42
42
  * @returns Station Id
43
43
  */
44
- get id(): string;
44
+ get id(): Image360RevisionId<T>;
45
45
  /**
46
46
  * Get label of 360 image entity.
47
47
  * @returns Station label
48
48
  * */
49
49
  get label(): string | undefined;
50
- constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, annotationFilterer: Image360AnnotationFilter, transform: Matrix4, icon: Overlay3DIcon, device: DeviceDescriptor);
50
+ constructor(image360Metadata: Historical360ImageSet<T>, sceneHandler: SceneHandler, imageProvider: Image360Provider<T>, annotationFilterer: Image360AnnotationFilter, transform: Matrix4, icon: Overlay3DIcon, device: DeviceDescriptor);
51
51
  setWorldTransform(matrix: Matrix4): void;
52
52
  /**
53
53
  * List all historical images for this entity.
@@ -1,13 +1,14 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
- import { Image360DataProvider, Image360Descriptor, DataSourceType } from '../../../data-providers';
4
+ import { Image360Descriptor, DataSourceType, Image360Provider } from '../../../data-providers';
5
5
  import { Image360Revision } from './Image360Revision';
6
6
  import { Image360VisualizationBox } from './Image360VisualizationBox';
7
7
  import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
8
8
  import { type Raycaster } from 'three';
9
9
  import { Image360AnnotationAppearance } from '../annotation/types';
10
10
  import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
11
+ import { Image360RevisionId } from '../../../data-providers/src/types';
11
12
  export declare class Image360RevisionEntity<T extends DataSourceType> implements Image360Revision<T> {
12
13
  private readonly _imageProvider;
13
14
  private readonly _image360Descriptor;
@@ -16,10 +17,15 @@ export declare class Image360RevisionEntity<T extends DataSourceType> implements
16
17
  private _fullResolutionTextures;
17
18
  private _onFullResolutionCompleted;
18
19
  private _defaultAppearance;
20
+ private readonly _identifier;
19
21
  private _annotations;
20
22
  private _annotationsPromise;
21
23
  private readonly _annotationFilterer;
22
- constructor(imageProvider: Image360DataProvider, image360Descriptor: Image360Descriptor, image360VisualizationBox: Image360VisualizationBox, annotationFilterer: Image360AnnotationFilter);
24
+ constructor(imageProvider: Image360Provider<T>, image360Descriptor: Image360Descriptor<T>, image360VisualizationBox: Image360VisualizationBox, annotationFilterer: Image360AnnotationFilter);
25
+ /**
26
+ * The identifier of this image 360 revision
27
+ */
28
+ get identifier(): Image360RevisionId<T>;
23
29
  /**
24
30
  * The date of this revision. Undefined if the revision is undated.
25
31
  * @returns Date | undefined
@@ -60,5 +66,5 @@ export declare class Image360RevisionEntity<T extends DataSourceType> implements
60
66
  * This has no effect if full resolution has already been applied.
61
67
  */
62
68
  applyFullResolutionTextures(): Promise<void>;
63
- getDescriptors(): Image360Descriptor;
69
+ getDescriptors(): Image360Descriptor<T>;
64
70
  }
@@ -29,6 +29,7 @@ export declare class Image360VisualizationBox implements Image360Visualization {
29
29
  constructor(worldTransform: THREE.Matrix4, sceneHandler: SceneHandler, device: DeviceDescriptor);
30
30
  setWorldTransform(matrix: THREE.Matrix4): void;
31
31
  loadImages(textures: Image360Texture[]): void;
32
+ getTransform(): THREE.Matrix4;
32
33
  loadFaceTextures(faces: Image360Face[]): Promise<Image360Texture[]>;
33
34
  unloadImages(): void;
34
35
  private getScaledImageTexture;
@@ -4,13 +4,17 @@
4
4
  import { Vector3 } from 'three';
5
5
  import { Image360 } from './entity/Image360';
6
6
  import { Image360Revision } from './entity/Image360Revision';
7
- import { DataSourceType } from '../../data-providers';
7
+ import { ClassicDataSourceType, DataSourceType } from '../../data-providers';
8
8
  import { Image360Entity } from './entity/Image360Entity';
9
9
  import { DefaultImage360Collection } from './collection/DefaultImage360Collection';
10
+ /**
11
+ * The SourceType of a 360 image collection
12
+ */
13
+ export type Image360CollectionSourceType = 'event' | 'dm' | 'cdm';
10
14
  /**
11
15
  * Delegate for 360 image mode entered events.
12
16
  */
13
- export type Image360EnteredDelegate = (image360: Image360, revision: Image360Revision) => void;
17
+ export type Image360EnteredDelegate<T extends DataSourceType = ClassicDataSourceType> = (image360: Image360<T>, revision: Image360Revision<T>) => void;
14
18
  /**
15
19
  * Delegate for 360 image mode exited events.
16
20
  */