@cognite/reveal 4.2.0-dev.20230524 → 4.2.0-dev.20230526
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-entry-points/core.d.ts +2 -2
- package/dist/index.js +29 -29
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/index.d.ts +1 -1
- package/dist/packages/360-images/src/annotation/Image360Annotation.d.ts +8 -0
- package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +3 -0
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +4 -2
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +14 -0
- package/dist/packages/360-images/src/entity/Image360.d.ts +12 -7
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +12 -3
- package/dist/packages/360-images/src/entity/Image360Revision.d.ts +6 -2
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +7 -6
- package/dist/packages/3d-overlays/index.d.ts +1 -1
- package/dist/packages/3d-overlays/src/Overlay3D.d.ts +11 -7
- package/dist/packages/3d-overlays/src/Overlay3DCollection.d.ts +2 -2
- package/dist/packages/3d-overlays/src/Overlay3DIcon.d.ts +9 -9
- package/dist/packages/3d-overlays/src/OverlayCollection.d.ts +26 -9
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +2 -2
- package/dist/packages/data-providers/src/types.d.ts +2 -2
- package/dist/packages/tools/index.d.ts +1 -1
- package/dist/packages/tools/src/{SmartOverlay/SmartOverlayTool.d.ts → Overlay3D/Overlay3DTool.d.ts} +41 -17
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
export { Image360
|
|
4
|
+
export { Image360 } from './src/entity/Image360';
|
|
5
5
|
export { Image360Revision } from './src/entity/Image360Revision';
|
|
6
6
|
export { Image360Collection, Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult } from './src/collection/Image360Collection';
|
|
7
7
|
export { Image360Facade } from './src/Image360Facade';
|
|
@@ -11,10 +11,18 @@ export interface Image360Annotation {
|
|
|
11
11
|
* The underlying CDF annotation
|
|
12
12
|
*/
|
|
13
13
|
readonly annotation: AnnotationModel;
|
|
14
|
+
/**
|
|
15
|
+
* Get the individual display color of this annotation.
|
|
16
|
+
*/
|
|
17
|
+
getColor(): Color;
|
|
14
18
|
/**
|
|
15
19
|
* Set the display color of this annotation. Default: Random, based on annotation label
|
|
16
20
|
*/
|
|
17
21
|
setColor(color?: Color): void;
|
|
22
|
+
/**
|
|
23
|
+
* Get whether this annotation is visible
|
|
24
|
+
*/
|
|
25
|
+
getVisible(): boolean;
|
|
18
26
|
/**
|
|
19
27
|
* Set whether this annotation should be visible. Default: true
|
|
20
28
|
*/
|
|
@@ -27,7 +27,10 @@ export declare class ImageAnnotationObject implements Image360Annotation {
|
|
|
27
27
|
intersects(raycaster: Raycaster): boolean;
|
|
28
28
|
private updateMaterials;
|
|
29
29
|
setDefaultStyle(appearance: Image360AnnotationAppearance): void;
|
|
30
|
+
private getColorReference;
|
|
31
|
+
getColor(): Color;
|
|
30
32
|
setColor(color?: Color): void;
|
|
33
|
+
getVisible(): boolean;
|
|
31
34
|
setVisible(visible?: boolean): void;
|
|
32
35
|
dispose(): void;
|
|
33
36
|
getCenter(out?: Vector3): Vector3;
|
|
@@ -29,7 +29,9 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
29
29
|
private readonly _icons;
|
|
30
30
|
private _isCollectionVisible;
|
|
31
31
|
private readonly _collectionId;
|
|
32
|
+
private readonly _collectionLabel;
|
|
32
33
|
get id(): string;
|
|
34
|
+
get label(): string | undefined;
|
|
33
35
|
get targetRevisionDate(): Date | undefined;
|
|
34
36
|
set targetRevisionDate(date: Date | undefined);
|
|
35
37
|
/**
|
|
@@ -40,7 +42,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
40
42
|
image360Exited: EventTrigger<Image360ExitedDelegate>;
|
|
41
43
|
};
|
|
42
44
|
get isCollectionVisible(): boolean;
|
|
43
|
-
constructor(collectionId: string, entities: Image360Entity[], icons: IconCollection, image360DataProvider: Image360DataProvider);
|
|
45
|
+
constructor(collectionId: string, collectionLabel: string | undefined, entities: Image360Entity[], icons: IconCollection, image360DataProvider: Image360DataProvider);
|
|
44
46
|
/**
|
|
45
47
|
* Subscribes to events on 360 Image datasets. There are several event types:
|
|
46
48
|
* 'image360Entered' - Subscribes to a event for entering 360 image mode.
|
|
@@ -75,7 +77,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
75
77
|
dispose(): void;
|
|
76
78
|
get needsRedraw(): boolean;
|
|
77
79
|
resetRedraw(): void;
|
|
78
|
-
|
|
80
|
+
getDefaultAnnotationStyle(): Image360AnnotationAppearance;
|
|
79
81
|
setDefaultAnnotationStyle(defaultStyle: Image360AnnotationAppearance): void;
|
|
80
82
|
findImageAnnotation(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
|
|
81
83
|
}
|
|
@@ -34,6 +34,16 @@ export type Image360AnnotationAssetQueryResult = {
|
|
|
34
34
|
* A wrapper that represents a set of 360 images.
|
|
35
35
|
*/
|
|
36
36
|
export interface Image360Collection {
|
|
37
|
+
/**
|
|
38
|
+
* The id of the collection.
|
|
39
|
+
* @returns The id of the collection.
|
|
40
|
+
*/
|
|
41
|
+
readonly id: string;
|
|
42
|
+
/**
|
|
43
|
+
* The label of the collection.
|
|
44
|
+
* @returns The label of the collection.
|
|
45
|
+
*/
|
|
46
|
+
readonly label: string | undefined;
|
|
37
47
|
/**
|
|
38
48
|
* A list containing all the 360 images in this set.
|
|
39
49
|
*/
|
|
@@ -70,6 +80,10 @@ export interface Image360Collection {
|
|
|
70
80
|
*/
|
|
71
81
|
off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
72
82
|
off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
83
|
+
/**
|
|
84
|
+
* Get the assigned default style affecting all annotations
|
|
85
|
+
*/
|
|
86
|
+
getDefaultAnnotationStyle(): Image360AnnotationAppearance;
|
|
73
87
|
/**
|
|
74
88
|
* Assign a default style which affects all annotations
|
|
75
89
|
*/
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Revision } from './Image360Revision';
|
|
5
5
|
import { Image360Visualization } from './Image360Visualization';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* A single 360 image "station", which may consist of several revisions
|
|
8
|
+
* captured in approximately the same location
|
|
9
|
+
*/
|
|
11
10
|
export interface Image360 {
|
|
12
11
|
/**
|
|
13
12
|
* Get a copy of the model-to-world transformation matrix
|
|
@@ -21,9 +20,15 @@ export interface Image360 {
|
|
|
21
20
|
*/
|
|
22
21
|
readonly image360Visualization: Image360Visualization;
|
|
23
22
|
/**
|
|
24
|
-
* Get
|
|
23
|
+
* Get Id of 360 image entity.
|
|
24
|
+
* @returns Station Id
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
readonly id: string;
|
|
27
|
+
/**
|
|
28
|
+
* Get label of 360 image entity.
|
|
29
|
+
* @returns Station label
|
|
30
|
+
* */
|
|
31
|
+
readonly label: string | undefined;
|
|
27
32
|
/**
|
|
28
33
|
* List all historical images for this entity.
|
|
29
34
|
* @returns A list of available revisions.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { DeviceDescriptor, SceneHandler } from '../../../utilities';
|
|
5
5
|
import { Image360DataProvider } from '../../../data-providers';
|
|
6
|
-
import { Image360
|
|
6
|
+
import { Image360 } from './Image360';
|
|
7
7
|
import { Historical360ImageSet } from '../../../data-providers/src/types';
|
|
8
8
|
import { Image360RevisionEntity } from './Image360RevisionEntity';
|
|
9
9
|
import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
@@ -15,7 +15,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
15
15
|
private readonly _imageMetadata;
|
|
16
16
|
private readonly _transform;
|
|
17
17
|
private readonly _image360Icon;
|
|
18
|
-
private readonly
|
|
18
|
+
private readonly _image360VisualizationBox;
|
|
19
19
|
private _activeRevision;
|
|
20
20
|
/**
|
|
21
21
|
* Get a copy of the model-to-world transformation matrix
|
|
@@ -34,6 +34,16 @@ export declare class Image360Entity implements Image360 {
|
|
|
34
34
|
* @returns Image360Visualization
|
|
35
35
|
*/
|
|
36
36
|
get image360Visualization(): Image360VisualizationBox;
|
|
37
|
+
/**
|
|
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;
|
|
37
47
|
constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, annotationFilterer: Image360AnnotationFilter, transform: THREE.Matrix4, icon: Overlay3DIcon, device: DeviceDescriptor);
|
|
38
48
|
/**
|
|
39
49
|
* List all historical images for this entity.
|
|
@@ -58,7 +68,6 @@ export declare class Image360Entity implements Image360 {
|
|
|
58
68
|
* Drops the GPU resources for the 360 image
|
|
59
69
|
*/
|
|
60
70
|
unloadImage(): void;
|
|
61
|
-
getImageMetadata(): Image360Metadata;
|
|
62
71
|
activateAnnotations(): void;
|
|
63
72
|
deactivateAnnotations(): void;
|
|
64
73
|
/**
|
|
@@ -8,12 +8,16 @@ import { Image360Annotation } from '../annotation/Image360Annotation';
|
|
|
8
8
|
*/
|
|
9
9
|
export interface Image360Revision {
|
|
10
10
|
/**
|
|
11
|
-
* The date of this revision. Undefined if the
|
|
11
|
+
* The date of this revision. Undefined if the revision is undated.
|
|
12
12
|
* @returns Date | undefined
|
|
13
13
|
*/
|
|
14
14
|
readonly date: Date | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* The annotations associated with this revision
|
|
16
|
+
* The annotations associated with this revision.
|
|
17
17
|
*/
|
|
18
18
|
getAnnotations(): Promise<Image360Annotation[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the thumbnail url for this revision.
|
|
21
|
+
*/
|
|
22
|
+
getPreviewThumbnailUrl(): Promise<string | undefined>;
|
|
19
23
|
}
|
|
@@ -10,16 +10,16 @@ import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter
|
|
|
10
10
|
export declare class Image360RevisionEntity implements Image360Revision {
|
|
11
11
|
private readonly _imageProvider;
|
|
12
12
|
private readonly _image360Descriptor;
|
|
13
|
-
private readonly
|
|
13
|
+
private readonly _image360VisualizationBox;
|
|
14
14
|
private _previewTextures;
|
|
15
15
|
private _fullResolutionTextures;
|
|
16
16
|
private _onFullResolutionCompleted;
|
|
17
17
|
private _defaultAppearance;
|
|
18
18
|
private _annotations;
|
|
19
19
|
private readonly _annotationFilterer;
|
|
20
|
-
constructor(imageProvider: Image360DataProvider, image360Descriptor: Image360Descriptor,
|
|
20
|
+
constructor(imageProvider: Image360DataProvider, image360Descriptor: Image360Descriptor, image360VisualizationBox: Image360VisualizationBox, annotationFilterer: Image360AnnotationFilter);
|
|
21
21
|
/**
|
|
22
|
-
* The date of this revision. Undefined if the
|
|
22
|
+
* The date of this revision. Undefined if the revision is undated.
|
|
23
23
|
* @returns Date | undefined
|
|
24
24
|
*/
|
|
25
25
|
get date(): Date | undefined;
|
|
@@ -30,7 +30,7 @@ export declare class Image360RevisionEntity implements Image360Revision {
|
|
|
30
30
|
*
|
|
31
31
|
* This will start the download of both low and full resolution textures and return one promise for when each texture set is ready.
|
|
32
32
|
* If the low resolution images are completed first the full resolution download and texture loading will continue in the background,
|
|
33
|
-
* and applyFullResolutionTextures can be called to apply full resolution textures to the
|
|
33
|
+
* and applyFullResolutionTextures can be called to apply full resolution textures to the image360VisualizationBox at a desired time.
|
|
34
34
|
*
|
|
35
35
|
* @returns lowResolutionCompleted A promise for when the low resolution images are done loading.
|
|
36
36
|
* @returns fullResolutionCompleted A promise for when the full resolution images are done loading.
|
|
@@ -39,6 +39,7 @@ export declare class Image360RevisionEntity implements Image360Revision {
|
|
|
39
39
|
lowResolutionCompleted: Promise<void>;
|
|
40
40
|
fullResolutionCompleted: Promise<void>;
|
|
41
41
|
};
|
|
42
|
+
getPreviewThumbnailUrl(face?: 'front' | 'back' | 'left' | 'right' | 'top' | 'bottom'): Promise<string | undefined>;
|
|
42
43
|
private loadPreviewTextures;
|
|
43
44
|
private loadFullTextures;
|
|
44
45
|
private loadAndSetAnnotations;
|
|
@@ -49,11 +50,11 @@ export declare class Image360RevisionEntity implements Image360Revision {
|
|
|
49
50
|
*/
|
|
50
51
|
dispose(): void;
|
|
51
52
|
/**
|
|
52
|
-
* Apply cached textures to the
|
|
53
|
+
* Apply cached textures to the image360VisualizationBox.
|
|
53
54
|
*/
|
|
54
55
|
applyTextures(): void;
|
|
55
56
|
/**
|
|
56
|
-
* Apply full resolution textures to the
|
|
57
|
+
* Apply full resolution textures to the image360VisualizationBox.
|
|
57
58
|
* This has no effect if full resolution has already been applied.
|
|
58
59
|
*/
|
|
59
60
|
applyFullResolutionTextures(): Promise<void>;
|
|
@@ -5,5 +5,5 @@ export { Overlay3DCollection } from './src/Overlay3DCollection';
|
|
|
5
5
|
export { OverlayPointsObject, OverlayPointsParameters } from './src/OverlayPointsObject';
|
|
6
6
|
export { Overlay3DIcon } from './src/Overlay3DIcon';
|
|
7
7
|
export { Overlay3D } from './src/Overlay3D';
|
|
8
|
-
export { OverlayCollection, OverlayInfo,
|
|
8
|
+
export { OverlayCollection, OverlayInfo, DefaultOverlay3DContentType } from './src/OverlayCollection';
|
|
9
9
|
export { IconOctree } from './src/IconOctree';
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import { Color, Vector3 } from 'three';
|
|
5
|
+
/**
|
|
6
|
+
* Represents one 3d overlay
|
|
7
|
+
*/
|
|
8
|
+
export interface Overlay3D<ContentType> {
|
|
5
9
|
/**
|
|
6
10
|
* Set whether this overlay should be visible.
|
|
7
11
|
* */
|
|
8
|
-
|
|
12
|
+
setVisible(visible: boolean): void;
|
|
9
13
|
/**
|
|
10
14
|
* Get whether this overlay is visible.
|
|
11
15
|
*/
|
|
12
|
-
|
|
16
|
+
getVisible(): boolean;
|
|
13
17
|
/**
|
|
14
18
|
* Get the position of this overlay.
|
|
15
19
|
*/
|
|
16
|
-
|
|
20
|
+
getPosition(): Vector3;
|
|
17
21
|
/**
|
|
18
22
|
* Set the display color of this overlay.
|
|
19
23
|
* */
|
|
20
|
-
setColor(color:
|
|
24
|
+
setColor(color: Color): void;
|
|
21
25
|
/**
|
|
22
26
|
* Get the display color of this overlay.
|
|
23
27
|
* */
|
|
24
|
-
|
|
28
|
+
getColor(): Color;
|
|
25
29
|
/**
|
|
26
30
|
* Get the metadata associated with this overlay.
|
|
27
31
|
* */
|
|
28
|
-
|
|
32
|
+
getContent(): ContentType;
|
|
29
33
|
}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Color, Texture, Object3D } from 'three';
|
|
5
5
|
import { Overlay3D } from './Overlay3D';
|
|
6
|
-
import {
|
|
6
|
+
import { DefaultOverlay3DContentType, OverlayCollection, OverlayInfo } from './OverlayCollection';
|
|
7
7
|
export type Overlay3DCollectionOptions = {
|
|
8
8
|
overlayTexture?: Texture;
|
|
9
9
|
maxPointSize?: number;
|
|
10
10
|
defaultOverlayColor?: Color;
|
|
11
11
|
};
|
|
12
|
-
export declare class Overlay3DCollection<MetadataType =
|
|
12
|
+
export declare class Overlay3DCollection<MetadataType = DefaultOverlay3DContentType> extends Object3D implements OverlayCollection<MetadataType> {
|
|
13
13
|
private readonly MinPixelSize;
|
|
14
14
|
private readonly MaxPixelSize;
|
|
15
15
|
private readonly DefaultMaxPoints;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { PerspectiveCamera, Ray, Vector3, Color } from 'three';
|
|
5
5
|
import { Overlay3D } from './Overlay3D';
|
|
6
|
-
import {
|
|
6
|
+
import { DefaultOverlay3DContentType } from './OverlayCollection';
|
|
7
7
|
export type IconParameters = {
|
|
8
8
|
position: THREE.Vector3;
|
|
9
9
|
color?: THREE.Color;
|
|
@@ -25,14 +25,14 @@ export type SelectedDelegate = (event: {
|
|
|
25
25
|
selected: boolean;
|
|
26
26
|
}) => void;
|
|
27
27
|
export type IconEvent = 'selected' | 'parametersChange';
|
|
28
|
-
export declare class Overlay3DIcon<
|
|
28
|
+
export declare class Overlay3DIcon<ContentType = DefaultOverlay3DContentType> implements Overlay3D<ContentType> {
|
|
29
29
|
private readonly _position;
|
|
30
30
|
private readonly _minPixelSize;
|
|
31
31
|
private readonly _maxPixelSize;
|
|
32
32
|
private readonly _setAdaptiveScale;
|
|
33
33
|
private readonly _iconRadius;
|
|
34
34
|
private readonly _hoverSprite?;
|
|
35
|
-
private readonly
|
|
35
|
+
private readonly _content;
|
|
36
36
|
private readonly _raycastBoundingSphere;
|
|
37
37
|
private _adaptiveScale;
|
|
38
38
|
private _visible;
|
|
@@ -41,7 +41,7 @@ export declare class Overlay3DIcon<MetadataType = DefaultMetadataType> implement
|
|
|
41
41
|
private _color;
|
|
42
42
|
private readonly _ndcPosition;
|
|
43
43
|
private readonly _events;
|
|
44
|
-
constructor(iconParameters: IconParameters,
|
|
44
|
+
constructor(iconParameters: IconParameters, content: ContentType);
|
|
45
45
|
on(event: 'selected', callback: SelectedDelegate): void;
|
|
46
46
|
on(event: 'parametersChange', callback: ParametersChangeDelegate): void;
|
|
47
47
|
off(event: 'selected', callback: SelectedDelegate): void;
|
|
@@ -55,14 +55,14 @@ export declare class Overlay3DIcon<MetadataType = DefaultMetadataType> implement
|
|
|
55
55
|
domElement: HTMLElement;
|
|
56
56
|
}): void;
|
|
57
57
|
setColor(color: Color): void;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
getColor(): Color;
|
|
59
|
+
getContent(): ContentType;
|
|
60
60
|
get adaptiveScale(): number;
|
|
61
61
|
set culled(culled: boolean);
|
|
62
62
|
get culled(): boolean;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
setVisible(visible: boolean): void;
|
|
64
|
+
getVisible(): boolean;
|
|
65
|
+
getPosition(): Vector3;
|
|
66
66
|
intersect(ray: Ray): Vector3 | null;
|
|
67
67
|
dispose(): void;
|
|
68
68
|
private setupAdaptiveScaling;
|
|
@@ -2,31 +2,48 @@
|
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Overlay3D } from './Overlay3D';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The default metadata type contained in Overlays
|
|
7
|
+
*/
|
|
8
|
+
export type DefaultOverlay3DContentType = {
|
|
9
|
+
[key: string]: string;
|
|
8
10
|
};
|
|
9
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Data used in creating an overlay
|
|
13
|
+
*/
|
|
14
|
+
export type OverlayInfo<ContentType = DefaultOverlay3DContentType> = {
|
|
15
|
+
/**
|
|
16
|
+
* Position of the overlay
|
|
17
|
+
*/
|
|
10
18
|
position: THREE.Vector3;
|
|
11
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The data contained in this overlay
|
|
21
|
+
*/
|
|
22
|
+
content: ContentType;
|
|
23
|
+
/**
|
|
24
|
+
* The color of this overlay. Will be set by collection if undefined
|
|
25
|
+
*/
|
|
12
26
|
color?: THREE.Color;
|
|
13
27
|
};
|
|
14
|
-
|
|
28
|
+
/**
|
|
29
|
+
* A set of overlays managed
|
|
30
|
+
*/
|
|
31
|
+
export interface OverlayCollection<ContentType> {
|
|
15
32
|
/**
|
|
16
33
|
* Get all overlays in the collection.
|
|
17
34
|
* */
|
|
18
|
-
getOverlays(): Overlay3D<
|
|
35
|
+
getOverlays(): Overlay3D<ContentType>[];
|
|
19
36
|
/**
|
|
20
37
|
* Add overlays to the collection.
|
|
21
38
|
* @param overlays Overlays to add to the collection.
|
|
22
39
|
* @returns The added overlays.
|
|
23
40
|
*/
|
|
24
|
-
addOverlays(overlays: OverlayInfo<
|
|
41
|
+
addOverlays(overlays: OverlayInfo<ContentType>[]): Overlay3D<ContentType>[];
|
|
25
42
|
/**
|
|
26
43
|
* Remove overlays from the collection.
|
|
27
44
|
* @param overlays Overlays to remove from the collection.
|
|
28
45
|
*/
|
|
29
|
-
removeOverlays(overlays: Overlay3D<
|
|
46
|
+
removeOverlays(overlays: Overlay3D<ContentType>[]): void;
|
|
30
47
|
/**
|
|
31
48
|
* Remove all overlays from the collection.
|
|
32
49
|
*/
|
|
@@ -114,10 +114,10 @@ export declare class Cognite3DViewer {
|
|
|
114
114
|
/**
|
|
115
115
|
* Dispose of WebGL resources. Can be used to free up memory when the viewer is no longer in use.
|
|
116
116
|
* @see {@link https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects}
|
|
117
|
-
* ```
|
|
117
|
+
* ```js
|
|
118
118
|
* // Viewer is no longer in use, free up memory
|
|
119
119
|
* viewer.dispose();
|
|
120
|
-
*
|
|
120
|
+
* ```
|
|
121
121
|
*/
|
|
122
122
|
dispose(): void;
|
|
123
123
|
/**
|
|
@@ -29,9 +29,9 @@ export type Image360Descriptor = {
|
|
|
29
29
|
};
|
|
30
30
|
export type Image360EventDescriptor = {
|
|
31
31
|
id: string;
|
|
32
|
-
label: string;
|
|
32
|
+
label: string | undefined;
|
|
33
33
|
collectionId: string;
|
|
34
|
-
collectionLabel: string;
|
|
34
|
+
collectionLabel: string | undefined;
|
|
35
35
|
transform: THREE.Matrix4;
|
|
36
36
|
};
|
|
37
37
|
export type Image360Face = {
|
|
@@ -5,7 +5,7 @@ export { HtmlOverlayTool, HtmlOverlayOptions, HtmlOverlayToolOptions, HtmlOverla
|
|
|
5
5
|
export { DebugCameraTool } from './src/DebugCameraTool';
|
|
6
6
|
export { AxisViewTool } from './src/AxisView/AxisViewTool';
|
|
7
7
|
export { AxisBoxConfig, AxisBoxCompassConfig, AxisBoxFaceConfig, Corner, AbsolutePosition, RelativePosition } from './src/AxisView/types';
|
|
8
|
-
export {
|
|
8
|
+
export { Overlay3DTool, Overlay3DToolParameters, OverlayEventHandler, OverlayToolEvent } from './src/Overlay3D/Overlay3DTool';
|
|
9
9
|
export { TimelineTool } from './src/Timeline/TimelineTool';
|
|
10
10
|
export { Keyframe } from './src/Timeline/Keyframe';
|
|
11
11
|
export { TimelineDateUpdateDelegate } from './src/Timeline/types';
|
package/dist/packages/tools/src/{SmartOverlay/SmartOverlayTool.d.ts → Overlay3D/Overlay3DTool.d.ts}
RENAMED
|
@@ -4,18 +4,27 @@
|
|
|
4
4
|
import { Cognite3DViewer } from '../../../api';
|
|
5
5
|
import { DisposedDelegate } from '../../../utilities';
|
|
6
6
|
import * as THREE from 'three';
|
|
7
|
-
import { OverlayInfo,
|
|
7
|
+
import { OverlayInfo, DefaultOverlay3DContentType, OverlayCollection, Overlay3D } from '../../../3d-overlays';
|
|
8
8
|
import { Cognite3DViewerToolBase } from '../Cognite3DViewerToolBase';
|
|
9
|
+
/**
|
|
10
|
+
* Events related to overlays
|
|
11
|
+
*/
|
|
9
12
|
export type OverlayToolEvent = 'hover' | 'click' | 'disposed';
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Type for handlers of overlay events
|
|
15
|
+
*/
|
|
16
|
+
export type OverlayEventHandler<ContentType> = (event: {
|
|
17
|
+
targetOverlay: Overlay3D<ContentType>;
|
|
12
18
|
htmlOverlay: HTMLElement;
|
|
13
19
|
mousePosition: {
|
|
14
20
|
clientX: number;
|
|
15
21
|
clientY: number;
|
|
16
22
|
};
|
|
17
23
|
}) => void;
|
|
18
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Parameters for instantiating the Overlay3DTool
|
|
26
|
+
*/
|
|
27
|
+
export type Overlay3DToolParameters = {
|
|
19
28
|
/**
|
|
20
29
|
* Max point markers size in pixels. Different platforms has limitations for this value.
|
|
21
30
|
* On Android and MacOS in Chrome maximum is 64. Windows in Chrome and MacOS Safari desktops can support up to 500.
|
|
@@ -27,7 +36,10 @@ export type SmartOverlayToolParameters = {
|
|
|
27
36
|
*/
|
|
28
37
|
defaultOverlayColor: THREE.Color;
|
|
29
38
|
};
|
|
30
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Tool for adding and interacting with 2D overlays positioned at points in
|
|
41
|
+
*/
|
|
42
|
+
export declare class Overlay3DTool<ContentType = DefaultOverlay3DContentType> extends Cognite3DViewerToolBase {
|
|
31
43
|
private readonly _viewer;
|
|
32
44
|
private readonly _textOverlay;
|
|
33
45
|
private readonly _defaultOverlayColor;
|
|
@@ -38,29 +50,38 @@ export declare class SmartOverlayTool<MetadataType = DefaultMetadataType> extend
|
|
|
38
50
|
private _isVisible;
|
|
39
51
|
private _textOverlayVisible;
|
|
40
52
|
private readonly _events;
|
|
41
|
-
constructor(viewer: Cognite3DViewer, toolParameters?:
|
|
53
|
+
constructor(viewer: Cognite3DViewer, toolParameters?: Overlay3DToolParameters);
|
|
42
54
|
/**
|
|
43
55
|
* Creates new OverlayCollection.
|
|
44
56
|
* @param overlays Array of overlays to add.
|
|
45
57
|
* @returns Overlay group containing it's id.
|
|
46
58
|
*/
|
|
47
|
-
createOverlayCollection(overlays?: OverlayInfo<
|
|
59
|
+
createOverlayCollection(overlays?: OverlayInfo<ContentType>[]): OverlayCollection<ContentType>;
|
|
48
60
|
/**
|
|
49
61
|
* Removes overlays that were added with addOverlays method.
|
|
50
62
|
* @param overlayCollection Id of the overlay group to remove.
|
|
51
63
|
*/
|
|
52
|
-
removeOverlayCollection(overlayCollection: OverlayCollection<
|
|
64
|
+
removeOverlayCollection(overlayCollection: OverlayCollection<ContentType>): void;
|
|
53
65
|
/**
|
|
54
66
|
* Gets all added overlay collections.
|
|
55
67
|
*/
|
|
56
|
-
|
|
68
|
+
getCollections(): OverlayCollection<ContentType>[];
|
|
57
69
|
/**
|
|
58
70
|
* Sets whether overlays are visible.
|
|
59
71
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
setVisible(visible: boolean): void;
|
|
73
|
+
/**
|
|
74
|
+
* Gets whether overlays are visible.
|
|
75
|
+
*/
|
|
76
|
+
getVisible(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Sets whether text overlay is visible.
|
|
79
|
+
*/
|
|
80
|
+
setTextOverlayVisible(visible: boolean): void;
|
|
81
|
+
/**
|
|
82
|
+
* Gets whether text overlay is visible.
|
|
83
|
+
*/
|
|
84
|
+
getTextOverlayVisible(): boolean;
|
|
64
85
|
/**
|
|
65
86
|
* Removes all overlays.
|
|
66
87
|
*/
|
|
@@ -70,12 +91,15 @@ export declare class SmartOverlayTool<MetadataType = DefaultMetadataType> extend
|
|
|
70
91
|
* @param event event to subscribe to.
|
|
71
92
|
* @param eventHandler
|
|
72
93
|
*/
|
|
73
|
-
on(event: 'hover', eventHandler: OverlayEventHandler<
|
|
74
|
-
on(event: 'click', eventHandler: OverlayEventHandler<
|
|
94
|
+
on(event: 'hover', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
95
|
+
on(event: 'click', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
75
96
|
on(event: 'disposed', eventHandler: DisposedDelegate): void;
|
|
76
|
-
off(event: 'hover', eventHandler: OverlayEventHandler<
|
|
77
|
-
off(event: 'click', eventHandler: OverlayEventHandler<
|
|
97
|
+
off(event: 'hover', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
98
|
+
off(event: 'click', eventHandler: OverlayEventHandler<ContentType>): void;
|
|
78
99
|
off(event: 'disposed', eventHandler: DisposedDelegate): void;
|
|
100
|
+
/**
|
|
101
|
+
* Dispose of resources used by this tool
|
|
102
|
+
*/
|
|
79
103
|
dispose(): void;
|
|
80
104
|
private readonly onMouseMove;
|
|
81
105
|
private readonly onMouseClick;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.2.0-dev.
|
|
3
|
+
"version": "4.2.0-dev.20230526",
|
|
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": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"rxjs": "7.8.1",
|
|
77
77
|
"skmeans": "0.11.3",
|
|
78
78
|
"sparse-octree": "7.1.6",
|
|
79
|
-
"three-stdlib": "2.21.
|
|
79
|
+
"three-stdlib": "2.21.12"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@azure/msal-browser": "2.37.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"concurrently": "8.0.1",
|
|
103
103
|
"cross-env": "7.0.3",
|
|
104
104
|
"dat.gui": "0.7.9",
|
|
105
|
-
"eslint": "8.
|
|
105
|
+
"eslint": "8.41.0",
|
|
106
106
|
"eslint-config-prettier": "8.8.0",
|
|
107
107
|
"eslint-plugin-header": "3.1.1",
|
|
108
108
|
"eslint-plugin-jsdoc": "44.2.4",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"eslint-plugin-unused-imports": "2.0.0",
|
|
112
112
|
"file-loader": "6.2.0",
|
|
113
113
|
"gl": "6.0.2",
|
|
114
|
-
"glob": "10.2.
|
|
114
|
+
"glob": "10.2.6",
|
|
115
115
|
"glslify-loader": "2.0.0",
|
|
116
116
|
"html-webpack-plugin": "5.5.1",
|
|
117
117
|
"jest": "29.5.0",
|