@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.
Files changed (74) hide show
  1. package/dist/api-entry-points/core.d.ts +4 -4
  2. package/dist/index.js +209 -169
  3. package/dist/index.js.map +1 -1
  4. package/dist/packages/360-images/index.d.ts +2 -0
  5. package/dist/packages/360-images/src/Image360Action.d.ts +25 -0
  6. package/dist/packages/360-images/src/Image360Facade.d.ts +10 -9
  7. package/dist/packages/360-images/src/Image360History.d.ts +15 -0
  8. package/dist/packages/360-images/src/annotation/Image360Annotation.d.ts +3 -3
  9. package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +3 -3
  10. package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +9 -8
  11. package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +6 -6
  12. package/dist/packages/360-images/src/collection/Image360Collection.d.ts +7 -7
  13. package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +4 -3
  14. package/dist/packages/360-images/src/entity/Image360.d.ts +4 -3
  15. package/dist/packages/360-images/src/entity/Image360Entity.d.ts +8 -8
  16. package/dist/packages/360-images/src/entity/Image360Revision.d.ts +3 -2
  17. package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +4 -4
  18. package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +2 -2
  19. package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +16 -12
  20. package/dist/packages/api/src/public/RevealManager.d.ts +4 -3
  21. package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +33 -19
  22. package/dist/packages/api/src/public/migration/types.d.ts +14 -9
  23. package/dist/packages/api/src/public/types.d.ts +5 -4
  24. package/dist/packages/api/src/storage/RevealManagerHelper.d.ts +5 -4
  25. package/dist/packages/api/src/utilities/ViewStateHelper.d.ts +3 -2
  26. package/dist/packages/api/src/utilities/utils.d.ts +11 -0
  27. package/dist/packages/data-providers/index.d.ts +8 -2
  28. package/dist/packages/data-providers/src/DataSourceType.d.ts +127 -0
  29. package/dist/packages/data-providers/src/ModelIdentifier.d.ts +2 -0
  30. package/dist/packages/data-providers/src/PointCloudStylableObjectProvider.d.ts +3 -3
  31. package/dist/packages/data-providers/src/model-identifiers/DMModelIdentifier.d.ts +12 -0
  32. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider.d.ts +3 -3
  33. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider.d.ts +3 -3
  34. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/cdfAnnotationsToObjects.d.ts +2 -1
  35. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/CdfPointCloudDMStylableObjectProvider.d.ts +12 -0
  36. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/DummyPointCloudDMStylableObjectProvider.d.ts +9 -0
  37. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudObjects.d.ts +4 -0
  38. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudVolumeCollectionQuery.d.ts +81 -0
  39. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/types.d.ts +32 -0
  40. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/utils.d.ts +6 -0
  41. package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/types.d.ts +25 -22
  42. package/dist/packages/data-providers/src/requests/fetchDMModelIdFromRevisionId.d.ts +8 -0
  43. package/dist/packages/data-providers/src/utilities/constants.d.ts +29 -0
  44. package/dist/packages/data-providers/src/utilities/internalAddModelOptions.d.ts +23 -0
  45. package/dist/packages/data-providers/src/utilities/utils.d.ts +32 -0
  46. package/dist/packages/pointcloud-styling/index.d.ts +4 -2
  47. package/dist/packages/pointcloud-styling/src/AnnotationIdPointCloudObjectCollection.d.ts +3 -3
  48. package/dist/packages/pointcloud-styling/src/PointCloudDMVolumeCollection.d.ts +19 -0
  49. package/dist/packages/pointcloud-styling/src/PointCloudObjectCollection.d.ts +15 -3
  50. package/dist/packages/pointcloud-styling/src/StyledPointCloudVolumeCollection.d.ts +41 -0
  51. package/dist/packages/pointcloud-styling/src/utils.d.ts +7 -0
  52. package/dist/packages/pointclouds/index.d.ts +1 -0
  53. package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +33 -9
  54. package/dist/packages/pointclouds/src/PointCloudFactory.d.ts +5 -3
  55. package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +12 -2
  56. package/dist/packages/pointclouds/src/PointCloudLoadingStateHandler.d.ts +2 -1
  57. package/dist/packages/pointclouds/src/PointCloudManager.d.ts +3 -3
  58. package/dist/packages/pointclouds/src/PointCloudNode.d.ts +8 -7
  59. package/dist/packages/pointclouds/src/PointCloudPickingHandler.d.ts +3 -32
  60. package/dist/packages/pointclouds/src/createPointCloudManager.d.ts +2 -2
  61. package/dist/packages/pointclouds/src/potree-three-loader/Potree.d.ts +2 -2
  62. package/dist/packages/pointclouds/src/potree-three-loader/loading/EptLoader.d.ts +2 -2
  63. package/dist/packages/pointclouds/src/potree-three-loader/types/IPotree.d.ts +2 -2
  64. package/dist/packages/pointclouds/src/potree-three-loader/utils/createObjectIdMaps.d.ts +2 -2
  65. package/dist/packages/pointclouds/src/typeGuards.d.ts +17 -0
  66. package/dist/packages/pointclouds/src/types.d.ts +29 -0
  67. package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectAppearanceTexture.d.ts +4 -3
  68. package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectIdMaps.d.ts +3 -2
  69. package/dist/packages/tools/src/AxisGizmo/AxisGizmoTool.d.ts +2 -1
  70. package/dist/packages/tools/src/DebugCameraTool.d.ts +2 -1
  71. package/dist/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +2 -1
  72. package/dist/packages/tools/src/Measurement/MeasurementTool.d.ts +2 -1
  73. package/package.json +3 -2
  74. package/dist/packages/pointcloud-styling/src/StyledPointCloudObjectCollection.d.ts +0 -13
@@ -0,0 +1,81 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { DMInstanceRef } from '../types';
5
+ declare const getDMPointCloudVolumeQuery: (revisionRef: DMInstanceRef) => {
6
+ readonly with: {
7
+ readonly pointCloudVolumes: {
8
+ readonly nodes: {
9
+ readonly filter: {
10
+ readonly and: [{
11
+ readonly hasData: [{
12
+ readonly externalId: "CognitePointCloudVolume";
13
+ readonly space: "cdf_cdm";
14
+ readonly version: "v1";
15
+ readonly type: "view";
16
+ }];
17
+ }, import("@cognite/sdk").TableExpressionContainsAnyFilterV3];
18
+ };
19
+ };
20
+ readonly limit: 1000;
21
+ };
22
+ readonly object3D: {
23
+ readonly nodes: {
24
+ readonly from: "pointCloudVolumes";
25
+ readonly through: {
26
+ readonly view: {
27
+ readonly externalId: "CognitePointCloudVolume";
28
+ readonly space: "cdf_cdm";
29
+ readonly version: "v1";
30
+ readonly type: "view";
31
+ };
32
+ readonly identifier: "object3D";
33
+ };
34
+ readonly direction: "outwards";
35
+ };
36
+ readonly limit: 1000;
37
+ };
38
+ readonly assets: {
39
+ readonly nodes: {
40
+ readonly from: "object3D";
41
+ readonly through: {
42
+ readonly view: {
43
+ readonly externalId: "CogniteVisualizable";
44
+ readonly space: "cdf_cdm";
45
+ readonly version: "v1";
46
+ readonly type: "view";
47
+ };
48
+ readonly identifier: "object3D";
49
+ };
50
+ };
51
+ readonly limit: 1000;
52
+ };
53
+ };
54
+ readonly select: {
55
+ readonly pointCloudVolumes: {
56
+ readonly sources: [{
57
+ readonly source: {
58
+ readonly externalId: "CognitePointCloudVolume";
59
+ readonly space: "cdf_cdm";
60
+ readonly version: "v1";
61
+ readonly type: "view";
62
+ };
63
+ readonly properties: ["revisions", "volumeReferences", "volumeType", "volume", "object3D"];
64
+ }];
65
+ };
66
+ readonly assets: {
67
+ readonly sources: [{
68
+ readonly source: {
69
+ readonly externalId: "CogniteAsset";
70
+ readonly space: "cdf_cdm";
71
+ readonly version: "v1";
72
+ readonly type: "view";
73
+ };
74
+ readonly properties: ["name", "description", "object3D"];
75
+ }];
76
+ };
77
+ };
78
+ };
79
+ export type CdfDMPointCloudVolumeQuery = ReturnType<typeof getDMPointCloudVolumeQuery>;
80
+ export declare function getDMPointCloudVolumeCollectionQuery(revisionExternalId: string, space: string): CdfDMPointCloudVolumeQuery;
81
+ export {};
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { DMInstanceRef } from '../types';
5
+ export type AssetProperties = {
6
+ object3D: DMInstanceRef;
7
+ name: string;
8
+ description: string;
9
+ };
10
+ export declare const ASSET_PROPERTIES_LIST: ["name", "description", "object3D"];
11
+ export declare const pointCloudVolumeFilter: {
12
+ readonly hasData: [{
13
+ readonly externalId: "CognitePointCloudVolume";
14
+ readonly space: "cdf_cdm";
15
+ readonly version: "v1";
16
+ readonly type: "view";
17
+ }];
18
+ };
19
+ export declare const POINT_CLOUD_VOLUME_REVISIONS_REFERENCE: ["revisions", "volumeReferences"];
20
+ export declare const POINT_CLOUD_VOLUME_REVISIONS_PROPERTIES_LIST: ["revisions", "volumeReferences", "volumeType", "volume"];
21
+ export declare const POINT_CLOUD_VOLUME_REVISIONS_OBJECT3D_PROPERTIES_LIST: ["revisions", "volumeReferences", "volumeType", "volume", "object3D"];
22
+ export type PointCloudVolumeRevisionProperties = {
23
+ revisions: DMInstanceRef[];
24
+ volumeReferences: string[];
25
+ };
26
+ export type PointCloudVolumeRevisionVolumeProperties = PointCloudVolumeRevisionProperties & {
27
+ volumeType: string;
28
+ volume: number[];
29
+ };
30
+ export type PointCloudVolumeObject3DProperties = PointCloudVolumeRevisionVolumeProperties & {
31
+ object3D: DMInstanceRef;
32
+ };
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { TableExpressionContainsAnyFilterV3 } from '@cognite/sdk';
5
+ import { DMInstanceRef } from '../types';
6
+ export declare function getRevisionContainsAnyFilter(revisionReferences: DMInstanceRef[]): TableExpressionContainsAnyFilterV3;
@@ -4,36 +4,39 @@
4
4
  import { StylableObject } from './StylableObject';
5
5
  import { IShape } from '../../../utilities';
6
6
  import { Box3 } from 'three';
7
- import { AnnotationsAssetRef } from '@cognite/sdk';
8
- export type CdfPointCloudObjectAnnotation = {
7
+ import { AnnotationsAssetRef, DirectRelationReference } from '@cognite/sdk';
8
+ import { ClassicDataSourceType, DataSourceType } from '../DataSourceType';
9
+ /**
10
+ * @public
11
+ * CDF Data model instance reference
12
+ */
13
+ export type DMInstanceRef = DirectRelationReference;
14
+ type VolumeAnnotation = {
9
15
  annotationId: number;
10
16
  asset?: AnnotationsAssetRef;
17
+ };
18
+ type VolumeDMReference = {
19
+ instanceRef: DMInstanceRef;
20
+ asset?: DMInstanceRef;
21
+ };
22
+ export type VolumeMetadata = VolumeAnnotation | VolumeDMReference;
23
+ export type CdfPointCloudObjectAnnotation = {
24
+ volumeMetadata: VolumeMetadata;
11
25
  region: IShape[];
12
26
  };
27
+ export declare function isVolumeAnnotation(volumeMetadata: VolumeMetadata): volumeMetadata is VolumeAnnotation;
28
+ export declare function isVolumeDMReference(volumeMetadata: VolumeMetadata): volumeMetadata is VolumeDMReference;
13
29
  /**
14
30
  * @public
15
31
  * Metadata for a single point cloud object
16
32
  */
17
- export type PointCloudObjectMetadata = {
18
- /**
19
- * The CDF Annotation ID associated with the point cloud object.
20
- */
21
- annotationId: number;
22
- /**
23
- * The CDF Asset ID associated with the point cloud object, if any.
24
- *
25
- * @deprecated Use {@link PointCloudObjectMetadata.assetRef} instead.
26
- */
27
- assetId?: number;
28
- /**
29
- * Asset identifiers for asset associated with this point cloud object, if any.
30
- */
31
- assetRef?: AnnotationsAssetRef;
32
- /**
33
- * The bounding box of this annotation
34
- */
33
+ export type PointCloudObjectMetadata<T extends DataSourceType = ClassicDataSourceType> = {
35
34
  boundingBox: Box3;
36
- };
37
- export type PointCloudObject = PointCloudObjectMetadata & {
35
+ } & T['pointCloudVolumeMetadata'];
36
+ /**
37
+ * Point cloud object containing point cloud volume or annotation metadata and stylable object
38
+ */
39
+ export type PointCloudObject<T extends DataSourceType = ClassicDataSourceType> = PointCloudObjectMetadata<T> & {
38
40
  stylableObject: StylableObject;
39
41
  };
42
+ export {};
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { CogniteClient } from '@cognite/sdk';
5
+ export declare function fetchDMModelIdFromRevisionId(revisionExternalId: string, space: string, sdk: CogniteClient | undefined): Promise<{
6
+ modelId: number;
7
+ revisionId: number;
8
+ }>;
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ export declare const CORE_DM_SPACE = "cdf_cdm";
5
+ export declare const CORE_DM_3D_CONTAINER_SPACE = "cdf_cdm_3d";
6
+ export declare const COGNITE_POINT_CLOUD_VOLUME_SOURCE: {
7
+ readonly externalId: "CognitePointCloudVolume";
8
+ readonly space: "cdf_cdm";
9
+ readonly version: "v1";
10
+ readonly type: "view";
11
+ };
12
+ export declare const COGNITE_ASSET_SOURCE: {
13
+ readonly externalId: "CogniteAsset";
14
+ readonly space: "cdf_cdm";
15
+ readonly version: "v1";
16
+ readonly type: "view";
17
+ };
18
+ export declare const COGNITE_VISUALIZABLE_SOURCE: {
19
+ readonly externalId: "CogniteVisualizable";
20
+ readonly space: "cdf_cdm";
21
+ readonly version: "v1";
22
+ readonly type: "view";
23
+ };
24
+ export declare const COGNITE_3D_REVISION_SOURCE: {
25
+ readonly externalId: "Cognite3DRevision";
26
+ readonly space: "cdf_cdm";
27
+ readonly version: "v1";
28
+ readonly type: "view";
29
+ };
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { GeometryFilter } from '../../../cad-model';
5
+ import { ClassicModelIdentifierType, InternalDataSourceType, LocalModelIdentifierType } from '../DataSourceType';
6
+ /**
7
+ * Model options common to all model types.
8
+ */
9
+ export type CommonModelOptions = {
10
+ /**
11
+ * An optional local file which will be used to load the data.
12
+ */
13
+ localPath?: string;
14
+ /**
15
+ * An optional geometryFilter which will be applied to loading model.
16
+ */
17
+ geometryFilter?: GeometryFilter;
18
+ };
19
+ export type LocalAddModelOptions = CommonModelOptions & LocalModelIdentifierType;
20
+ export type InternalAddModelOptions<T extends InternalDataSourceType> = CommonModelOptions & T['modelIdentifier'];
21
+ export type AddModelOptionsWithModelRevisionId<T extends InternalDataSourceType> = InternalAddModelOptions<T> & {
22
+ classicModelRevisionId: ClassicModelIdentifierType;
23
+ };
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { TableExpressionEqualsFilterV3 } from '@cognite/sdk/dist/src';
5
+ import { PointCloudObject } from '../pointcloud-stylable-object-providers/types';
6
+ import { ClassicDataSourceType, DMDataSourceType, DataSourceType } from '../DataSourceType';
7
+ /**
8
+ * Type guard to check if a point cloud object contains data type DMDataSourceType
9
+ * @param pointCloudObject - The object to check
10
+ * @returns True if the object is of type `PointCloudObject<DMDataSourceType>`, false otherwise
11
+ */
12
+ export declare function isDMPointCloudVolumeObject(pointCloudObject: PointCloudObject<DataSourceType>): pointCloudObject is PointCloudObject<DMDataSourceType>;
13
+ /**
14
+ * Type guard to check if a point cloud object contains data type ClassicDataSourceType
15
+ * @param pointCloudObject - The object to check
16
+ * @returns True if the object is of type `PointCloudObject<ClassicDataSourceType>`, false otherwise
17
+ */
18
+ export declare function isClassicPointCloudVolumeObject(pointCloudObject: PointCloudObject<DataSourceType>): pointCloudObject is PointCloudObject<ClassicDataSourceType>;
19
+ /**
20
+ * Type guard to check if the point cloud metadata is of type DMDataSourceType
21
+ * @param pointCloudMetadata - The metadata object to check
22
+ * @returns True if the object is of type `PointCloudObjectMetadata<DMDataSourceType>`, false otherwise
23
+ */
24
+ export declare function isDMPointCloudVolume(pointCloudMetadata: DataSourceType['pointCloudVolumeMetadata']): pointCloudMetadata is DMDataSourceType['pointCloudVolumeMetadata'];
25
+ /**
26
+ * Type guard to check if the point cloud metadata is of type ClassicDataSourceType
27
+ * @param pointCloudMetadata - The metadata object to check
28
+ * @returns True if the object is of type `PointCloudObjectMetadata<ClassicDataSourceType>`, false otherwise
29
+ */
30
+ export declare function isClassicPointCloudVolume(pointCloudMetadata: DataSourceType['pointCloudVolumeMetadata']): pointCloudMetadata is ClassicDataSourceType['pointCloudVolumeMetadata'];
31
+ export declare function getNodeExternalIdEqualsFilter<T extends string>(externalId: T): TableExpressionEqualsFilterV3;
32
+ export declare function getNodeSpaceEqualsFilter<T extends string>(space: T): TableExpressionEqualsFilterV3;
@@ -2,6 +2,8 @@
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
4
  export { CompletePointCloudAppearance, PointCloudAppearance, DefaultPointCloudAppearance, applyDefaultsToPointCloudAppearance } from './src/PointCloudAppearance';
5
- export { StyledPointCloudObjectCollection } from './src/StyledPointCloudObjectCollection';
6
- export { PointCloudObjectCollection } from './src/PointCloudObjectCollection';
5
+ export { StyledPointCloudObjectCollection, StyledPointCloudVolumeCollection } from './src/StyledPointCloudVolumeCollection';
6
+ export { PointCloudObjectCollection, PointCloudAnnotationVolumeCollection } from './src/PointCloudObjectCollection';
7
7
  export { AnnotationIdPointCloudObjectCollection } from './src/AnnotationIdPointCloudObjectCollection';
8
+ export { PointCloudDMVolumeCollection } from './src/PointCloudDMVolumeCollection';
9
+ export { isPointCloudObjectCollection, isDMInstanceRefPointCloudObjectCollection } from './src/utils';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
- import { PointCloudObjectCollection } from './PointCloudObjectCollection';
4
+ import { PointCloudAnnotationVolumeCollection } from './PointCloudObjectCollection';
5
5
  /**
6
- * A simple PointCloudObjectCollection that consists of an explicitly provided list of annotation IDs
6
+ * A simple PointCloudAnnotationVolumeCollection that consists of an explicitly provided list of annotation IDs
7
7
  */
8
- export declare class AnnotationIdPointCloudObjectCollection extends PointCloudObjectCollection {
8
+ export declare class AnnotationIdPointCloudObjectCollection extends PointCloudAnnotationVolumeCollection {
9
9
  private readonly _annotationIds;
10
10
  constructor(ids: Iterable<number>);
11
11
  getAnnotationIds(): Iterable<number>;
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { DMInstanceRef } from '../../data-providers';
5
+ /**
6
+ * A simple PointCloudDMVolumeCollection that consists of an explicitly provided list of data model instance.
7
+ */
8
+ export declare class PointCloudDMVolumeCollection {
9
+ private readonly _dataModelInstanceRef;
10
+ constructor(ids: Iterable<DMInstanceRef>);
11
+ /**
12
+ * Gets data model external IDs for the objects represented by this PointCloudDMVolumeCollection instance
13
+ */
14
+ getDataModelInstanceRefs(): Iterable<DMInstanceRef>;
15
+ /**
16
+ * Is the collection is still loading data in the background i.e. not yet ready for use
17
+ */
18
+ get isLoading(): false;
19
+ }
@@ -4,20 +4,32 @@
4
4
  /**
5
5
  * Base class for collections of point cloud objects intended for styling operations
6
6
  */
7
- export declare abstract class PointCloudObjectCollection {
7
+ export declare abstract class PointCloudAnnotationVolumeCollection {
8
8
  private readonly _changedEvent;
9
9
  /**
10
- * @returns annotation IDs of the annotations for the objects represented by this PointCloudObjectCollection instance
10
+ * annotation IDs of the annotations for the objects represented by this PointCloudObjectCollection instance
11
11
  */
12
12
  abstract getAnnotationIds(): Iterable<number>;
13
13
  /**
14
- * @returns whether the collection is still loading data in the background i.e. not yet ready for use
14
+ * Whether the collection is still loading data in the background i.e. not yet ready for use
15
15
  */
16
16
  abstract get isLoading(): boolean;
17
+ /**
18
+ * Register an event listener on this collection
19
+ */
17
20
  on(event: 'changed', listener: () => void): void;
21
+ /**
22
+ * Unregister an event listener on this collection
23
+ */
18
24
  off(event: 'changed', listener: () => void): void;
19
25
  /**
20
26
  * Triggers the changed-event.
21
27
  */
22
28
  protected notifyChanged(): void;
23
29
  }
30
+ /**
31
+ * Alias for PointCloudAnnotationVolumeCollection
32
+ * @deprecated Use {@link PointCloudAnnotationVolumeCollection} instead
33
+ */
34
+ export declare abstract class PointCloudObjectCollection extends PointCloudAnnotationVolumeCollection {
35
+ }
@@ -0,0 +1,41 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { CompletePointCloudAppearance } from './PointCloudAppearance';
5
+ import { ClassicDataSourceType, DataSourceType } from '../../data-providers';
6
+ /**
7
+ * Represents either an PointCloudAnnotationVolumeCollection or PointCloudDMVolumeCollection
8
+ * that is associated with an appearance.
9
+ */
10
+ export declare class StyledPointCloudVolumeCollection<T extends DataSourceType> {
11
+ /**
12
+ * The volume collection this StyledPointCloudVolumeCollection represents
13
+ * @deprecated
14
+ */
15
+ objectCollection: T['pointCloudCollectionType'];
16
+ /**
17
+ * The appearance applied by the current StyledPointCloudVolumeCollection
18
+ */
19
+ style: CompletePointCloudAppearance;
20
+ /**
21
+ * Get the volume collection for this StyledPointCloudVolumeCollection
22
+ */
23
+ get volumeCollection(): T['pointCloudCollectionType'];
24
+ constructor(
25
+ /**
26
+ * The volume collection this StyledPointCloudVolumeCollection represents
27
+ * @deprecated
28
+ */
29
+ objectCollection: T['pointCloudCollectionType'],
30
+ /**
31
+ * The appearance applied by the current StyledPointCloudVolumeCollection
32
+ */
33
+ style: CompletePointCloudAppearance);
34
+ }
35
+ /**
36
+ * Represents either an PointCloudAnnotationVolumeCollection or PointCloudDMVolumeCollection
37
+ * that is associated with an appearance.
38
+ * @deprecated USe StyledPointCoudVolumeCollection instead
39
+ */
40
+ export declare class StyledPointCloudObjectCollection extends StyledPointCloudVolumeCollection<ClassicDataSourceType> {
41
+ }
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Copyright 2024 Cognite AS
3
+ */
4
+ import { PointCloudDMVolumeCollection } from './PointCloudDMVolumeCollection';
5
+ import { PointCloudAnnotationVolumeCollection } from './PointCloudObjectCollection';
6
+ export declare function isPointCloudObjectCollection(collection: PointCloudAnnotationVolumeCollection | PointCloudDMVolumeCollection): collection is PointCloudAnnotationVolumeCollection;
7
+ export declare function isDMInstanceRefPointCloudObjectCollection(collection: PointCloudAnnotationVolumeCollection | PointCloudDMVolumeCollection): collection is PointCloudDMVolumeCollection;
@@ -9,6 +9,7 @@ export { createPointCloudManager } from './src/createPointCloudManager';
9
9
  export { PointCloudBudget } from './src/PointCloudBudget';
10
10
  export { PointCloudIntersection } from './src/PointCloudIntersection';
11
11
  export { CognitePointCloudModel } from './src/CognitePointCloudModel';
12
+ export { isDMPointCloudModel, isClassicPointCloudModel } from './src/typeGuards';
12
13
  export { PointCloudLoadingStateHandler } from './src/PointCloudLoadingStateHandler';
13
14
  export { PointCloudFactory } from './src/PointCloudFactory';
14
15
  export { IPointClassificationsProvider } from './src/classificationsProviders/IPointClassificationsProvider';
@@ -6,21 +6,30 @@ import { CameraConfiguration } from '../../utilities';
6
6
  import { WellKnownAsprsPointClassCodes } from './types';
7
7
  import { PointColorType, PointShape, PointSizeType } from '../../rendering';
8
8
  import { SupportedModelTypes } from '../../model-base';
9
- import { PointCloudObjectMetadata } from '../../data-providers';
10
- import { StyledPointCloudObjectCollection, PointCloudObjectCollection, PointCloudAppearance } from '../../pointcloud-styling';
9
+ import { ClassicDataSourceType, DataSourceType, PointCloudObjectMetadata } from '../../data-providers';
10
+ import { PointCloudAppearance, StyledPointCloudVolumeCollection } from '../../pointcloud-styling';
11
11
  /**
12
12
  * Represents a point clouds model loaded from CDF.
13
13
  * @noInheritDoc
14
14
  * @module @cognite/reveal
15
15
  */
16
- export declare class CognitePointCloudModel {
16
+ export declare class CognitePointCloudModel<T extends DataSourceType = ClassicDataSourceType> {
17
17
  readonly type: SupportedModelTypes;
18
+ /**
19
+ * The modelId of the point cloud model in Cognite Data Fusion. 0 if not applicable
20
+ * @deprecated Use modelIdentifier instead
21
+ */
18
22
  readonly modelId: number;
19
23
  /**
20
- * The modelId of the point cloud model in Cognite Data Fusion.
24
+ * The revisionId of the specific model revision in Cognite Data Fusion. 0 if not applicable
25
+ * @deprecated Use modelIdentifier instead
21
26
  */
22
27
  readonly revisionId: number;
23
- private readonly _styledObjectCollections;
28
+ /**
29
+ * The identifier of this model
30
+ */
31
+ readonly modelIdentifier: T['modelIdentifier'];
32
+ private readonly _styledVolumeCollections;
24
33
  /**
25
34
  * Used to clean up memory.
26
35
  */
@@ -190,19 +199,33 @@ export declare class CognitePointCloudModel {
190
199
  * Gets the object collections that have been assigned a style
191
200
  * @returns All object collections and their associated style
192
201
  */
193
- get styledCollections(): StyledPointCloudObjectCollection[];
202
+ get styledCollections(): StyledPointCloudVolumeCollection<T>[];
203
+ /**
204
+ * Gets array of stylable objects for the point cloud model.
205
+ * @returns All stylable objects for this model
206
+ * * @example
207
+ * ```js
208
+ * model.stylableObjects.forEach(pointCloudMetadata => console.log(pointCloudMetadata.annotationId));
209
+ * // or
210
+ * model.stylableObjects.forEach(pointCloudMetadata => {
211
+ * if (isDMPointCloudVolume(pointCloudMetadata))
212
+ * console.log(pointCloudMetadata.volumeInstanceRef);
213
+ * });
214
+ * ```
215
+ */
216
+ get stylableObjects(): PointCloudObjectMetadata<T>[];
194
217
  /**
195
218
  * Assign a style to a collection of objects. If the object collection has been assigned
196
219
  * a style previously, the previous style will be replaced by the new one.
197
220
  * @param objectCollection The object collection to assign a style to
198
221
  * @param appearance The style to assign to the object collection
199
222
  */
200
- assignStyledObjectCollection(objectCollection: PointCloudObjectCollection, appearance: PointCloudAppearance): void;
223
+ assignStyledObjectCollection(objectCollection: T['pointCloudCollectionType'], appearance: PointCloudAppearance): void;
201
224
  /**
202
225
  * Unassign style from an already styled object collection.
203
226
  * @param objectCollection The object collection from which to remove the style
204
227
  */
205
- unassignStyledObjectCollection(objectCollection: PointCloudObjectCollection): void;
228
+ unassignStyledObjectCollection(objectCollection: T['pointCloudCollectionType']): void;
206
229
  /**
207
230
  * Removes styling on all object collections in this model
208
231
  */
@@ -212,6 +235,7 @@ export declare class CognitePointCloudModel {
212
235
  */
213
236
  get stylableObjectCount(): number;
214
237
  /**
238
+ * @deprecated Use {@link CognitePointCloudModel.stylableObjects}
215
239
  * Iterates through all stylable objects for this model
216
240
  * @example
217
241
  * ```js
@@ -220,5 +244,5 @@ export declare class CognitePointCloudModel {
220
244
  * );
221
245
  * ```
222
246
  */
223
- traverseStylableObjects(callback: (annotationMetadata: PointCloudObjectMetadata) => void): void;
247
+ traverseStylableObjects(callback: (annotationMetadata: PointCloudObjectMetadata<T>) => void): void;
224
248
  }
@@ -4,15 +4,17 @@
4
4
  import { PointCloudNode } from './PointCloudNode';
5
5
  import { PointCloudMetadata } from './PointCloudMetadata';
6
6
  import { Potree } from './potree-three-loader';
7
- import { PointCloudStylableObjectProvider } from '../../data-providers';
7
+ import { DMDataSourceType, DataSourceType, PointCloudStylableObjectProvider } from '../../data-providers';
8
8
  import { IPointClassificationsProvider } from './classificationsProviders/IPointClassificationsProvider';
9
9
  import { PointCloudMaterialManager } from '../../rendering';
10
+ import { ModelIdentifier } from '../../data-providers/src/ModelIdentifier';
10
11
  export declare class PointCloudFactory {
11
12
  private readonly _potreeInstance;
12
13
  private readonly _pointCloudObjectProvider;
14
+ private readonly _pointCloudDMProvider;
13
15
  private readonly _classificationsProvider;
14
16
  private readonly _pointCloudMaterialManager;
15
- constructor(potreeInstance: Potree, pointCloudObjectProvider: PointCloudStylableObjectProvider, classificationsProvider: IPointClassificationsProvider, pointCloudMaterialManager: PointCloudMaterialManager);
17
+ constructor(potreeInstance: Potree, pointCloudObjectProvider: PointCloudStylableObjectProvider, pointCloudDMProvider: PointCloudStylableObjectProvider<DMDataSourceType>, classificationsProvider: IPointClassificationsProvider, pointCloudMaterialManager: PointCloudMaterialManager);
16
18
  dispose(): void;
17
- createModel(modelMetadata: PointCloudMetadata): Promise<PointCloudNode>;
19
+ createModel<T extends DataSourceType>(identifier: T['modelIdentifier'], modelIdentifier: ModelIdentifier, modelMetadata: PointCloudMetadata): Promise<PointCloudNode<T>>;
18
20
  }
@@ -4,7 +4,11 @@
4
4
  import { AnnotationsAssetRef } from '@cognite/sdk';
5
5
  import { CognitePointCloudModel } from './CognitePointCloudModel';
6
6
  import type { Vector3 } from 'three';
7
- export type PointCloudIntersection = {
7
+ import { ClassicDataSourceType, DataSourceType } from '../../data-providers';
8
+ /**
9
+ * An intersection with a point cloud model. Contains metadata of the first intersected volume, if any
10
+ */
11
+ export type PointCloudIntersection<T extends DataSourceType = ClassicDataSourceType> = {
8
12
  /**
9
13
  * The intersection type.
10
14
  */
@@ -12,7 +16,7 @@ export type PointCloudIntersection = {
12
16
  /**
13
17
  * The model that was intersected.
14
18
  */
15
- model: CognitePointCloudModel;
19
+ model: CognitePointCloudModel<T>;
16
20
  /**
17
21
  * Coordinate of the intersection.
18
22
  */
@@ -27,10 +31,16 @@ export type PointCloudIntersection = {
27
31
  distanceToCamera: number;
28
32
  /**
29
33
  * Annotation Id of the intersected object within a pointcloud. (0 if not applicable)
34
+ * @deprecated Use `volumeMetadata` instead
30
35
  */
31
36
  annotationId: number;
32
37
  /**
33
38
  * Reference to the asset associated to the intersected point cloud object, if any.
39
+ * @deprecated use `volumeMetadata` instead
34
40
  */
35
41
  assetRef?: AnnotationsAssetRef;
42
+ /**
43
+ * Point cloud volume reference associated with the intersected point cloud volume, if any.
44
+ */
45
+ volumeMetadata?: T['pointCloudVolumeMetadata'];
36
46
  };
@@ -4,6 +4,7 @@
4
4
  import { LoadingState } from '../../model-base';
5
5
  import { Observable } from 'rxjs';
6
6
  import { PointCloudNode } from './PointCloudNode';
7
+ import { DataSourceType } from '../../data-providers';
7
8
  /**
8
9
  * Wrapper around Potree.Group with type information and
9
10
  * basic functionality.
@@ -24,7 +25,7 @@ export declare class PointCloudLoadingStateHandler {
24
25
  onModelRemoved(): void;
25
26
  resetFrameStats(): void;
26
27
  private createLoadingStateObservable;
27
- updatePointBuffersHash(pointCloudNodes: PointCloudNode[]): void;
28
+ updatePointBuffersHash(pointCloudNodes: PointCloudNode<DataSourceType>[]): void;
28
29
  /**
29
30
  * Generates a hash for the current loaded points to allow determining if we have
30
31
  * loaded data since last redraw.
@@ -8,7 +8,7 @@ import { PointCloudNode } from './PointCloudNode';
8
8
  import { PointCloudMetadataRepository } from './PointCloudMetadataRepository';
9
9
  import { Potree } from './potree-three-loader';
10
10
  import { Observable } from 'rxjs';
11
- import { ModelIdentifier } from '../../data-providers';
11
+ import { ModelIdentifier, AddModelOptionsWithModelRevisionId, DataSourceType } from '../../data-providers';
12
12
  import { PointCloudMaterialManager } from '../../rendering';
13
13
  import { Mesh } from 'three';
14
14
  export declare class PointCloudManager {
@@ -34,8 +34,8 @@ export declare class PointCloudManager {
34
34
  getLoadingStateObserver(): Observable<LoadingState>;
35
35
  updatePointClouds(camera: THREE.PerspectiveCamera): void;
36
36
  updateCamera(camera: THREE.PerspectiveCamera): void;
37
- addModel(modelIdentifier: ModelIdentifier): Promise<PointCloudNode>;
38
- removeModel(node: PointCloudNode): void;
37
+ addModel<T extends DataSourceType>(identifier: AddModelOptionsWithModelRevisionId<T>, modelIdentifier: ModelIdentifier): Promise<PointCloudNode<T>>;
38
+ removeModel<T extends DataSourceType>(node: PointCloudNode<T>): void;
39
39
  dispose(): void;
40
40
  private loadedModelsObservable;
41
41
  createDrawResetTrigger(): Mesh;