@cognite/reveal 4.2.2 → 4.3.1-dev.20230605

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 (68) hide show
  1. package/dist/api-entry-points/core.d.ts +2 -1
  2. package/dist/index.js +196 -171
  3. package/dist/index.js.map +1 -1
  4. package/dist/packages/360-images/index.d.ts +7 -1
  5. package/dist/packages/360-images/src/Image360Facade.d.ts +7 -7
  6. package/dist/packages/360-images/src/annotation/BoxAnnotationData.d.ts +16 -0
  7. package/dist/packages/360-images/src/annotation/Image360Annotation.d.ts +34 -0
  8. package/dist/packages/360-images/src/annotation/Image360AnnotationFilter.d.ts +12 -0
  9. package/dist/packages/360-images/src/annotation/Image360AnnotationIntersection.d.ts +22 -0
  10. package/dist/packages/360-images/src/annotation/ImageAnnotationData.d.ts +9 -0
  11. package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +38 -0
  12. package/dist/packages/360-images/src/annotation/PolygonAnnotationData.d.ts +15 -0
  13. package/dist/packages/360-images/src/annotation/types.d.ts +28 -0
  14. package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +14 -8
  15. package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +24 -2
  16. package/dist/packages/360-images/src/collection/Image360Collection.d.ts +61 -0
  17. package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +5 -2
  18. package/dist/packages/360-images/src/entity/Image360.d.ts +25 -0
  19. package/dist/packages/360-images/src/entity/Image360Entity.d.ts +41 -27
  20. package/dist/packages/360-images/src/entity/Image360Revision.d.ts +23 -0
  21. package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +62 -0
  22. package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +5 -1
  23. package/dist/packages/360-images/src/icons/IconCollection.d.ts +13 -7
  24. package/dist/packages/360-images/src/types.d.ts +2 -1
  25. package/dist/packages/3d-overlays/index.d.ts +9 -0
  26. package/dist/packages/{360-images/src/icons → 3d-overlays/src}/IconOctree.d.ts +6 -6
  27. package/dist/packages/3d-overlays/src/Overlay3D.d.ts +33 -0
  28. package/dist/packages/3d-overlays/src/Overlay3DCollection.d.ts +35 -0
  29. package/dist/packages/3d-overlays/src/Overlay3DIcon.d.ts +70 -0
  30. package/dist/packages/3d-overlays/src/OverlayCollection.d.ts +55 -0
  31. package/dist/packages/3d-overlays/src/OverlayPointsObject.d.ts +27 -0
  32. package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +15 -5
  33. package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +30 -7
  34. package/dist/packages/api/src/public/migration/types.d.ts +15 -1
  35. package/dist/packages/cad-geometry-loaders/src/sector/SectorLoader.d.ts +1 -1
  36. package/dist/packages/cad-geometry-loaders/src/sector/culling/SectorCuller.d.ts +6 -5
  37. package/dist/packages/cad-model/src/types.d.ts +1 -1
  38. package/dist/packages/cad-model/src/wrappers/CadNode.d.ts +1 -0
  39. package/dist/packages/cad-model/src/wrappers/CogniteCadModel.d.ts +7 -7
  40. package/dist/packages/cad-parsers/src/metadata/CadModelMetadata.d.ts +1 -1
  41. package/dist/packages/cad-styling/src/NodeAppearance.d.ts +2 -2
  42. package/dist/packages/cad-styling/src/PopulateIndexSetFromPagedResponseHelper.d.ts +2 -1
  43. package/dist/packages/camera-manager/src/CameraManager.d.ts +4 -4
  44. package/dist/packages/camera-manager/src/CameraManagerHelper.d.ts +7 -0
  45. package/dist/packages/data-providers/index.d.ts +2 -2
  46. package/dist/packages/data-providers/src/Image360Provider.d.ts +4 -2
  47. package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageEventProvider.d.ts +7 -5
  48. package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts +6 -2
  49. package/dist/packages/data-providers/src/types.d.ts +16 -4
  50. package/dist/packages/model-base/src/types.d.ts +1 -4
  51. package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +2 -2
  52. package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +1 -1
  53. package/dist/packages/pointclouds/src/potree-three-loader/loading/ClassificationInfo.d.ts +1 -1
  54. package/dist/packages/rendering/src/pointcloud-rendering/PointCloudMaterial.d.ts +2 -87
  55. package/dist/packages/rendering/src/rendering/NodeAppearanceTextureBuilder.d.ts +2 -2
  56. package/dist/packages/tools/index.d.ts +1 -0
  57. package/dist/packages/tools/src/HtmlOverlay/BucketGrid2D.d.ts +1 -1
  58. package/dist/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +1 -1
  59. package/dist/packages/tools/src/Overlay3D/Overlay3DTool.d.ts +134 -0
  60. package/dist/packages/utilities/index.d.ts +1 -1
  61. package/dist/packages/utilities/src/WebGLRendererStateHelper.d.ts +1 -1
  62. package/dist/packages/utilities/src/constants.d.ts +1 -3
  63. package/dist/packages/utilities/src/three/VariableWidthLine.d.ts +15 -0
  64. package/package.json +41 -40
  65. package/dist/packages/360-images/src/icons/Image360Icon.d.ts +0 -29
  66. package/dist/packages/360-images/src/icons/InstancedIconSprite.d.ts +0 -16
  67. package/dist/packages/tools/src/types.d.ts +0 -4
  68. package/dist/packages/utilities/src/three/BoundingBoxLOD.d.ts +0 -27
@@ -2,10 +2,16 @@
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
4
  export { Image360 } from './src/entity/Image360';
5
- export { Image360Collection } from './src/collection/Image360Collection';
5
+ export { Image360Revision } from './src/entity/Image360Revision';
6
+ export { Image360Collection, Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult } from './src/collection/Image360Collection';
6
7
  export { Image360Facade } from './src/Image360Facade';
7
8
  export { Image360CollectionFactory } from './src/collection/Image360CollectionFactory';
8
9
  export { Image360Entity } from './src/entity/Image360Entity';
10
+ export { Image360RevisionEntity } from './src/entity/Image360RevisionEntity';
9
11
  export { Image360Visualization } from './src/entity/Image360Visualization';
10
12
  export { Image360EnteredDelegate, Image360ExitedDelegate } from './src/types';
13
+ export { Image360AnnotationAppearance, Image360AnnotationFilterOptions } from './src/annotation/types';
14
+ export { Image360AnnotationIntersection } from './src/annotation/Image360AnnotationIntersection';
15
+ export { Image360Annotation } from './src/annotation/Image360Annotation';
11
16
  export { DefaultImage360Collection } from './src/collection/DefaultImage360Collection';
17
+ export { IconsOptions } from './src/icons/IconCollection';
@@ -6,6 +6,8 @@ import { Image360Entity } from './entity/Image360Entity';
6
6
  import { Image360CollectionFactory } from './collection/Image360CollectionFactory';
7
7
  import { DefaultImage360Collection } from './collection/DefaultImage360Collection';
8
8
  import { IconCullingScheme } from './icons/IconCollection';
9
+ import { Image360RevisionEntity } from './entity/Image360RevisionEntity';
10
+ import { Image360AnnotationFilterOptions } from './annotation/types';
9
11
  export declare class Image360Facade<T> {
10
12
  private readonly _entityFactory;
11
13
  private readonly _image360Collections;
@@ -13,16 +15,14 @@ export declare class Image360Facade<T> {
13
15
  private readonly _image360Cache;
14
16
  get collections(): DefaultImage360Collection[];
15
17
  set allIconsVisibility(visible: boolean);
16
- set allHoverIconsVisibility(visible: boolean);
18
+ set allIconsSelected(visible: boolean);
19
+ set hoverIconVisibility(visible: boolean);
17
20
  set allIconCullingScheme(scheme: IconCullingScheme);
18
21
  constructor(_entityFactory: Image360CollectionFactory<T>);
19
- create(dataProviderFilter: T, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection>;
22
+ create(dataProviderFilter: T, annotationFilter?: Image360AnnotationFilterOptions, postTransform?: THREE.Matrix4, preComputedRotation?: boolean): Promise<DefaultImage360Collection>;
20
23
  delete(entity: Image360Entity): Promise<void>;
21
- preload(entity: Image360Entity, lockDownload?: boolean): Promise<void>;
24
+ preload(entity: Image360Entity, revision: Image360RevisionEntity, lockDownload?: boolean): Promise<void>;
22
25
  getCollectionContainingEntity(entity: Image360Entity): DefaultImage360Collection;
23
- intersect(coords: {
24
- x: number;
25
- y: number;
26
- }, camera: THREE.Camera): Image360Entity | undefined;
26
+ intersect(coords: THREE.Vector2, camera: THREE.Camera): Image360Entity | undefined;
27
27
  dispose(): void;
28
28
  }
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { ImageAnnotationObjectData } from './ImageAnnotationData';
5
+ import { BufferGeometry, Matrix4, PlaneGeometry, Vector2 } from 'three';
6
+ import { AnnotationsBoundingBox } from '@cognite/sdk';
7
+ export declare class BoxAnnotationData implements ImageAnnotationObjectData {
8
+ private readonly _geometry;
9
+ private readonly _initialTranslation;
10
+ private readonly _outline;
11
+ constructor(annotationsBox: AnnotationsBoundingBox);
12
+ createGeometry(annotationsBox: AnnotationsBoundingBox): PlaneGeometry;
13
+ getGeometry(): BufferGeometry;
14
+ getNormalizationMatrix(): Matrix4;
15
+ getOutlinePoints(): Vector2[];
16
+ }
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { Color, Vector3 } from 'three';
5
+ import { AnnotationModel } from '@cognite/sdk';
6
+ /**
7
+ * An annotation associated with a 360 image revision
8
+ */
9
+ export interface Image360Annotation {
10
+ /**
11
+ * The underlying CDF annotation
12
+ */
13
+ readonly annotation: AnnotationModel;
14
+ /**
15
+ * Get the individual display color of this annotation.
16
+ */
17
+ getColor(): Color;
18
+ /**
19
+ * Set the display color of this annotation. Default: Random, based on annotation label
20
+ */
21
+ setColor(color?: Color): void;
22
+ /**
23
+ * Get whether this annotation is visible
24
+ */
25
+ getVisible(): boolean;
26
+ /**
27
+ * Set whether this annotation should be visible. Default: true
28
+ */
29
+ setVisible(visible?: boolean): void;
30
+ /**
31
+ * Get center of annotation, to e.g. point the camera toward it
32
+ */
33
+ getCenter(out?: Vector3): Vector3;
34
+ }
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { AnnotationModel } from '@cognite/sdk';
5
+ import { Image360AnnotationFilterOptions } from './types';
6
+ export declare class Image360AnnotationFilter {
7
+ private readonly _annotationFilter;
8
+ private fillDefaultAnnotationOptionValues;
9
+ constructor(options: Image360AnnotationFilterOptions);
10
+ private filterStatus;
11
+ filter(annotation: AnnotationModel): boolean;
12
+ }
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { Image360Annotation } from './Image360Annotation';
5
+ import { Vector3 } from 'three';
6
+ /**
7
+ * Describes an intersection with a 360 image annotation
8
+ */
9
+ export type Image360AnnotationIntersection = {
10
+ /**
11
+ * The intersection type.
12
+ */
13
+ type: 'image360Annotation';
14
+ /**
15
+ * The intersected annotation
16
+ */
17
+ annotation: Image360Annotation;
18
+ /**
19
+ * The world direction from the camera to the intersection point
20
+ */
21
+ direction: Vector3;
22
+ };
@@ -0,0 +1,9 @@
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
+ }
@@ -0,0 +1,38 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { AnnotationModel } from '@cognite/sdk';
5
+ import { Image360FileDescriptor } from '../../../data-providers';
6
+ import { Color, Vector3, Object3D, Raycaster } from 'three';
7
+ import { Image360Annotation } from './Image360Annotation';
8
+ import { Image360AnnotationAppearance } from './types';
9
+ type FaceType = Image360FileDescriptor['face'];
10
+ export declare class ImageAnnotationObject implements Image360Annotation {
11
+ private readonly _annotation;
12
+ private readonly _mesh;
13
+ private readonly _meshMaterial;
14
+ private readonly _line;
15
+ private readonly _objectGroup;
16
+ private _defaultAppearance;
17
+ private readonly _appearance;
18
+ get annotation(): AnnotationModel;
19
+ static createAnnotationObject(annotation: AnnotationModel, face: FaceType): ImageAnnotationObject | undefined;
20
+ private static createObjectData;
21
+ private static createObjectDetectionAnnotationData;
22
+ private static createAssetLinkAnnotationData;
23
+ private constructor();
24
+ private getRotationFromFace;
25
+ private initializeTransform;
26
+ getObject(): Object3D;
27
+ intersects(raycaster: Raycaster): boolean;
28
+ private updateMaterials;
29
+ setDefaultStyle(appearance: Image360AnnotationAppearance): void;
30
+ private getColorReference;
31
+ getColor(): Color;
32
+ setColor(color?: Color): void;
33
+ getVisible(): boolean;
34
+ setVisible(visible?: boolean): void;
35
+ dispose(): void;
36
+ getCenter(out?: Vector3): Vector3;
37
+ }
38
+ export {};
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { BufferGeometry, Matrix4, ShapeGeometry, Vector2 } from 'three';
5
+ import { AnnotationsPolygon } from '@cognite/sdk';
6
+ import { ImageAnnotationObjectData } from './ImageAnnotationData';
7
+ export declare class PolygonAnnotationData implements ImageAnnotationObjectData {
8
+ private readonly _geometry;
9
+ private readonly _outlinePoints;
10
+ constructor(polygon: AnnotationsPolygon);
11
+ createGeometry(polygon: AnnotationsPolygon): ShapeGeometry;
12
+ getGeometry(): BufferGeometry;
13
+ getNormalizationMatrix(): Matrix4;
14
+ getOutlinePoints(): Vector2[];
15
+ }
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Copyright 2023 Cognite AS
3
+ */
4
+ import { AnnotationStatus } from '@cognite/sdk';
5
+ import { Color } from 'three';
6
+ /**
7
+ * The appearance of a 360 image annotation
8
+ */
9
+ export type Image360AnnotationAppearance = {
10
+ /**
11
+ * The color of the annotation. Default: Random, based on annotation label
12
+ */
13
+ color?: Color;
14
+ /**
15
+ * Whether the annotation is visible. Default: true
16
+ */
17
+ visible?: boolean;
18
+ };
19
+ /**
20
+ * Options for loading annotations in 360 images
21
+ */
22
+ export type Image360AnnotationFilterOptions = {
23
+ /**
24
+ * Allow annotations matching this/these statuses. 'all' will match all annotations
25
+ * @default 'approved'
26
+ */
27
+ status?: 'all' | AnnotationStatus | AnnotationStatus[];
28
+ };
@@ -2,15 +2,17 @@
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
4
  import { Image360Entity } from '../entity/Image360Entity';
5
+ import { Image360RevisionEntity } from '../entity/Image360RevisionEntity';
5
6
  export type DownloadRequest = {
6
7
  entity: Image360Entity;
7
- firstCompleted: Promise<void>;
8
- fullResolutionCompleted: Promise<void>;
8
+ revision: Image360RevisionEntity;
9
+ anyCompleted: Promise<void>;
10
+ allCompleted: Promise<void>;
9
11
  abort: () => void;
10
12
  };
11
13
  export type Loaded360Image = {
12
14
  entity: Image360Entity;
13
- isFullResolution: boolean;
15
+ revision: Image360RevisionEntity;
14
16
  };
15
17
  export declare class Image360LoadingCache {
16
18
  private readonly _imageCacheSize;
@@ -18,13 +20,17 @@ export declare class Image360LoadingCache {
18
20
  private readonly _loaded360Images;
19
21
  private readonly _inProgressDownloads;
20
22
  private _lockedDownload;
21
- get cachedEntities(): Image360Entity[];
23
+ get cachedRevisions(): Image360RevisionEntity[];
22
24
  get currentlyLoadingEntities(): DownloadRequest[];
23
- getDownloadInProgress(entity: Image360Entity): DownloadRequest | undefined;
25
+ getDownloadInProgress(revision: Image360RevisionEntity): DownloadRequest | undefined;
24
26
  constructor(_imageCacheSize?: number, _downloadCacheSize?: number);
25
- cachedPreload(entity: Image360Entity, lockDownload?: boolean): Promise<void>;
27
+ cachedPreload(entity: Image360Entity, revision: Image360RevisionEntity, lockDownload?: boolean): Promise<void>;
26
28
  purge(entity: Image360Entity): Promise<void>;
27
- private addEntityToCache;
28
- private abortLastRecentlyReqestedEntity;
29
+ private cacheWhenAllComplete;
30
+ private purgeFromInProgressDownloads;
31
+ private addRevisionToCache;
32
+ private abortLastRecentlyReqestedRevision;
33
+ private purgeRevision;
29
34
  private createAbortSignal;
35
+ private isRevisionVisible;
30
36
  }
@@ -2,10 +2,13 @@
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
4
  import { EventTrigger } from '../../../utilities';
5
- import { Image360Collection } from './Image360Collection';
5
+ import { Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult, Image360Collection } from './Image360Collection';
6
6
  import { Image360Entity } from '../entity/Image360Entity';
7
7
  import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
8
8
  import { IconCollection, IconCullingScheme } from '../icons/IconCollection';
9
+ import { Image360AnnotationAppearance } from '../annotation/types';
10
+ import { IdEither } from '@cognite/sdk';
11
+ import { Image360DataProvider } from '../../../data-providers';
9
12
  /**
10
13
  * Default implementation of {@link Image360Collection}. Used for events when entering
11
14
  * and exiting 360 image mode
@@ -15,11 +18,23 @@ export declare class DefaultImage360Collection implements Image360Collection {
15
18
  * A list containing all the 360 images in this set.
16
19
  */
17
20
  readonly image360Entities: Image360Entity[];
21
+ /**
22
+ * If defined, any subsequently entered 360 images will load the revision that are closest to the target date.
23
+ * If undefined, the most recent revision will be loaded.
24
+ */
25
+ private _targetRevisionDate;
26
+ private _needsRedraw;
27
+ private _defaultStyle;
28
+ private readonly _image360DataProvider;
18
29
  private readonly _events;
19
30
  private readonly _icons;
20
31
  private _isCollectionVisible;
21
32
  private readonly _collectionId;
33
+ private readonly _collectionLabel;
22
34
  get id(): string;
35
+ get label(): string | undefined;
36
+ get targetRevisionDate(): Date | undefined;
37
+ set targetRevisionDate(date: Date | undefined);
23
38
  /**
24
39
  * The events from the image collection.
25
40
  */
@@ -28,7 +43,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
28
43
  image360Exited: EventTrigger<Image360ExitedDelegate>;
29
44
  };
30
45
  get isCollectionVisible(): boolean;
31
- constructor(collectionId: string, entities: Image360Entity[], icons: IconCollection);
46
+ constructor(collectionId: string, collectionLabel: string | undefined, entities: Image360Entity[], icons: IconCollection, image360DataProvider: Image360DataProvider);
32
47
  /**
33
48
  * Subscribes to events on 360 Image datasets. There are several event types:
34
49
  * 'image360Entered' - Subscribes to a event for entering 360 image mode.
@@ -56,8 +71,15 @@ export declare class DefaultImage360Collection implements Image360Collection {
56
71
  */
57
72
  off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
58
73
  off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
74
+ setSelectedForAll(selected: boolean): void;
59
75
  setSelectedVisibility(visible: boolean): void;
60
76
  setCullingScheme(scheme: IconCullingScheme): void;
61
77
  remove(entity: Image360Entity): void;
62
78
  dispose(): void;
79
+ get needsRedraw(): boolean;
80
+ resetRedraw(): void;
81
+ getDefaultAnnotationStyle(): Image360AnnotationAppearance;
82
+ setDefaultAnnotationStyle(defaultStyle: Image360AnnotationAppearance): void;
83
+ findImageAnnotations(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
84
+ getAssetIds(): Promise<IdEither[]>;
63
85
  }
@@ -3,14 +3,59 @@
3
3
  */
4
4
  import { Image360 } from './../entity/Image360';
5
5
  import { Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
6
+ import { Image360AnnotationAppearance } from '../annotation/types';
7
+ import { Image360Revision } from '../entity/Image360Revision';
8
+ import { IdEither } from '@cognite/sdk';
9
+ import { Image360Annotation } from '../annotation/Image360Annotation';
10
+ /**
11
+ * Filter for finding annotations related to an asset
12
+ */
13
+ export type Image360AnnotationAssetFilter = {
14
+ /**
15
+ * Reference to the wanted asset
16
+ */
17
+ assetRef: IdEither;
18
+ };
19
+ /**
20
+ * Result item from an asset annotation query
21
+ */
22
+ export type Image360AnnotationAssetQueryResult = {
23
+ /**
24
+ * The Image360 to which the result annotation belongs
25
+ */
26
+ image: Image360;
27
+ /**
28
+ * The image revision to which the result annotation belongs
29
+ */
30
+ revision: Image360Revision;
31
+ /**
32
+ * The found annotation
33
+ */
34
+ annotation: Image360Annotation;
35
+ };
6
36
  /**
7
37
  * A wrapper that represents a set of 360 images.
8
38
  */
9
39
  export interface Image360Collection {
40
+ /**
41
+ * The id of the collection.
42
+ * @returns The id of the collection.
43
+ */
44
+ readonly id: string;
45
+ /**
46
+ * The label of the collection.
47
+ * @returns The label of the collection.
48
+ */
49
+ readonly label: string | undefined;
10
50
  /**
11
51
  * A list containing all the 360 images in this set.
12
52
  */
13
53
  readonly image360Entities: Image360[];
54
+ /**
55
+ * If defined, any subsequently entered 360 images will load the revision that are closest to the target date.
56
+ * If undefined, the most recent revision will be loaded.
57
+ */
58
+ targetRevisionDate: Date | undefined;
14
59
  /**
15
60
  * Specify parameters used to determine the number of icons that are visible when entering 360 Images.
16
61
  * @param radius Only icons within the given radius will be made visible.
@@ -38,4 +83,20 @@ export interface Image360Collection {
38
83
  */
39
84
  off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
40
85
  off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
86
+ /**
87
+ * Get the assigned default style affecting all annotations
88
+ */
89
+ getDefaultAnnotationStyle(): Image360AnnotationAppearance;
90
+ /**
91
+ * Assign a default style which affects all annotations
92
+ */
93
+ setDefaultAnnotationStyle(appearance: Image360AnnotationAppearance): void;
94
+ /**
95
+ * Find 360 images associated with an asset through CDF annotations
96
+ */
97
+ findImageAnnotations(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
98
+ /**
99
+ * Get IDs of all CDF assets associated with this 360 image collection through CDF annotations
100
+ */
101
+ getAssetIds(): Promise<IdEither[]>;
41
102
  }
@@ -4,11 +4,14 @@
4
4
  import { Image360Provider } from '../../../data-providers';
5
5
  import { BeforeSceneRenderedDelegate, DeviceDescriptor, EventTrigger, SceneHandler } from '../../../utilities';
6
6
  import { DefaultImage360Collection } from './DefaultImage360Collection';
7
+ import { IconsOptions } from '../icons/IconCollection';
8
+ import { Image360AnnotationFilterOptions } from '../annotation/types';
7
9
  export declare class Image360CollectionFactory<T> {
8
10
  private readonly _image360DataProvider;
9
11
  private readonly _sceneHandler;
10
12
  private readonly _onBeforeSceneRendered;
13
+ private readonly _iconsOptions;
11
14
  private readonly _device;
12
- constructor(image360DataProvider: Image360Provider<T>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, device: DeviceDescriptor);
13
- create(dataProviderFilter: T, postTransform: THREE.Matrix4, preMultipliedRotation: boolean): Promise<DefaultImage360Collection>;
15
+ constructor(image360DataProvider: Image360Provider<T>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, device: DeviceDescriptor, iconsOptions?: IconsOptions);
16
+ create(dataProviderFilter: T, postTransform: THREE.Matrix4, preMultipliedRotation: boolean, annotationFilter: Image360AnnotationFilterOptions): Promise<DefaultImage360Collection>;
14
17
  }
@@ -1,7 +1,12 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
+ import { Image360Revision } from './Image360Revision';
4
5
  import { Image360Visualization } from './Image360Visualization';
6
+ /**
7
+ * A single 360 image "station", which may consist of several revisions
8
+ * captured in approximately the same location
9
+ */
5
10
  export interface Image360 {
6
11
  /**
7
12
  * Get a copy of the model-to-world transformation matrix
@@ -14,4 +19,24 @@ export interface Image360 {
14
19
  * @returns Image360Visualization
15
20
  */
16
21
  readonly image360Visualization: Image360Visualization;
22
+ /**
23
+ * Get Id of 360 image entity.
24
+ * @returns Station Id
25
+ */
26
+ readonly id: string;
27
+ /**
28
+ * Get label of 360 image entity.
29
+ * @returns Station label
30
+ * */
31
+ readonly label: string | undefined;
32
+ /**
33
+ * List all historical images for this entity.
34
+ * @returns A list of available revisions.
35
+ */
36
+ getRevisions(): Image360Revision[];
37
+ /**
38
+ * Get the revision that is currently loaded for this entry.
39
+ * @returns The active revision.
40
+ */
41
+ getActiveRevision(): Image360Revision;
17
42
  }
@@ -1,19 +1,22 @@
1
1
  /*!
2
2
  * Copyright 2022 Cognite AS
3
3
  */
4
- import * as THREE from 'three';
5
- import { Image360Descriptor, Image360FileProvider } from '../../../data-providers';
6
4
  import { DeviceDescriptor, SceneHandler } from '../../../utilities';
7
- import { Image360Icon } from '../icons/Image360Icon';
8
- import { Image360VisualizationBox } from './Image360VisualizationBox';
5
+ import { Image360DataProvider } from '../../../data-providers';
9
6
  import { Image360 } from './Image360';
7
+ import { Historical360ImageSet } from '../../../data-providers/src/types';
8
+ import { Image360RevisionEntity } from './Image360RevisionEntity';
9
+ import { Image360VisualizationBox } from './Image360VisualizationBox';
10
+ import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
11
+ import { Overlay3DIcon } from '../../../3d-overlays';
12
+ import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
10
13
  export declare class Image360Entity implements Image360 {
11
- private readonly _imageProvider;
12
- private readonly _image360Metadata;
14
+ private readonly _revisions;
15
+ private readonly _imageMetadata;
13
16
  private readonly _transform;
14
17
  private readonly _image360Icon;
15
- private readonly _image360VisualzationBox;
16
- private _getFullResolutionTextures;
18
+ private readonly _image360VisualizationBox;
19
+ private _activeRevision;
17
20
  /**
18
21
  * Get a copy of the model-to-world transformation matrix
19
22
  * of the given 360 image.
@@ -25,37 +28,48 @@ export declare class Image360Entity implements Image360 {
25
28
  * image during normal visualization.
26
29
  * @returns Image360Icon
27
30
  */
28
- get icon(): Image360Icon;
31
+ get icon(): Overlay3DIcon;
29
32
  /**
30
33
  * The object containing the unit cube with the 360 images.
31
34
  * @returns Image360Visualization
32
35
  */
33
36
  get image360Visualization(): Image360VisualizationBox;
34
- constructor(image360Metadata: Image360Descriptor, sceneHandler: SceneHandler, imageProvider: Image360FileProvider, transform: THREE.Matrix4, icon: Image360Icon, device: DeviceDescriptor);
35
37
  /**
36
- * Loads the 360 image (6 faces) into the visualization object.
37
- *
38
- * This will start the download of both low and full resolution images and return one promise for when the first image set is ready
39
- * and one promise for when both downloads are completed. If the low resolution images are completed first the full resolution
40
- * download and texture loading will continue in the background, and applyFullResolution can be used to apply full resolution textures
41
- * to the image360VisualzationBox at a desired time.
42
- *
43
- * @returns firstCompleted A promise for when the first set om images has been loaded and applied to the image360VisualzationBox.
44
- * @returns fullResolutionCompleted A promise for when full resolution images are done loading.
38
+ * Get Id of 360 image entity.
39
+ * @returns Station Id
40
+ */
41
+ get id(): string;
42
+ /**
43
+ * Get label of 360 image entity.
44
+ * @returns Station label
45
+ * */
46
+ get label(): string | undefined;
47
+ constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, annotationFilterer: Image360AnnotationFilter, transform: THREE.Matrix4, icon: Overlay3DIcon, device: DeviceDescriptor);
48
+ /**
49
+ * List all historical images for this entity.
50
+ * @returns A list of available revisions.
51
+ */
52
+ getRevisions(): Image360RevisionEntity[];
53
+ /**
54
+ * Get the revision that is currently loaded for this entry.
55
+ * @returns Returns the active revision.
45
56
  */
46
- load360Image(abortSignal?: AbortSignal): {
47
- firstCompleted: Promise<void>;
48
- fullResolutionCompleted: Promise<void>;
49
- };
57
+ getActiveRevision(): Image360RevisionEntity;
58
+ setActiveRevision(revision: Image360RevisionEntity): void;
59
+ applyFullResolutionTextures(): Promise<void>;
60
+ getMostRecentRevision(): Image360RevisionEntity;
50
61
  /**
51
- * Apply full resolution textures to the image360VisualzationBox. This has no effect if full resolution has already been applied.
62
+ * Get the revision closest to the provided date.
63
+ * If all revisions are undated the first available revison is returned.
52
64
  */
53
- applyFullResolution(): Promise<void>;
65
+ getRevisionClosestToDate(date: Date): Image360RevisionEntity;
66
+ intersectAnnotations(raycaster: THREE.Raycaster): ImageAnnotationObject | undefined;
54
67
  /**
55
68
  * Drops the GPU resources for the 360 image
56
- * the icon will be preserved.
57
69
  */
58
- unload360Image(): void;
70
+ unloadImage(): void;
71
+ activateAnnotations(): void;
72
+ deactivateAnnotations(): void;
59
73
  /**
60
74
  * @obvious
61
75
  */
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * Copyright 2022 Cognite AS
3
+ */
4
+ import { Image360Annotation } from '../annotation/Image360Annotation';
5
+ /**
6
+ * Interface used to manage historical revisions of {@link Image360}.
7
+ * One instance represents one specific image revision.
8
+ */
9
+ export interface Image360Revision {
10
+ /**
11
+ * The date of this revision. Undefined if the revision is undated.
12
+ * @returns Date | undefined
13
+ */
14
+ readonly date: Date | undefined;
15
+ /**
16
+ * The annotations associated with this revision.
17
+ */
18
+ getAnnotations(): Promise<Image360Annotation[]>;
19
+ /**
20
+ * Get the thumbnail url for this revision.
21
+ */
22
+ getPreviewThumbnailUrl(): Promise<string | undefined>;
23
+ }