@cognite/reveal 4.1.1-dev.20230322 → 4.1.1-dev.20230324
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/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +7 -2
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +17 -1
- package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +4 -3
- package/dist/packages/data-providers/index.d.ts +1 -1
- package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageEventProvider.d.ts +7 -0
- package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts +1 -0
- package/dist/packages/data-providers/src/types.d.ts +5 -0
- package/package.json +4 -4
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
import { Image360Entity } from '../entity/Image360Entity';
|
|
5
5
|
export type DownloadRequest = {
|
|
6
6
|
entity: Image360Entity;
|
|
7
|
-
|
|
7
|
+
firstCompleted: Promise<void>;
|
|
8
|
+
fullResolutionCompleted: Promise<void>;
|
|
8
9
|
abort: () => void;
|
|
9
10
|
};
|
|
11
|
+
export type Loaded360Image = {
|
|
12
|
+
entity: Image360Entity;
|
|
13
|
+
isFullResolution: boolean;
|
|
14
|
+
};
|
|
10
15
|
export declare class Image360LoadingCache {
|
|
11
16
|
private readonly _imageCacheSize;
|
|
12
17
|
private readonly _downloadCacheSize;
|
|
@@ -19,7 +24,7 @@ export declare class Image360LoadingCache {
|
|
|
19
24
|
constructor(_imageCacheSize?: number, _downloadCacheSize?: number);
|
|
20
25
|
cachedPreload(entity: Image360Entity, lockDownload?: boolean): Promise<void>;
|
|
21
26
|
purge(entity: Image360Entity): Promise<void>;
|
|
22
|
-
private
|
|
27
|
+
private addEntityToCache;
|
|
23
28
|
private abortLastRecentlyReqestedEntity;
|
|
24
29
|
private createAbortSignal;
|
|
25
30
|
}
|
|
@@ -13,6 +13,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
13
13
|
private readonly _transform;
|
|
14
14
|
private readonly _image360Icon;
|
|
15
15
|
private readonly _image360VisualzationBox;
|
|
16
|
+
private _getFullResolutionTextures;
|
|
16
17
|
/**
|
|
17
18
|
* Get a copy of the model-to-world transformation matrix
|
|
18
19
|
* of the given 360 image.
|
|
@@ -33,8 +34,23 @@ export declare class Image360Entity implements Image360 {
|
|
|
33
34
|
constructor(image360Metadata: Image360Descriptor, sceneHandler: SceneHandler, imageProvider: Image360FileProvider, transform: THREE.Matrix4, icon: Image360Icon);
|
|
34
35
|
/**
|
|
35
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.
|
|
36
45
|
*/
|
|
37
|
-
load360Image(abortSignal?: AbortSignal):
|
|
46
|
+
load360Image(abortSignal?: AbortSignal): {
|
|
47
|
+
firstCompleted: Promise<void>;
|
|
48
|
+
fullResolutionCompleted: Promise<void>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Apply full resolution textures to the image360VisualzationBox. This has no effect if full resolution has already been applied.
|
|
52
|
+
*/
|
|
53
|
+
applyFullResolution(): Promise<void>;
|
|
38
54
|
/**
|
|
39
55
|
* Drops the GPU resources for the 360 image
|
|
40
56
|
* the icon will be preserved.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { SceneHandler } from '../../../utilities';
|
|
6
|
-
import { Image360Face } from '../../../data-providers';
|
|
6
|
+
import { Image360Face, Image360Texture } from '../../../data-providers';
|
|
7
7
|
import { Image360Visualization } from './Image360Visualization';
|
|
8
8
|
export declare class Image360VisualizationBox implements Image360Visualization {
|
|
9
9
|
private readonly _worldTransform;
|
|
@@ -12,6 +12,7 @@ export declare class Image360VisualizationBox implements Image360Visualization {
|
|
|
12
12
|
private readonly _sceneHandler;
|
|
13
13
|
private readonly _visualizationState;
|
|
14
14
|
private readonly _textureLoader;
|
|
15
|
+
private readonly _faceMaterialOrder;
|
|
15
16
|
get opacity(): number;
|
|
16
17
|
set opacity(alpha: number);
|
|
17
18
|
get visible(): boolean;
|
|
@@ -19,7 +20,7 @@ export declare class Image360VisualizationBox implements Image360Visualization {
|
|
|
19
20
|
set scale(newScale: THREE.Vector3);
|
|
20
21
|
set renderOrder(newRenderOrder: number);
|
|
21
22
|
constructor(worldTransform: THREE.Matrix4, sceneHandler: SceneHandler);
|
|
22
|
-
loadImages(
|
|
23
|
-
|
|
23
|
+
loadImages(textures: Image360Texture[]): Promise<void>;
|
|
24
|
+
loadFaceTextures(faces: Image360Face[]): Promise<Image360Texture[]>;
|
|
24
25
|
unloadImages(): void;
|
|
25
26
|
}
|
|
@@ -18,4 +18,4 @@ export { StylableObject, SerializableStylableObject } from './src/pointcloud-sty
|
|
|
18
18
|
export { CdfPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider';
|
|
19
19
|
export { DummyPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider';
|
|
20
20
|
export { Image360Provider } from './src/Image360Provider';
|
|
21
|
-
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face } from './src/types';
|
|
21
|
+
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture } from './src/types';
|
package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageEventProvider.d.ts
CHANGED
|
@@ -9,11 +9,18 @@ export declare class Cdf360ImageEventProvider implements Image360Provider<Metada
|
|
|
9
9
|
constructor(client: CogniteClient);
|
|
10
10
|
get360ImageDescriptors(metadataFilter: Metadata, preMultipliedRotation: boolean): Promise<Image360Descriptor[]>;
|
|
11
11
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
12
|
+
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
13
|
+
private getFileIds;
|
|
14
|
+
private createFaces;
|
|
12
15
|
private mergeDescriptors;
|
|
13
16
|
private listEvents;
|
|
14
17
|
private listFiles;
|
|
15
18
|
private getNewestFileInfoSet;
|
|
16
19
|
private getFileBuffers;
|
|
20
|
+
getIconBuffers(fileIds: {
|
|
21
|
+
id: number;
|
|
22
|
+
}[], abortSignal?: AbortSignal): Promise<ArrayBuffer[]>;
|
|
23
|
+
private getDownloadUrls;
|
|
17
24
|
private parseEventMetadata;
|
|
18
25
|
get360ImageFaces(): Promise<void>;
|
|
19
26
|
}
|
package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export declare class Local360ImageProvider implements Image360Provider<unknown>
|
|
|
5
5
|
constructor(modelUrl: string);
|
|
6
6
|
get360ImageDescriptors(): Promise<Image360Descriptor[]>;
|
|
7
7
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
8
|
+
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
8
9
|
}
|
|
@@ -13,6 +13,7 @@ export interface Image360DescriptorProvider<T> {
|
|
|
13
13
|
}
|
|
14
14
|
export interface Image360FileProvider {
|
|
15
15
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
16
|
+
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
16
17
|
}
|
|
17
18
|
export type Image360Descriptor = Image360EventDescriptor & {
|
|
18
19
|
faceDescriptors: Image360FileDescriptor[];
|
|
@@ -29,6 +30,10 @@ export type Image360Face = {
|
|
|
29
30
|
mimeType: 'image/jpeg' | 'image/png';
|
|
30
31
|
data: ArrayBuffer;
|
|
31
32
|
};
|
|
33
|
+
export type Image360Texture = {
|
|
34
|
+
face: 'front' | 'back' | 'left' | 'right' | 'top' | 'bottom';
|
|
35
|
+
texture: THREE.Texture;
|
|
36
|
+
};
|
|
32
37
|
export type Image360FileDescriptor = {
|
|
33
38
|
fileId: number;
|
|
34
39
|
face: 'front' | 'back' | 'left' | 'right' | 'top' | 'bottom';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.1.1-dev.
|
|
3
|
+
"version": "4.1.1-dev.20230324",
|
|
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": {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"eslint": "8.36.0",
|
|
105
105
|
"eslint-config-prettier": "8.7.0",
|
|
106
106
|
"eslint-plugin-header": "3.1.1",
|
|
107
|
-
"eslint-plugin-jsdoc": "40.0
|
|
107
|
+
"eslint-plugin-jsdoc": "40.1.0",
|
|
108
108
|
"eslint-plugin-lodash": "7.4.0",
|
|
109
109
|
"eslint-plugin-prettier": "4.2.1",
|
|
110
110
|
"eslint-plugin-unused-imports": "2.0.0",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"wasm-pack": "0.10.3",
|
|
140
140
|
"webpack": "5.76.2",
|
|
141
141
|
"webpack-cli": "5.0.1",
|
|
142
|
-
"webpack-dev-server": "4.
|
|
142
|
+
"webpack-dev-server": "4.13.1",
|
|
143
143
|
"webpack-node-externals": "3.0.0",
|
|
144
144
|
"whatwg-fetch": "3.6.2",
|
|
145
145
|
"workerize-loader": "2.0.2"
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
"files": [
|
|
157
157
|
"./dist/*"
|
|
158
158
|
],
|
|
159
|
-
"packageManager": "yarn@3.
|
|
159
|
+
"packageManager": "yarn@3.5.0"
|
|
160
160
|
}
|