@cognite/reveal 4.2.0-dev.20230421 → 4.2.0-dev.20230425
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 +1 -1
- package/dist/index.js +136 -128
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/index.d.ts +1 -1
- package/dist/packages/360-images/src/annotation/BoxAnnotationData.d.ts +14 -0
- package/dist/packages/360-images/src/annotation/ImageAnnotationData.d.ts +8 -0
- package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +6 -7
- package/dist/packages/360-images/src/annotation/PolygonAnnotationData.d.ts +13 -0
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +8 -1
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +5 -2
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +3 -2
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +2 -2
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +0 -1
- package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +5 -2
- package/dist/packages/360-images/src/types.d.ts +4 -0
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +6 -3
- package/dist/packages/cad-model/src/wrappers/CadNode.d.ts +1 -0
- package/package.json +5 -5
|
@@ -9,5 +9,5 @@ export { Image360CollectionFactory } from './src/collection/Image360CollectionFa
|
|
|
9
9
|
export { Image360Entity } from './src/entity/Image360Entity';
|
|
10
10
|
export { Image360RevisionEntity } from './src/entity/Image360RevisionEntity';
|
|
11
11
|
export { Image360Visualization } from './src/entity/Image360Visualization';
|
|
12
|
-
export { Image360EnteredDelegate, Image360ExitedDelegate, Image360AnnotationHoveredDelegate } from './src/types';
|
|
12
|
+
export { Image360EnteredDelegate, Image360ExitedDelegate, Image360AnnotationHoveredDelegate, Image360AnnotationClickedDelegate } from './src/types';
|
|
13
13
|
export { DefaultImage360Collection } from './src/collection/DefaultImage360Collection';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { ImageAnnotationObjectData } from './ImageAnnotationData';
|
|
5
|
+
import { BufferGeometry, Matrix4, PlaneGeometry } from 'three';
|
|
6
|
+
import { AnnotationsBoundingBox, AnnotationsObjectDetection } from '@cognite/sdk';
|
|
7
|
+
export declare class BoxAnnotationData implements ImageAnnotationObjectData {
|
|
8
|
+
private readonly _geometry;
|
|
9
|
+
private readonly _initialTranslation;
|
|
10
|
+
constructor(annotation: AnnotationsObjectDetection);
|
|
11
|
+
createGeometry(annotationsBox: AnnotationsBoundingBox): PlaneGeometry;
|
|
12
|
+
getGeometry(): BufferGeometry;
|
|
13
|
+
getNormalizationMatrix(): Matrix4;
|
|
14
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { AnnotationModel } from '@cognite/sdk';
|
|
5
5
|
import { Image360FileDescriptor } from '../../../data-providers';
|
|
6
6
|
import { Object3D } from 'three';
|
|
7
|
+
type FaceType = Image360FileDescriptor['face'];
|
|
7
8
|
export declare class ImageAnnotationObject {
|
|
8
9
|
private readonly _annotation;
|
|
9
|
-
private readonly _fileDescriptor;
|
|
10
10
|
private readonly _mesh;
|
|
11
11
|
get annotation(): AnnotationModel;
|
|
12
|
-
|
|
13
|
-
constructor(
|
|
14
|
-
private initializeMesh;
|
|
12
|
+
static createAnnotationObject(annotation: AnnotationModel, face: FaceType): ImageAnnotationObject | undefined;
|
|
13
|
+
private constructor();
|
|
15
14
|
private getRotationFromFace;
|
|
16
15
|
private initializeTransform;
|
|
17
16
|
getObject(): Object3D;
|
|
18
17
|
}
|
|
19
|
-
export
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { BufferGeometry, Matrix4, ShapeGeometry } from 'three';
|
|
5
|
+
import { AnnotationsObjectDetection } from '@cognite/sdk';
|
|
6
|
+
import { ImageAnnotationObjectData } from './ImageAnnotationData';
|
|
7
|
+
export declare class PolygonAnnotationData implements ImageAnnotationObjectData {
|
|
8
|
+
private readonly _geometry;
|
|
9
|
+
constructor(annotation: AnnotationsObjectDetection);
|
|
10
|
+
createGeometry(annotation: AnnotationsObjectDetection): ShapeGeometry;
|
|
11
|
+
getGeometry(): BufferGeometry;
|
|
12
|
+
getNormalizationMatrix(): Matrix4;
|
|
13
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { EventTrigger } from '../../../utilities';
|
|
5
5
|
import { Image360Collection } from './Image360Collection';
|
|
6
6
|
import { Image360Entity } from '../entity/Image360Entity';
|
|
7
|
-
import { Image360AnnotationHoveredDelegate, Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
7
|
+
import { Image360AnnotationClickedDelegate, Image360AnnotationHoveredDelegate, Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
8
8
|
import { IconCollection, IconCullingScheme } from '../icons/IconCollection';
|
|
9
9
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
10
10
|
/**
|
|
@@ -21,6 +21,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
21
21
|
* If undefined, the most recent revision will be loaded.
|
|
22
22
|
*/
|
|
23
23
|
private _targetRevisionDate;
|
|
24
|
+
private _needsRedraw;
|
|
24
25
|
private readonly _events;
|
|
25
26
|
private readonly _icons;
|
|
26
27
|
private _isCollectionVisible;
|
|
@@ -35,6 +36,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
35
36
|
image360Entered: EventTrigger<Image360EnteredDelegate>;
|
|
36
37
|
image360Exited: EventTrigger<Image360ExitedDelegate>;
|
|
37
38
|
annotationHovered: EventTrigger<Image360AnnotationHoveredDelegate>;
|
|
39
|
+
annotationClicked: EventTrigger<Image360AnnotationClickedDelegate>;
|
|
38
40
|
};
|
|
39
41
|
get isCollectionVisible(): boolean;
|
|
40
42
|
constructor(collectionId: string, entities: Image360Entity[], icons: IconCollection);
|
|
@@ -48,6 +50,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
48
50
|
on(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
49
51
|
on(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
50
52
|
on(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
53
|
+
on(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
51
54
|
/**
|
|
52
55
|
* Specify parameters used to determine the number of icons that are visible when entering 360 Images.
|
|
53
56
|
* @param radius Only icons within the given radius will be made visible.
|
|
@@ -67,9 +70,13 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
67
70
|
off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
68
71
|
off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
69
72
|
off(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
73
|
+
off(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
70
74
|
fireHoverEvent(annotationObject: ImageAnnotationObject): void;
|
|
75
|
+
fireClickEvent(annotationObject: ImageAnnotationObject): void;
|
|
71
76
|
setSelectedVisibility(visible: boolean): void;
|
|
72
77
|
setCullingScheme(scheme: IconCullingScheme): void;
|
|
73
78
|
remove(entity: Image360Entity): void;
|
|
74
79
|
dispose(): void;
|
|
80
|
+
get needsRedraw(): boolean;
|
|
81
|
+
resetRedraw(): void;
|
|
75
82
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Image360 } from './../entity/Image360';
|
|
5
|
-
import { Image360AnnotationHoveredDelegate, Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
5
|
+
import { Image360AnnotationClickedDelegate, Image360AnnotationHoveredDelegate, Image360EnteredDelegate, Image360ExitedDelegate } from '../types';
|
|
6
6
|
/**
|
|
7
7
|
* A wrapper that represents a set of 360 images.
|
|
8
8
|
*/
|
|
@@ -31,13 +31,15 @@ export interface Image360Collection {
|
|
|
31
31
|
* Subscribes to events on 360 Image datasets. There are several event types:
|
|
32
32
|
* 'image360Entered' - Subscribes to a event for entering 360 image mode.
|
|
33
33
|
* 'image360Exited' - Subscribes to events indicating 360 image mode has exited.
|
|
34
|
-
* 'image360AnnotationHovered - Subscribes to events indicating that the cursor hovered over
|
|
34
|
+
* 'image360AnnotationHovered - Subscribes to events indicating that the cursor hovered over an image annotation.
|
|
35
|
+
* 'image360AnnotationClicked - Subscribes to events indicating a click on an image annotation
|
|
35
36
|
* @param event The event type.
|
|
36
37
|
* @param callback Callback to be called when the event is fired.
|
|
37
38
|
*/
|
|
38
39
|
on(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
39
40
|
on(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
40
41
|
on(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
42
|
+
on(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
41
43
|
/**
|
|
42
44
|
* Unsubscribes from 360 image dataset event.
|
|
43
45
|
* @param event The event type.
|
|
@@ -46,4 +48,5 @@ export interface Image360Collection {
|
|
|
46
48
|
off(event: 'image360Entered', callback: Image360EnteredDelegate): void;
|
|
47
49
|
off(event: 'image360Exited', callback: Image360ExitedDelegate): void;
|
|
48
50
|
off(event: 'image360AnnotationHovered', callback: Image360AnnotationHoveredDelegate): void;
|
|
51
|
+
off(event: 'image360AnnotationClicked', callback: Image360AnnotationClickedDelegate): void;
|
|
49
52
|
}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Provider } from '../../../data-providers';
|
|
5
|
-
import { BeforeSceneRenderedDelegate, EventTrigger, SceneHandler } from '../../../utilities';
|
|
5
|
+
import { BeforeSceneRenderedDelegate, DeviceDescriptor, EventTrigger, SceneHandler } from '../../../utilities';
|
|
6
6
|
import { DefaultImage360Collection } from './DefaultImage360Collection';
|
|
7
7
|
export declare class Image360CollectionFactory<T> {
|
|
8
8
|
private readonly _image360DataProvider;
|
|
9
9
|
private readonly _sceneHandler;
|
|
10
10
|
private readonly _onBeforeSceneRendered;
|
|
11
|
-
|
|
11
|
+
private readonly _device;
|
|
12
|
+
constructor(image360DataProvider: Image360Provider<T>, sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>, device: DeviceDescriptor);
|
|
12
13
|
create(dataProviderFilter: T, postTransform: THREE.Matrix4, preMultipliedRotation: boolean): Promise<DefaultImage360Collection>;
|
|
13
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { SceneHandler } from '../../../utilities';
|
|
4
|
+
import { DeviceDescriptor, SceneHandler } from '../../../utilities';
|
|
5
5
|
import { Image360DataProvider } from '../../../data-providers';
|
|
6
6
|
import { Image360Icon } from '../icons/Image360Icon';
|
|
7
7
|
import { Image360, Image360Metadata } from './Image360';
|
|
@@ -33,7 +33,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
33
33
|
* @returns Image360Visualization
|
|
34
34
|
*/
|
|
35
35
|
get image360Visualization(): Image360VisualizationBox;
|
|
36
|
-
constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, transform: THREE.Matrix4, icon: Image360Icon);
|
|
36
|
+
constructor(image360Metadata: Historical360ImageSet, sceneHandler: SceneHandler, imageProvider: Image360DataProvider, transform: THREE.Matrix4, icon: Image360Icon, device: DeviceDescriptor);
|
|
37
37
|
/**
|
|
38
38
|
* List all historical images for this entity.
|
|
39
39
|
* @returns A list of available revisions.
|
|
@@ -20,7 +20,6 @@ export declare class Image360RevisionEntity implements Image360Revision {
|
|
|
20
20
|
get date(): Date | undefined;
|
|
21
21
|
get annotations(): ImageAnnotationObject[];
|
|
22
22
|
intersectAnnotations(raycaster: THREE.Raycaster): ImageAnnotationObject | undefined;
|
|
23
|
-
private createQuadFromAnnotation;
|
|
24
23
|
/**
|
|
25
24
|
* Loads the textures needed for the 360 image (6 faces).
|
|
26
25
|
*
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { SceneHandler } from '../../../utilities';
|
|
5
|
+
import { DeviceDescriptor, SceneHandler } from '../../../utilities';
|
|
6
6
|
import { Image360Face, Image360Texture } from '../../../data-providers';
|
|
7
7
|
import { Image360Visualization } from './Image360Visualization';
|
|
8
8
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
9
9
|
export declare class Image360VisualizationBox implements Image360Visualization {
|
|
10
|
+
private readonly MAX_MOBILE_IMAGE_SIZE;
|
|
10
11
|
private readonly _worldTransform;
|
|
11
12
|
private _visualizationMesh;
|
|
12
13
|
private _faceMaterials;
|
|
13
14
|
private readonly _sceneHandler;
|
|
15
|
+
private readonly _device;
|
|
14
16
|
private readonly _visualizationState;
|
|
15
17
|
private readonly _textureLoader;
|
|
16
18
|
private readonly _faceMaterialOrder;
|
|
@@ -23,8 +25,9 @@ export declare class Image360VisualizationBox implements Image360Visualization {
|
|
|
23
25
|
set scale(newScale: THREE.Vector3);
|
|
24
26
|
set renderOrder(newRenderOrder: number);
|
|
25
27
|
setAnnotations(annotations: ImageAnnotationObject[]): void;
|
|
26
|
-
constructor(worldTransform: THREE.Matrix4, sceneHandler: SceneHandler);
|
|
28
|
+
constructor(worldTransform: THREE.Matrix4, sceneHandler: SceneHandler, device: DeviceDescriptor);
|
|
27
29
|
loadImages(textures: Image360Texture[]): void;
|
|
28
30
|
loadFaceTextures(faces: Image360Face[]): Promise<Image360Texture[]>;
|
|
29
31
|
unloadImages(): void;
|
|
32
|
+
private getScaledImageTexture;
|
|
30
33
|
}
|
|
@@ -16,3 +16,7 @@ export type Image360ExitedDelegate = () => void;
|
|
|
16
16
|
* Delegate for 360 image annotation hover events
|
|
17
17
|
*/
|
|
18
18
|
export type Image360AnnotationHoveredDelegate = (annotation: AnnotationModel) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Delegate for 360 image annotation click events
|
|
21
|
+
*/
|
|
22
|
+
export type Image360AnnotationClickedDelegate = (annotation: AnnotationModel) => void;
|
|
@@ -11,20 +11,23 @@ export declare class Image360ApiHelper {
|
|
|
11
11
|
private readonly _domElement;
|
|
12
12
|
private _transitionInProgress;
|
|
13
13
|
private readonly _raycaster;
|
|
14
|
+
private _needsRedraw;
|
|
14
15
|
private readonly _interactionState;
|
|
15
16
|
private readonly _eventHandlers;
|
|
16
17
|
private readonly _debouncePreLoad;
|
|
17
|
-
private readonly _requestRedraw;
|
|
18
18
|
private readonly _activeCameraManager;
|
|
19
19
|
private readonly _image360Navigation;
|
|
20
20
|
private readonly _onBeforeSceneRenderedEvent;
|
|
21
21
|
private _cachedCameraManager;
|
|
22
|
-
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler,
|
|
22
|
+
constructor(cogniteClient: CogniteClient, sceneHandler: SceneHandler, domElement: HTMLElement, activeCameraManager: ProxyCameraManager, inputHandler: InputHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>);
|
|
23
|
+
get needsRedraw(): boolean;
|
|
24
|
+
resetRedraw(): void;
|
|
23
25
|
private getNormalizedOffset;
|
|
24
|
-
private
|
|
26
|
+
private handleAnnotationCursorEvent;
|
|
25
27
|
add360ImageSet(eventFilter: Metadata, collectionTransform: THREE.Matrix4, preMultipliedRotation: boolean): Promise<Image360Collection>;
|
|
26
28
|
remove360Images(entities: Image360[]): Promise<void>;
|
|
27
29
|
enter360Image(image360Entity: Image360Entity, revision?: Image360RevisionEntity): Promise<void>;
|
|
30
|
+
private applyFullResolutionTextures;
|
|
28
31
|
private transition;
|
|
29
32
|
private tweenVisualizationAlpha;
|
|
30
33
|
private tweenVisualizationZoom;
|
|
@@ -22,6 +22,7 @@ export declare class CadNode extends Object3D {
|
|
|
22
22
|
private _needsRedraw;
|
|
23
23
|
constructor(model: CadModelMetadata, materialManager: CadMaterialManager, sectorRepository: SectorRepository);
|
|
24
24
|
get needsRedraw(): boolean;
|
|
25
|
+
resetRedraw(): void;
|
|
25
26
|
get nodeTransformProvider(): NodeTransformProvider;
|
|
26
27
|
get nodeAppearanceProvider(): NodeAppearanceProvider;
|
|
27
28
|
get defaultNodeAppearance(): NodeAppearance;
|
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.20230425",
|
|
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": {
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"@types/jest-environment-puppeteer": "5.0.3",
|
|
89
89
|
"@types/jest-image-snapshot": "6.1.0",
|
|
90
90
|
"@types/jsdom": "21.1.1",
|
|
91
|
-
"@types/lodash": "4.14.
|
|
91
|
+
"@types/lodash": "4.14.194",
|
|
92
92
|
"@types/mixpanel-browser": "2.38.1",
|
|
93
|
-
"@types/node": "18.15.
|
|
93
|
+
"@types/node": "18.15.12",
|
|
94
94
|
"@types/random-seed": "0.3.3",
|
|
95
95
|
"@types/skmeans": "0.11.4",
|
|
96
96
|
"@types/stats": "0.16.30",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"nock": "13.3.0",
|
|
125
125
|
"prettier": "2.8.7",
|
|
126
126
|
"process": "0.11.10",
|
|
127
|
-
"puppeteer": "19.
|
|
127
|
+
"puppeteer": "19.9.1",
|
|
128
128
|
"random-seed": "0.3.0",
|
|
129
129
|
"raw-loader": "4.0.2",
|
|
130
130
|
"remove-files-webpack-plugin": "1.5.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"tsc-alias": "1.8.5",
|
|
138
138
|
"typescript": "5.0.4",
|
|
139
139
|
"wasm-pack": "0.10.3",
|
|
140
|
-
"webpack": "5.
|
|
140
|
+
"webpack": "5.80.0",
|
|
141
141
|
"webpack-cli": "5.0.1",
|
|
142
142
|
"webpack-dev-server": "4.13.3",
|
|
143
143
|
"webpack-node-externals": "3.0.0",
|