@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
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import type { DirectRelationReference } from '@cognite/sdk';
5
+ export type AssetSimpleProperties = {
6
+ object3D: DirectRelationReference;
7
+ name: string;
8
+ description: string;
9
+ };
10
+ export type CoreDmImage360CollectionProperties = {
11
+ name: string;
12
+ };
13
+ export type CoreDmImage360Properties = {
14
+ translationX: number;
15
+ translationY: number;
16
+ translationZ: number;
17
+ eulerRotationX: number;
18
+ eulerRotationY: number;
19
+ eulerRotationZ: number;
20
+ scaleX: number;
21
+ scaleY: number;
22
+ scaleZ: number;
23
+ front: DirectRelationReference;
24
+ back: DirectRelationReference;
25
+ left: DirectRelationReference;
26
+ right: DirectRelationReference;
27
+ top: DirectRelationReference;
28
+ bottom: DirectRelationReference;
29
+ collection360: DirectRelationReference;
30
+ station360: DirectRelationReference;
31
+ takenAt: number;
32
+ };
33
+ export type CoreDmImage360AnnotationProperties = {
34
+ polygon: number[];
35
+ formatVersion: string;
36
+ };
@@ -0,0 +1,23 @@
1
+ export declare const isCoreDmImage360CollectionFilter: {
2
+ readonly and: [{
3
+ hasData: {
4
+ readonly type: "view";
5
+ readonly space: "cdf_cdm";
6
+ readonly externalId: "Cognite3DRevision";
7
+ readonly version: "v1";
8
+ }[];
9
+ }, {
10
+ readonly equals: {
11
+ readonly property: ["cdf_cdm_3d", "Cognite3DRevision", "type"];
12
+ readonly value: "Image360";
13
+ };
14
+ }];
15
+ };
16
+ export declare const isCoreDmImage360Filter: {
17
+ readonly hasData: [{
18
+ readonly type: "view";
19
+ readonly space: "cdf_cdm";
20
+ readonly externalId: "Cognite360Image";
21
+ readonly version: "v1";
22
+ }];
23
+ };
@@ -0,0 +1,40 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import type { EdgeDefinition, NodeDefinition, NodeOrEdge, CogniteClient, QueryRequest, ViewReference } from '@cognite/sdk';
5
+ export declare function queryNodesAndEdges<TQueryRequest extends QueryRequest, TypedSelectSources extends SelectSourceWithParams = SelectSourceWithParams>(query: TQueryRequest, sdk: CogniteClient): Promise<QueryResult<TQueryRequest, TypedSelectSources>>;
6
+ export type SelectSourceWithParams = Array<{
7
+ source: ViewReference;
8
+ properties: Record<string, unknown>;
9
+ }>;
10
+ type SELECT = 'select';
11
+ type WITH = 'with';
12
+ type LIMIT = 'limit';
13
+ type NODES = 'nodes';
14
+ type EDGES = 'edges';
15
+ type PROPERTIES = 'properties';
16
+ type SOURCES = 'sources';
17
+ type SOURCE = 'source';
18
+ type SPACE = 'space';
19
+ type EXTERNALID = 'externalId';
20
+ type VERSION = 'version';
21
+ type ALLPROPERTIES = '*';
22
+ type InstanceType<TQueryRequest extends QueryRequest, SelectKey extends keyof TQueryRequest[SELECT]> = Exclude<keyof TQueryRequest[WITH][SelectKey], LIMIT> extends NODES ? Omit<NodeDefinition, PROPERTIES> : Exclude<keyof TQueryRequest[WITH][SelectKey], LIMIT> extends EDGES ? Omit<EdgeDefinition, PROPERTIES> : Omit<NodeOrEdge, PROPERTIES>;
23
+ type TypedSourceProperty<SelectSource extends NonNullable<QueryRequest[SELECT][keyof QueryRequest[SELECT]][SOURCES]>[number], TypedSelectSourcePropertyMap extends SelectSourceWithParams = SelectSourceWithParams> = Extract<TypedSelectSourcePropertyMap[number], Pick<SelectSource, SOURCE>>[PROPERTIES];
24
+ type QueryResult<TQueryRequest extends QueryRequest, TSelectSourceWithParams extends SelectSourceWithParams = SelectSourceWithParams> = {
25
+ items: {
26
+ [SELECT_KEY in keyof TQueryRequest[SELECT]]: Array<InstanceType<TQueryRequest, SELECT_KEY> & {
27
+ properties: {
28
+ [SELECT_SOURCE in NonNullable<NonNullable<TQueryRequest[SELECT][SELECT_KEY]>[SOURCES]>[number] as SELECT_SOURCE[SOURCE][SPACE]]: {
29
+ [SELECT_SOURCE_VAR in SELECT_SOURCE as `${SELECT_SOURCE_VAR[SOURCE][EXTERNALID]}/${SELECT_SOURCE_VAR[SOURCE][VERSION]}`]: SELECT_SOURCE_VAR[PROPERTIES][0] extends ALLPROPERTIES ? Record<string, unknown> : {
30
+ [SELECT_SOURCE_PROPERTY in SELECT_SOURCE_VAR[PROPERTIES][number]]: TypedSourceProperty<SELECT_SOURCE_VAR, TSelectSourceWithParams>[SELECT_SOURCE_PROPERTY] extends never ? unknown : TypedSourceProperty<SELECT_SOURCE_VAR, TSelectSourceWithParams>[SELECT_SOURCE_PROPERTY];
31
+ };
32
+ };
33
+ };
34
+ }>;
35
+ };
36
+ nextCursor?: Partial<{
37
+ [SELECT_SOURCE_KEY in keyof TQueryRequest[SELECT]]: string;
38
+ }>;
39
+ };
40
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const ASSET_SIMPLE_PROPERTIES_LIST: ["name", "description", "object3D"];
2
+ export declare const CORE_DM_IMAGE_360_COLLECTION_PROPERTIES_LIST: ["name"];
3
+ export declare const CORE_DM_IMAGE_360_PROPERTIES_LIST: ["translationX", "translationY", "translationZ", "eulerRotationX", "eulerRotationY", "eulerRotationZ", "scaleX", "scaleY", "scaleZ", "front", "back", "left", "right", "top", "bottom", "collection360", "station360", "takenAt"];
4
+ export declare const CORE_DM_IMAGE_360_ANNOTATIONS_PROPERTIES_LIST: ["polygon", "formatVersion"];
@@ -0,0 +1,42 @@
1
+ export declare const COGNITE_ASSET_VIEW_REFERENCE: {
2
+ readonly type: "view";
3
+ readonly externalId: "CogniteAsset";
4
+ readonly space: "cdf_cdm";
5
+ readonly version: "v1";
6
+ };
7
+ export declare const COGNITE_OBJECT_3D_VIEW_REFERENCE: {
8
+ readonly type: "view";
9
+ readonly externalId: "Cognite3DObject";
10
+ readonly space: "cdf_cdm";
11
+ readonly version: "v1";
12
+ };
13
+ export declare const COGNITE_VISUALIZABLE_VIEW_REFERENCE: {
14
+ readonly type: "view";
15
+ readonly externalId: "CogniteVisualizable";
16
+ readonly space: "cdf_cdm";
17
+ readonly version: "v1";
18
+ };
19
+ export declare const CORE_DM_IMAGE_360_VIEW_REFERENCE: {
20
+ readonly type: "view";
21
+ readonly space: "cdf_cdm";
22
+ readonly externalId: "Cognite360Image";
23
+ readonly version: "v1";
24
+ };
25
+ export declare const CORE_DM_IMAGE_360_COLLECTION_VIEW_REFERENCE: {
26
+ readonly type: "view";
27
+ readonly space: "cdf_cdm";
28
+ readonly externalId: "Cognite360ImageCollection";
29
+ readonly version: "v1";
30
+ };
31
+ export declare const CORE_DM_IMAGE_360_ANNOTATION_VIEW_REFERENCE: {
32
+ readonly type: "view";
33
+ readonly space: "cdf_cdm";
34
+ readonly externalId: "Cognite360ImageAnnotation";
35
+ readonly version: "v1";
36
+ };
37
+ export declare const CORE_DM_3D_REVISION_VIEW_REFERENCE: {
38
+ readonly type: "view";
39
+ readonly space: "cdf_cdm";
40
+ readonly externalId: "Cognite3DRevision";
41
+ readonly version: "v1";
42
+ };
@@ -0,0 +1,4 @@
1
+ import { CoreDmImage360Annotation } from './types';
2
+ import { GetImage360AnnotationsFromCollectionResponse } from './fetchCoreDm360AnnotationsForCollection';
3
+ import { GetImage360FromRevisionResponse } from './fetchCoreDm360AnnotationsForRevision';
4
+ export declare function transformAnnotations(queryResponse: GetImage360AnnotationsFromCollectionResponse | GetImage360FromRevisionResponse): CoreDmImage360Annotation[];
@@ -0,0 +1,51 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { Vector3 } from 'three';
5
+ import { AssetSimpleProperties, CoreDmImage360AnnotationProperties, CoreDmImage360Properties } from './properties';
6
+ import { COGNITE_ASSET_VIEW_REFERENCE, CORE_DM_IMAGE_360_ANNOTATION_VIEW_REFERENCE, CORE_DM_IMAGE_360_VIEW_REFERENCE } from './sources';
7
+ import { DMInstanceRef } from '../../../../utilities';
8
+ /**
9
+ * Data contained in a single CoreDM-based annotation
10
+ */
11
+ export type CoreDmImage360Annotation = {
12
+ /**
13
+ * The source type of the annotation. Always 'dm'
14
+ */
15
+ sourceType: 'dm';
16
+ /**
17
+ * The DM identifier for this annotation
18
+ */
19
+ annotationIdentifier: DMInstanceRef;
20
+ /**
21
+ * The DM identifier for the asset instance connected to this
22
+ * annotation, if any
23
+ */
24
+ assetRef?: DMInstanceRef;
25
+ /**
26
+ * The Polygon outlining the annotation inside the 360 image
27
+ */
28
+ polygon: Vector3[];
29
+ /**
30
+ * The status of the annotation
31
+ */
32
+ status: 'suggested' | 'approved';
33
+ /**
34
+ * The DM ID of the CdfImage360 to which this annotation is associated
35
+ */
36
+ connectedImageId: DMInstanceRef;
37
+ };
38
+ export type Image360AnnotationViewReferenceAndProperties = [
39
+ {
40
+ source: typeof CORE_DM_IMAGE_360_ANNOTATION_VIEW_REFERENCE;
41
+ properties: CoreDmImage360AnnotationProperties;
42
+ },
43
+ {
44
+ source: typeof CORE_DM_IMAGE_360_VIEW_REFERENCE;
45
+ properties: CoreDmImage360Properties;
46
+ },
47
+ {
48
+ source: typeof COGNITE_ASSET_VIEW_REFERENCE;
49
+ properties: AssetSimpleProperties;
50
+ }
51
+ ];
@@ -4,11 +4,12 @@
4
4
  import { CogniteClient } from '@cognite/sdk';
5
5
  import { Historical360ImageSet, Image360DescriptorProvider } from '../../../../types';
6
6
  import { Image360DataModelIdentifier } from '../system-space/Cdf360DataModelsDescriptorProvider';
7
- export declare class Cdf360CdmDescriptorProvider implements Image360DescriptorProvider<Image360DataModelIdentifier> {
7
+ import { DMDataSourceType } from '../../../../DataSourceType';
8
+ export declare class Cdf360CdmDescriptorProvider implements Image360DescriptorProvider<DMDataSourceType> {
8
9
  private readonly _dmsSdk;
9
10
  private readonly _cogniteSdk;
10
11
  constructor(sdk: CogniteClient);
11
- get360ImageDescriptors(collectionIdentifier: Image360DataModelIdentifier, _: boolean): Promise<Historical360ImageSet[]>;
12
+ get360ImageDescriptors(collectionIdentifier: Image360DataModelIdentifier, _: boolean): Promise<Historical360ImageSet<DMDataSourceType>[]>;
12
13
  private queryCollection;
13
14
  private getFileDescriptors;
14
15
  private getHistorical360ImageSet;
@@ -3,19 +3,41 @@
3
3
  */
4
4
  import { CogniteClient } from '@cognite/sdk';
5
5
  import { Historical360ImageSet, Image360DescriptorProvider } from '../../../../types';
6
+ import { DataModelsSdk } from '../../../../DataModelsSdk';
7
+ import { ClassicDataSourceType } from '../../../../DataSourceType';
6
8
  /**
7
- * An identifier uniquely determining an instance of a Cognite Data Model
9
+ * An identifier uniquely determining a datamodel-based instance of a Cognite 360 image collection
8
10
  */
9
- export type Image360DataModelIdentifier = {
11
+ export type Image360DataModelIdentifier = Image360BaseIdentifier & {
12
+ /**
13
+ * Source Type for the model - 'dm' for legacy FDM 360 images, 'cdm' for CoreDM-based ones
14
+ */
10
15
  source?: 'dm' | 'cdm';
16
+ };
17
+ /**
18
+ * An Identifier uniquely determining a legacy datamodel-based instance of a Cognite 360 image collection
19
+ */
20
+ export type Image360LegacyDataModelIdentifier = {
21
+ source: 'dm';
22
+ } & Image360BaseIdentifier;
23
+ /**
24
+ * An Identifier uniquely determining a CoreDM-based instance of a Cognite 360 image collection
25
+ */
26
+ export type Image360CoreDataModelIdentifier = {
27
+ source: 'cdm';
28
+ } & Image360BaseIdentifier;
29
+ /**
30
+ * Common properties for the Image360 Datamodel identifiers
31
+ */
32
+ export type Image360BaseIdentifier = {
11
33
  space: string;
12
34
  image360CollectionExternalId: string;
13
35
  };
14
- export declare class Cdf360DataModelsDescriptorProvider implements Image360DescriptorProvider<Image360DataModelIdentifier> {
15
- private readonly _dmsSdk;
36
+ export declare class Cdf360DataModelsDescriptorProvider implements Image360DescriptorProvider<ClassicDataSourceType> {
37
+ readonly _dmsSdk: DataModelsSdk;
16
38
  private readonly _cogniteSdk;
17
39
  constructor(sdk: CogniteClient);
18
- get360ImageDescriptors(collectionIdentifier: Image360DataModelIdentifier, _: boolean): Promise<Historical360ImageSet[]>;
40
+ get360ImageDescriptors(collectionIdentifier: Image360DataModelIdentifier, _: boolean): Promise<Historical360ImageSet<ClassicDataSourceType>[]>;
19
41
  private queryCollection;
20
42
  private getFileDescriptors;
21
43
  private getHistorical360ImageSet;
@@ -3,10 +3,11 @@
3
3
  */
4
4
  import { CogniteClient, Metadata } from '@cognite/sdk';
5
5
  import { Historical360ImageSet, Image360DescriptorProvider } from '../../../types';
6
- export declare class Cdf360EventDescriptorProvider implements Image360DescriptorProvider<Metadata> {
6
+ import { ClassicDataSourceType } from '../../../DataSourceType';
7
+ export declare class Cdf360EventDescriptorProvider implements Image360DescriptorProvider<ClassicDataSourceType> {
7
8
  private readonly _client;
8
9
  constructor(client: CogniteClient);
9
- get360ImageDescriptors(metadataFilter: Metadata, preMultipliedRotation: boolean): Promise<Historical360ImageSet[]>;
10
+ get360ImageDescriptors(metadataFilter: Metadata, preMultipliedRotation: boolean): Promise<Historical360ImageSet<ClassicDataSourceType>[]>;
10
11
  private mergeDescriptors;
11
12
  private listEvents;
12
13
  private listFiles;
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { Image360RevisionId, ImageAssetLinkAnnotationInfo } from '../types';
5
+ import { DataSourceType } from '../DataSourceType';
6
+ import { AnnotationModel, Metadata } from '@cognite/sdk';
7
+ import { Image360DataModelIdentifier, Image360LegacyDataModelIdentifier } from './descriptor-providers/datamodels/system-space/Cdf360DataModelsDescriptorProvider';
8
+ export declare function isClassicMetadata360Identifier(id: DataSourceType['image360Identifier']): id is Metadata & {
9
+ site_id: string;
10
+ };
11
+ export declare function isClassic360Identifier(id: DataSourceType['image360Identifier']): id is (Metadata & {
12
+ site_id: string;
13
+ }) | Image360DataModelIdentifier;
14
+ export declare function isLegacyDM360Identifier(id: DataSourceType['image360Identifier']): id is Image360LegacyDataModelIdentifier;
15
+ export declare function isCoreDmImage360Identifier(id: DataSourceType['image360Identifier']): id is Image360DataModelIdentifier;
16
+ export declare function isFdm360ImageCollectionIdentifier(id: DataSourceType['image360Identifier']): id is Image360DataModelIdentifier;
17
+ export declare function isSameImage360RevisionId<T extends DataSourceType>(id0: Image360RevisionId<T>, id1: Image360RevisionId<T>): boolean;
18
+ export declare function isImageAssetLinkAnnotation(annotation: AnnotationModel): annotation is ImageAssetLinkAnnotationInfo;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Copyright 2024 Cognite AS
3
3
  */
4
- import { DMInstanceRef } from '../types';
4
+ import { DMInstanceRef } from '../../../../utilities';
5
5
  declare const getDMPointCloudVolumeQuery: (revisionRef: DMInstanceRef) => {
6
6
  readonly with: {
7
7
  readonly pointCloudVolumes: {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Copyright 2024 Cognite AS
3
3
  */
4
- import { DMInstanceRef } from '../types';
4
+ import { DMInstanceRef } from '../../../../utilities';
5
5
  export type AssetProperties = {
6
6
  object3D: DMInstanceRef;
7
7
  name: string;
@@ -2,5 +2,5 @@
2
2
  * Copyright 2024 Cognite AS
3
3
  */
4
4
  import { TableExpressionContainsAnyFilterV3 } from '@cognite/sdk';
5
- import { DMInstanceRef } from '../types';
5
+ import { DMInstanceRef } from '../../../../utilities';
6
6
  export declare function getRevisionContainsAnyFilter(revisionReferences: DMInstanceRef[]): TableExpressionContainsAnyFilterV3;
@@ -2,15 +2,10 @@
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
4
  import { StylableObject } from './StylableObject';
5
- import { IShape } from '../../../utilities';
5
+ import { DMInstanceRef, IShape } from '../../../utilities';
6
6
  import { Box3 } from 'three';
7
- import { AnnotationsAssetRef, DirectRelationReference } from '@cognite/sdk';
7
+ import { AnnotationsAssetRef } from '@cognite/sdk';
8
8
  import { ClassicDataSourceType, DataSourceType } from '../DataSourceType';
9
- /**
10
- * @public
11
- * CDF Data model instance reference
12
- */
13
- export type DMInstanceRef = DirectRelationReference;
14
9
  type VolumeAnnotation = {
15
10
  annotationId: number;
16
11
  asset?: AnnotationsAssetRef;
@@ -1,21 +1,44 @@
1
1
  /*!
2
2
  * Copyright 2021 Cognite AS
3
3
  */
4
- import { AnnotationModel, AnnotationsCogniteAnnotationTypesImagesAssetLink, CogniteInternalId, IdEither } from '@cognite/sdk';
4
+ import { AnnotationModel, AnnotationsCogniteAnnotationTypesImagesAssetLink, IdEither } from '@cognite/sdk';
5
5
  import * as THREE from 'three';
6
- export type Image360AnnotationFilterDelegate = (annotation: AnnotationModel) => boolean;
6
+ import { ClassicDataSourceType, DataSourceType, DMDataSourceType } from './DataSourceType';
7
+ import { AssetAnnotationImage360Info, DefaultImage360Collection, Image360AnnotationAssetQueryResult } from '../../360-images';
8
+ import { DMInstanceRef } from '../../utilities';
9
+ export type Image360AnnotationFilterDelegate<T extends DataSourceType> = (annotation: T['image360AnnotationType']) => boolean;
7
10
  export interface JsonFileProvider {
8
11
  getJsonFile(baseUrl: string, fileName: string): Promise<any>;
9
12
  }
10
13
  export interface BinaryFileProvider {
11
14
  getBinaryFile(baseUrl: string, fileName: string, abortSignal?: AbortSignal): Promise<ArrayBuffer>;
12
15
  }
13
- export interface Image360AnnotationProvider {
14
- get360ImageAnnotations(descriptors: Image360FileDescriptor[]): Promise<AnnotationModel[]>;
15
- getFilesByAssetRef(assetId: IdEither): Promise<CogniteInternalId[]>;
16
+ /**
17
+ * An ID identifiying a single Image360 entity within a collection
18
+ */
19
+ export type Image360Id<T extends DataSourceType> = Image360RevisionId<T>;
20
+ /**
21
+ * An ID identifiying a single Image360 revision within a collection
22
+ */
23
+ export type Image360RevisionId<T extends DataSourceType> = T extends DMDataSourceType ? DMInstanceRef : string;
24
+ export type Image360AnnotationSpecifier<T extends DataSourceType> = {
25
+ revisionId: Image360RevisionId<T>;
26
+ fileDescriptors: Image360FileDescriptor[];
27
+ };
28
+ /**
29
+ * Filter for finding linked annotations in either a classic 360 collection or a new one
30
+ */
31
+ export type InstanceReference<T extends DataSourceType> = T extends ClassicDataSourceType ? IdEither : DMInstanceRef;
32
+ export interface Image360AnnotationProvider<T extends DataSourceType> {
33
+ getRelevant360ImageAnnotations(annotationSpecifier: Image360AnnotationSpecifier<T>): Promise<T['image360AnnotationType'][]>;
34
+ findImageAnnotationsForInstance(instanceFilter: InstanceReference<T>, collection: DefaultImage360Collection<T>): Promise<Image360AnnotationAssetQueryResult<T>[]>;
35
+ getAllImage360AnnotationInfos(source: 'assets', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[]>;
36
+ getAllImage360AnnotationInfos(source: 'cdm', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetAnnotationImage360Info<DMDataSourceType>[]>;
37
+ getAllImage360AnnotationInfos(source: 'all', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetAnnotationImage360Info<DataSourceType>[]>;
38
+ getAllImage360AnnotationInfos(source: 'assets' | 'cdm' | 'all', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[] | AssetAnnotationImage360Info<DMDataSourceType>[] | AssetAnnotationImage360Info<DataSourceType>[]>;
16
39
  }
17
- export interface Image360DescriptorProvider<T> {
18
- get360ImageDescriptors(metadataFilter: T, preMultipliedRotation: boolean): Promise<Historical360ImageSet[]>;
40
+ export interface Image360DescriptorProvider<T extends DataSourceType> {
41
+ get360ImageDescriptors(metadataFilter: T['image360Identifier'], preMultipliedRotation: boolean): Promise<Historical360ImageSet<T>[]>;
19
42
  }
20
43
  export interface Image360FileProvider {
21
44
  get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
@@ -30,18 +53,16 @@ export type ImageAssetLinkAnnotationInfo = Omit<AnnotationModel, 'data'> & {
30
53
  */
31
54
  data: AnnotationsCogniteAnnotationTypesImagesAssetLink;
32
55
  };
33
- export interface Image360AssetProvider {
34
- get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[], annotationFilter: Image360AnnotationFilterDelegate): Promise<ImageAssetLinkAnnotationInfo[]>;
35
- }
36
- export type Historical360ImageSet = Image360EventDescriptor & {
37
- imageRevisions: Image360Descriptor[];
56
+ export type Historical360ImageSet<T extends DataSourceType> = Image360RevisionDescriptor<T> & {
57
+ imageRevisions: Image360Descriptor<T>[];
38
58
  };
39
- export type Image360Descriptor = {
59
+ export type Image360Descriptor<T extends DataSourceType> = {
60
+ id: Image360RevisionId<T>;
40
61
  timestamp?: number | string;
41
62
  faceDescriptors: Image360FileDescriptor[];
42
63
  };
43
- export type Image360EventDescriptor = {
44
- id: string;
64
+ export type Image360RevisionDescriptor<T extends DataSourceType> = {
65
+ id: Image360RevisionId<T>;
45
66
  label: string | undefined;
46
67
  collectionId: string;
47
68
  collectionLabel: string | undefined;
@@ -77,18 +98,14 @@ export interface BlobOutputMetadata {
77
98
  type InstanceType = 'node' | 'edge';
78
99
  export type Item = {
79
100
  instanceType: InstanceType;
80
- } & InstanceIdentifier;
101
+ } & DMInstanceRef;
81
102
  export type Source = {
82
103
  type: 'view';
83
104
  version: string;
84
- } & InstanceIdentifier;
85
- export type InstanceIdentifier = {
86
- space: string;
87
- externalId: string;
88
- };
105
+ } & DMInstanceRef;
89
106
  export type EdgeItem = {
90
- startNode: InstanceIdentifier;
91
- endNode: InstanceIdentifier;
107
+ startNode: DMInstanceRef;
108
+ endNode: DMInstanceRef;
92
109
  };
93
110
  export type Query = {
94
111
  with: Record<string, ResultSetExpression>;
@@ -138,7 +155,7 @@ type MainSourceProperties<T extends Query, K extends SelectKey<T>> = Sources<T,
138
155
  type ResultExpressionProperties<T extends Query, K extends SelectKey<T>> = {
139
156
  [V in MainSource<T, K>['space']]: {
140
157
  [Q in `${MainSource<T, K>['externalId']}/${MainSource<T, K>['version']}`]: {
141
- [B in MainSourceProperties<T, K>[number]]: string | number | InstanceIdentifier;
158
+ [B in MainSourceProperties<T, K>[number]]: string | number | DMInstanceRef;
142
159
  };
143
160
  };
144
161
  };
@@ -27,3 +27,9 @@ export declare const COGNITE_3D_REVISION_SOURCE: {
27
27
  readonly version: "v1";
28
28
  readonly type: "view";
29
29
  };
30
+ export declare const COGNITE_360_IMAGE_SOURCE: {
31
+ readonly externalId: "Cognite360Image";
32
+ readonly space: "cdf_cdm";
33
+ readonly version: "v1";
34
+ readonly type: "view";
35
+ };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Copyright 2024 Cognite AS
3
3
  */
4
- import { DMInstanceRef } from '../../data-providers';
4
+ import { DMInstanceRef } from '../../utilities';
5
5
  /**
6
6
  * A simple PointCloudDMVolumeCollection that consists of an explicitly provided list of data model instance.
7
7
  */
@@ -141,7 +141,7 @@ export declare class CognitePointCloudModel<T extends DataSourceType = ClassicDa
141
141
  get pointSize(): number;
142
142
  /**
143
143
  * Sets the size of each rendered point in the point cloud.
144
- * @default `1`
144
+ * @default `2`
145
145
  */
146
146
  set pointSize(size: number);
147
147
  /**
@@ -36,6 +36,5 @@ export declare class Potree implements IPotree {
36
36
  private updateVisibility;
37
37
  private updateTreeNodeVisibility;
38
38
  private updateChildVisibility;
39
- private updateBoundingBoxVisibility;
40
39
  private readonly updateVisibilityStructures;
41
40
  }
@@ -10,7 +10,6 @@ export interface IPointCloudTreeNodeBase {
10
10
  loaded: boolean;
11
11
  numPoints: number;
12
12
  isTreeNode: boolean;
13
- boundingBoxNode?: THREE.Object3D;
14
13
  readonly children: Array<IPointCloudTreeNodeBase | null>;
15
14
  readonly isLeafNode: boolean;
16
15
  dispose(): void;
@@ -22,11 +22,9 @@ export declare class PointCloudOctree extends PointCloudTree {
22
22
  */
23
23
  minNodePixelSize: number;
24
24
  root: IPointCloudTreeNodeBase | undefined;
25
- boundingBoxNodes: Object3D[];
26
25
  visibleNodes: IPointCloudTreeNode[];
27
26
  visibleGeometry: IPointCloudTreeGeometryNode[];
28
27
  numVisiblePoints: number;
29
- showBoundingBox: boolean;
30
28
  private readonly visibleBounds;
31
29
  private picker;
32
30
  private _globalClippingPlanes;
@@ -41,7 +39,6 @@ export declare class PointCloudOctree extends PointCloudTree {
41
39
  set pointSizeType(value: PointSizeType);
42
40
  toTreeNode(geometryNode: IPointCloudTreeGeometryNode, parent?: IPointCloudTreeNode | null): IPointCloudTreeNode;
43
41
  updateVisibleBounds(): void;
44
- updateBoundingBoxes(): void;
45
42
  updateMatricesForDescendants(): void;
46
43
  /**
47
44
  * Override updateMatrixWorld to not update children recursively. Child transformations
@@ -1,4 +1,4 @@
1
- import { Box3, EventDispatcher, Object3D, Points, Sphere } from 'three';
1
+ import { Box3, EventDispatcher, Points, Sphere } from 'three';
2
2
  import { IPointCloudTreeGeometryNode } from '../geometry/IPointCloudTreeGeometryNode';
3
3
  import { IPointCloudTreeNode } from './IPointCloudTreeNode';
4
4
  import { IPointCloudTreeNodeBase } from './IPointCloudTreeNodeBase';
@@ -6,7 +6,6 @@ export declare class PointCloudOctreeNode extends EventDispatcher implements IPo
6
6
  geometryNode: IPointCloudTreeGeometryNode;
7
7
  sceneNode: Points;
8
8
  pcIndex: number | undefined;
9
- boundingBoxNode?: Object3D | undefined;
10
9
  readonly children: (IPointCloudTreeNodeBase | null)[];
11
10
  readonly loaded = true;
12
11
  readonly isTreeNode: boolean;
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
- import { DMInstanceRef } from '../../../data-providers';
4
+ import { DMInstanceKey, DMInstanceRef } from '../../../utilities';
5
5
  export type PointCloudObjectIdMaps = {
6
- annotationToObjectIds: Map<number | DMInstanceRef, number>;
6
+ annotationToObjectIds: Map<number | DMInstanceKey, number>;
7
7
  objectToAnnotationIds: Map<number, number | DMInstanceRef>;
8
8
  };
@@ -53,5 +53,6 @@ export { Vector3Pool } from './src/three/Vector3Pool';
53
53
  export { isPointVisibleByPlanes } from './src/three/isPointVisibleByPlanes';
54
54
  export { CDF_TO_VIEWER_TRANSFORMATION } from './src/constants';
55
55
  export * from './src/workers/workerize-transferable';
56
+ export * from './src/fdm';
56
57
  export * from './src/shapes';
57
58
  export * from './src/linalg';
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ export { DMInstanceRef, DMSpace, DMExternalId } from './types';
5
+ export { isDmIdentifier } from './typeGuards';
6
+ export { DMInstanceKey, dmInstanceRefToKey } from './toKey';
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { DMExternalId, DMInstanceRef, DMSpace } from './types';
5
+ export type DMInstanceKey = `${DMSpace}/${DMExternalId}`;
6
+ export declare function dmInstanceRefToKey(id: DMInstanceRef): DMInstanceKey;
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ import { DMInstanceRef } from './types';
5
+ export declare function isDmIdentifier(id: any): id is DMInstanceRef;
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright 2025 Cognite AS
3
+ */
4
+ export type DMExternalId = string;
5
+ export type DMSpace = string;
6
+ /**
7
+ * @public
8
+ * CDF Data model instance reference
9
+ */
10
+ export type DMInstanceRef = {
11
+ externalId: string;
12
+ space: string;
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.22.0",
3
+ "version": "4.23.0-dev.20250122",
4
4
  "description": "WebGL based 3D viewer for CAD and point clouds processed in Cognite Data Fusion.",
5
5
  "homepage": "https://github.com/cognitedata/reveal/tree/master/viewer",
6
6
  "repository": {
@@ -1,9 +0,0 @@
1
- /*!
2
- * Copyright 2023 Cognite AS
3
- */
4
- import { BufferGeometry, Matrix4, Vector2 } from 'three';
5
- export interface ImageAnnotationObjectData {
6
- getGeometry(): BufferGeometry;
7
- getOutlinePoints(): Vector2[];
8
- getNormalizationMatrix(): Matrix4;
9
- }