@cognite/reveal 4.4.3-dev.20231003 → 4.4.3-dev.20231005
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 +17 -17
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/index.d.ts +2 -2
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +4 -1
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +27 -0
- package/dist/packages/360-images/src/entity/Image360.d.ts +20 -0
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +4 -0
- package/dist/packages/3d-overlays/src/Overlay3DIcon.d.ts +2 -1
- package/dist/packages/cad-geometry-loaders/src/CadManager.d.ts +1 -0
- package/dist/packages/cad-geometry-loaders/src/CadModelUpdateHandler.d.ts +2 -0
- package/dist/packages/cad-geometry-loaders/src/sector/SectorLoader.d.ts +2 -1
- package/dist/packages/data-providers/index.d.ts +1 -1
- package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageEventProvider.d.ts +2 -2
- package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts +2 -2
- package/dist/packages/data-providers/src/types.d.ts +11 -2
- package/dist/packages/utilities/src/indexset/IndexSet.d.ts +2 -1
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
export { Image360 } from './src/entity/Image360';
|
|
4
|
+
export { Image360, Image360IconStyle } from './src/entity/Image360';
|
|
5
5
|
export { Image360Revision } from './src/entity/Image360Revision';
|
|
6
|
-
export { Image360Collection, Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult } from './src/collection/Image360Collection';
|
|
6
|
+
export { Image360Collection, Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult, AssetAnnotationImage360Info } from './src/collection/Image360Collection';
|
|
7
7
|
export { Image360Facade } from './src/Image360Facade';
|
|
8
8
|
export { Image360CollectionFactory } from './src/collection/Image360CollectionFactory';
|
|
9
9
|
export { Image360Entity } from './src/entity/Image360Entity';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2023 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { EventTrigger } from '../../../utilities';
|
|
5
|
-
import { Image360AnnotationAssetFilter, Image360AnnotationAssetQueryResult, Image360Collection } from './Image360Collection';
|
|
5
|
+
import { AssetAnnotationImage360Info, 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';
|
|
@@ -84,4 +84,7 @@ export declare class DefaultImage360Collection implements Image360Collection {
|
|
|
84
84
|
setDefaultAnnotationStyle(defaultStyle: Image360AnnotationAppearance): void;
|
|
85
85
|
findImageAnnotations(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
|
|
86
86
|
getAssetIds(): Promise<IdEither[]>;
|
|
87
|
+
getAnnotationsInfo(): Promise<AssetAnnotationImage360Info[]>;
|
|
88
|
+
private getAllFileDescriptors;
|
|
89
|
+
private createFileIdToEntityRevisionMap;
|
|
87
90
|
}
|
|
@@ -7,6 +7,7 @@ import { Image360AnnotationAppearance } from '../annotation/types';
|
|
|
7
7
|
import { Image360Revision } from '../entity/Image360Revision';
|
|
8
8
|
import { IdEither } from '@cognite/sdk';
|
|
9
9
|
import { Image360Annotation } from '../annotation/Image360Annotation';
|
|
10
|
+
import { ImageAssetLinkAnnotationInfo } from '../../../data-providers';
|
|
10
11
|
/**
|
|
11
12
|
* Filter for finding annotations related to an asset
|
|
12
13
|
*/
|
|
@@ -16,6 +17,23 @@ export type Image360AnnotationAssetFilter = {
|
|
|
16
17
|
*/
|
|
17
18
|
assetRef: IdEither;
|
|
18
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Asset search return type, including information about the image in which the asset is found
|
|
22
|
+
*/
|
|
23
|
+
export type AssetAnnotationImage360Info = {
|
|
24
|
+
/**
|
|
25
|
+
* Reference to the relevant asset
|
|
26
|
+
*/
|
|
27
|
+
annotationInfo: ImageAssetLinkAnnotationInfo;
|
|
28
|
+
/**
|
|
29
|
+
* The image entity in which the asset was found
|
|
30
|
+
*/
|
|
31
|
+
imageEntity: Image360;
|
|
32
|
+
/**
|
|
33
|
+
* The image revision in which the asset was found
|
|
34
|
+
*/
|
|
35
|
+
imageRevision: Image360Revision;
|
|
36
|
+
};
|
|
19
37
|
/**
|
|
20
38
|
* Result item from an asset annotation query
|
|
21
39
|
*/
|
|
@@ -97,6 +115,15 @@ export interface Image360Collection {
|
|
|
97
115
|
findImageAnnotations(filter: Image360AnnotationAssetFilter): Promise<Image360AnnotationAssetQueryResult[]>;
|
|
98
116
|
/**
|
|
99
117
|
* Get IDs of all CDF assets associated with this 360 image collection through CDF annotations
|
|
118
|
+
*
|
|
119
|
+
* @deprecated Use {@link Image360Collection.getAnnotationsInfo}
|
|
100
120
|
*/
|
|
101
121
|
getAssetIds(): Promise<IdEither[]>;
|
|
122
|
+
/**
|
|
123
|
+
* Get IDs of all CDF assets and related image/revision associated with this
|
|
124
|
+
* 360 image collection through CDF annotations
|
|
125
|
+
*
|
|
126
|
+
* @param assets What source data to pull the annotation info from
|
|
127
|
+
*/
|
|
128
|
+
getAnnotationsInfo(source: 'assets'): Promise<AssetAnnotationImage360Info[]>;
|
|
102
129
|
}
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360Revision } from './Image360Revision';
|
|
5
5
|
import { Image360Visualization } from './Image360Visualization';
|
|
6
|
+
import { Color } from 'three';
|
|
7
|
+
/**
|
|
8
|
+
* Image360 icon style
|
|
9
|
+
*/
|
|
10
|
+
export type Image360IconStyle = {
|
|
11
|
+
/**
|
|
12
|
+
* A color tint to apply to the 360 icon
|
|
13
|
+
*/
|
|
14
|
+
color?: Color;
|
|
15
|
+
};
|
|
6
16
|
/**
|
|
7
17
|
* A single 360 image "station", which may consist of several revisions
|
|
8
18
|
* captured in approximately the same location
|
|
@@ -39,4 +49,14 @@ export interface Image360 {
|
|
|
39
49
|
* @returns The active revision.
|
|
40
50
|
*/
|
|
41
51
|
getActiveRevision(): Image360Revision;
|
|
52
|
+
/**
|
|
53
|
+
* Get a copy of the color assigned to the icon of this entity
|
|
54
|
+
*
|
|
55
|
+
* @returns The currently assign color, or 'default' if none is assigned
|
|
56
|
+
*/
|
|
57
|
+
getIconColor(): Color | 'default';
|
|
58
|
+
/**
|
|
59
|
+
* Assign a color to the icon of this entity
|
|
60
|
+
*/
|
|
61
|
+
setIconColor(color: Color | 'default'): void;
|
|
42
62
|
}
|
|
@@ -10,6 +10,7 @@ import { Image360VisualizationBox } from './Image360VisualizationBox';
|
|
|
10
10
|
import { ImageAnnotationObject } from '../annotation/ImageAnnotationObject';
|
|
11
11
|
import { Overlay3DIcon } from '../../../3d-overlays';
|
|
12
12
|
import { Image360AnnotationFilter } from '../annotation/Image360AnnotationFilter';
|
|
13
|
+
import { Color } from 'three';
|
|
13
14
|
export declare class Image360Entity implements Image360 {
|
|
14
15
|
private readonly _revisions;
|
|
15
16
|
private readonly _imageMetadata;
|
|
@@ -17,6 +18,7 @@ export declare class Image360Entity implements Image360 {
|
|
|
17
18
|
private readonly _image360Icon;
|
|
18
19
|
private readonly _image360VisualizationBox;
|
|
19
20
|
private _activeRevision;
|
|
21
|
+
private _iconColor;
|
|
20
22
|
/**
|
|
21
23
|
* Get a copy of the model-to-world transformation matrix
|
|
22
24
|
* of the given 360 image.
|
|
@@ -68,6 +70,8 @@ export declare class Image360Entity implements Image360 {
|
|
|
68
70
|
* Drops the GPU resources for the 360 image
|
|
69
71
|
*/
|
|
70
72
|
unloadImage(): void;
|
|
73
|
+
getIconColor(): Color | 'default';
|
|
74
|
+
setIconColor(color: Color | 'default'): void;
|
|
71
75
|
activateAnnotations(): void;
|
|
72
76
|
deactivateAnnotations(): void;
|
|
73
77
|
/**
|
|
@@ -34,6 +34,7 @@ export declare class Overlay3DIcon<ContentType = DefaultOverlay3DContentType> im
|
|
|
34
34
|
private readonly _hoverSprite?;
|
|
35
35
|
private readonly _content;
|
|
36
36
|
private readonly _raycastBoundingSphere;
|
|
37
|
+
private readonly _defaultColor;
|
|
37
38
|
private _adaptiveScale;
|
|
38
39
|
private _visible;
|
|
39
40
|
private _culled;
|
|
@@ -54,7 +55,7 @@ export declare class Overlay3DIcon<ContentType = DefaultOverlay3DContentType> im
|
|
|
54
55
|
camera: PerspectiveCamera;
|
|
55
56
|
domElement: HTMLElement;
|
|
56
57
|
}): void;
|
|
57
|
-
setColor(color: Color): void;
|
|
58
|
+
setColor(color: Color | 'default'): void;
|
|
58
59
|
getColor(): Color;
|
|
59
60
|
getContent(): ContentType;
|
|
60
61
|
get adaptiveScale(): number;
|
|
@@ -20,6 +20,7 @@ export declare class CadManager {
|
|
|
20
20
|
private _needsRedraw;
|
|
21
21
|
private readonly _markNeedsRedrawBound;
|
|
22
22
|
private readonly _materialsChangedListener;
|
|
23
|
+
private readonly _sectorBufferTime;
|
|
23
24
|
get materialManager(): CadMaterialManager;
|
|
24
25
|
get budget(): CadModelBudget;
|
|
25
26
|
set budget(budget: CadModelBudget);
|
|
@@ -15,6 +15,7 @@ export declare class CadModelUpdateHandler {
|
|
|
15
15
|
private readonly _modelStateHandler;
|
|
16
16
|
private _budget;
|
|
17
17
|
private _lastSpent;
|
|
18
|
+
private readonly _determineSectorsHandler;
|
|
18
19
|
private readonly _cameraSubject;
|
|
19
20
|
private readonly _clippingPlaneSubject;
|
|
20
21
|
private readonly _loadingHintsSubject;
|
|
@@ -36,6 +37,7 @@ export declare class CadModelUpdateHandler {
|
|
|
36
37
|
private updatePrioritizedAreas;
|
|
37
38
|
consumedSectorObservable(): Observable<ConsumedSector>;
|
|
38
39
|
getLoadingStateObserver(): Observable<LoadingState>;
|
|
40
|
+
reportNewSectorsLoaded(loadedCountChange: number): void;
|
|
39
41
|
/**
|
|
40
42
|
* When loading hints of a CAD model changes, propagate the event down to the stream and either add or remove
|
|
41
43
|
* the {@link CadModelMetadata} from the array and push the new array down stream
|
|
@@ -16,7 +16,7 @@ import { ModelStateHandler } from './ModelStateHandler';
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class SectorLoader {
|
|
18
18
|
private readonly _modelStateHandler;
|
|
19
|
-
private readonly
|
|
19
|
+
private readonly _progressHelper;
|
|
20
20
|
private readonly _collectStatisticsCallback;
|
|
21
21
|
private readonly _sectorCuller;
|
|
22
22
|
private readonly _continuousModelStreaming;
|
|
@@ -24,6 +24,7 @@ export declare class SectorLoader {
|
|
|
24
24
|
private _batchId;
|
|
25
25
|
constructor(sectorCuller: SectorCuller, modelStateHandler: ModelStateHandler, collectStatisticsCallback: (spent: SectorLoadingSpent) => void, progressCallback: (sectorsLoaded: number, sectorsScheduled: number, sectorsCulled: number) => void, continuousModelStreaming: boolean);
|
|
26
26
|
loadSectors(input: DetermineSectorsPayload): AsyncIterable<ConsumedSector>;
|
|
27
|
+
reportNewSectorsLoaded(loadedCountChange: number): void;
|
|
27
28
|
private shouldLoad;
|
|
28
29
|
private getSectorCuller;
|
|
29
30
|
private filterSectors;
|
|
@@ -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, Image360DataProvider } from './src/Image360Provider';
|
|
21
|
-
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture, Image360FileDescriptor } from './src/types';
|
|
21
|
+
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture, Image360FileDescriptor, ImageAssetLinkAnnotationInfo } from './src/types';
|
package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageEventProvider.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { AnnotationModel, CogniteClient, IdEither, Metadata, CogniteInternalId } from '@cognite/sdk';
|
|
5
|
-
import { Historical360ImageSet, Image360AnnotationFilterDelegate, Image360Face, Image360FileDescriptor } from '../types';
|
|
5
|
+
import { Historical360ImageSet, Image360AnnotationFilterDelegate, Image360Face, Image360FileDescriptor, ImageAssetLinkAnnotationInfo } from '../types';
|
|
6
6
|
import { Image360Provider } from '../Image360Provider';
|
|
7
7
|
export declare class Cdf360ImageEventProvider implements Image360Provider<Metadata> {
|
|
8
8
|
private readonly _client;
|
|
@@ -24,6 +24,6 @@ export declare class Cdf360ImageEventProvider implements Image360Provider<Metada
|
|
|
24
24
|
}[], abortSignal?: AbortSignal): Promise<ArrayBuffer[]>;
|
|
25
25
|
private getDownloadUrls;
|
|
26
26
|
private parseEventMetadata;
|
|
27
|
-
get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[], annotationFilter: Image360AnnotationFilterDelegate): Promise<
|
|
27
|
+
get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[], annotationFilter: Image360AnnotationFilterDelegate): Promise<ImageAssetLinkAnnotationInfo[]>;
|
|
28
28
|
private listFileAnnotations;
|
|
29
29
|
}
|
package/dist/packages/data-providers/src/image-360-data-providers/Local360ImageProvider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Image360Provider } from '../Image360Provider';
|
|
2
|
-
import { Historical360ImageSet, Image360AnnotationFilterDelegate, Image360Face, Image360FileDescriptor } from '../types';
|
|
2
|
+
import { Historical360ImageSet, Image360AnnotationFilterDelegate, Image360Face, Image360FileDescriptor, ImageAssetLinkAnnotationInfo } from '../types';
|
|
3
3
|
import { AnnotationModel, CogniteInternalId, IdEither } from '@cognite/sdk';
|
|
4
4
|
export declare class Local360ImageProvider implements Image360Provider<unknown> {
|
|
5
5
|
private readonly _modelUrl;
|
|
@@ -9,5 +9,5 @@ export declare class Local360ImageProvider implements Image360Provider<unknown>
|
|
|
9
9
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
10
10
|
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
11
11
|
getFilesByAssetRef(_assetId: IdEither): Promise<CogniteInternalId[]>;
|
|
12
|
-
get360ImageAssets(_image360FileDescriptors: Image360FileDescriptor[], _annotationFilter: Image360AnnotationFilterDelegate): Promise<
|
|
12
|
+
get360ImageAssets(_image360FileDescriptors: Image360FileDescriptor[], _annotationFilter: Image360AnnotationFilterDelegate): Promise<ImageAssetLinkAnnotationInfo[]>;
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { AnnotationModel, CogniteInternalId, IdEither } from '@cognite/sdk';
|
|
4
|
+
import { AnnotationModel, AnnotationsCogniteAnnotationTypesImagesAssetLink, CogniteInternalId, IdEither } from '@cognite/sdk';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
6
|
export type Image360AnnotationFilterDelegate = (annotation: AnnotationModel) => boolean;
|
|
7
7
|
export interface JsonFileProvider {
|
|
@@ -21,8 +21,17 @@ export interface Image360FileProvider {
|
|
|
21
21
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
22
22
|
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A CDF AnnotationModel with a narrower type representing an image asset link
|
|
26
|
+
*/
|
|
27
|
+
export type ImageAssetLinkAnnotationInfo = Omit<AnnotationModel, 'data'> & {
|
|
28
|
+
/**
|
|
29
|
+
* The data associated with the image asset link
|
|
30
|
+
*/
|
|
31
|
+
data: AnnotationsCogniteAnnotationTypesImagesAssetLink;
|
|
32
|
+
};
|
|
24
33
|
export interface Image360AssetProvider {
|
|
25
|
-
get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[], annotationFilter: Image360AnnotationFilterDelegate): Promise<
|
|
34
|
+
get360ImageAssets(image360FileDescriptors: Image360FileDescriptor[], annotationFilter: Image360AnnotationFilterDelegate): Promise<ImageAssetLinkAnnotationInfo[]>;
|
|
26
35
|
}
|
|
27
36
|
export type Historical360ImageSet = Image360EventDescriptor & {
|
|
28
37
|
imageRevisions: Image360Descriptor[];
|
|
@@ -19,7 +19,8 @@ export declare class IndexSet {
|
|
|
19
19
|
invertedRanges(): NumericRange[];
|
|
20
20
|
unionWith(otherSet: IndexSet): IndexSet;
|
|
21
21
|
differenceWith(otherSet: IndexSet): IndexSet;
|
|
22
|
-
hasIntersectionWith(otherSet: IndexSet |
|
|
22
|
+
hasIntersectionWith(otherSet: IndexSet | Set<number>): boolean;
|
|
23
|
+
hasIntersectionWithMap(otherMap: Map<number, number>): boolean;
|
|
23
24
|
intersectWith(otherSet: IndexSet): IndexSet;
|
|
24
25
|
clear(): void;
|
|
25
26
|
clone(): IndexSet;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.4.3-dev.
|
|
3
|
+
"version": "4.4.3-dev.20231005",
|
|
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": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@azure/msal-browser": "2.38.2",
|
|
82
|
-
"@cognite/sdk": "8.
|
|
82
|
+
"@cognite/sdk": "8.3.0",
|
|
83
83
|
"@microsoft/api-extractor": "^7.33.6",
|
|
84
84
|
"@types/dat.gui": "0.7.10",
|
|
85
85
|
"@types/gl": "^6.0.2",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@types/jsdom": "21.1.3",
|
|
91
91
|
"@types/lodash": "4.14.199",
|
|
92
92
|
"@types/mixpanel-browser": "2.47.3",
|
|
93
|
-
"@types/node": "18.
|
|
93
|
+
"@types/node": "18.18.1",
|
|
94
94
|
"@types/random-seed": "0.3.3",
|
|
95
95
|
"@types/skmeans": "0.11.5",
|
|
96
96
|
"@types/stats": "0.16.30",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"nock": "13.3.3",
|
|
125
125
|
"prettier": "3.0.3",
|
|
126
126
|
"process": "0.11.10",
|
|
127
|
-
"puppeteer": "21.3.
|
|
127
|
+
"puppeteer": "21.3.6",
|
|
128
128
|
"random-seed": "0.3.0",
|
|
129
129
|
"raw-loader": "4.0.2",
|
|
130
130
|
"remove-files-webpack-plugin": "1.5.0",
|