@cognite/reveal 4.29.3 → 4.29.4
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 +202 -202
- package/dist/index.js.map +1 -1
- package/dist/packages/data-providers/index.d.ts +1 -0
- package/dist/packages/data-providers/src/Image360ProviderCombiner.d.ts +1 -0
- package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageAnnotationProvider.d.ts +27 -3
- package/dist/packages/data-providers/src/types.d.ts +6 -0
- package/dist/packages/data-providers/src/utilities/getExternalIdFromDescriptor.d.ts +9 -0
- package/package.json +1 -1
|
@@ -32,5 +32,6 @@ export { Image360ProviderCombiner } from './src/Image360ProviderCombiner';
|
|
|
32
32
|
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture, Image360FileDescriptor, ImageAssetLinkAnnotationInfo, ImageInstanceLinkAnnotationInfo, InstanceReference, Image360Id, Image360RevisionId } from './src/types';
|
|
33
33
|
export { fetchDMModelIdFromRevisionId } from './src/requests/fetchDMModelIdFromRevisionId';
|
|
34
34
|
export { isDMPointCloudVolumeObject, isClassicPointCloudVolumeObject, isDMPointCloudVolume, isClassicPointCloudVolume } from './src/utilities/utils';
|
|
35
|
+
export { getExternalIdFromDescriptor } from './src/utilities/getExternalIdFromDescriptor';
|
|
35
36
|
export { DataSourceType, ClassicDataSourceType, DMDataSourceType, ClassicModelIdentifierType, DMModelIdentifierType, isClassicIdentifier, isDMIdentifier, InternalDataSourceType, LocalDataSourceType, LocalModelIdentifierType, isLocalIdentifier, GenericDataSourceType } from './src/DataSourceType';
|
|
36
37
|
export { LocalAddModelOptions, CommonModelOptions, InternalAddModelOptions, AddModelOptionsWithModelRevisionId } from './src/utilities/internalAddModelOptions';
|
|
@@ -15,6 +15,7 @@ export declare class Image360ProviderCombiner<T extends DataSourceType> implemen
|
|
|
15
15
|
get360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
16
16
|
getLowResolution360ImageFiles(image360FaceDescriptors: Image360FileDescriptor[], abortSignal?: AbortSignal): Promise<Image360Face[]>;
|
|
17
17
|
getRelevant360ImageAnnotations(annotationSpecifier: Image360AnnotationSpecifier<T>): Promise<T['image360AnnotationType'][]>;
|
|
18
|
+
resolveFileIdToExternalIdMapping(annotations: T['image360AnnotationType'][], descriptors: Image360FileDescriptor[]): Promise<Map<number, string>>;
|
|
18
19
|
findImageAnnotationsForInstance(instanceFilter: Image360AnnotationInstanceReference<T>, collection: DefaultImage360Collection<T>): Promise<Image360AnnotationAssetQueryResult<T>[]>;
|
|
19
20
|
getAllImage360AnnotationInfos(source: 'assets', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[]>;
|
|
20
21
|
getAllImage360AnnotationInfos(source: 'hybrid', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetHybridAnnotationImage360Info[]>;
|
package/dist/packages/data-providers/src/image-360-data-providers/Cdf360ImageAnnotationProvider.d.ts
CHANGED
|
@@ -1,23 +1,47 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
-
import { Image360AnnotationFilterDelegate, Image360AnnotationProvider, Image360AnnotationSpecifier, InstanceReference } from '../types';
|
|
4
|
+
import { AnnotationModel, CogniteClient } from '@cognite/sdk';
|
|
5
|
+
import { Image360AnnotationFilterDelegate, Image360AnnotationProvider, Image360AnnotationSpecifier, Image360FileDescriptor, InstanceReference } from '../types';
|
|
6
6
|
import { ClassicDataSourceType, DataSourceType, DMDataSourceType } from '../DataSourceType';
|
|
7
7
|
import { AssetAnnotationImage360Info, AssetHybridAnnotationImage360Info, DefaultImage360Collection, Image360AnnotationAssetQueryResult } from '../../../360-images';
|
|
8
8
|
export declare class Cdf360ImageAnnotationProvider implements Image360AnnotationProvider<ClassicDataSourceType> {
|
|
9
9
|
private readonly _client;
|
|
10
10
|
private readonly _collectionToInstanceReferenceToAnnotationMap;
|
|
11
|
+
private readonly _collectionAnnotationsCache;
|
|
12
|
+
private readonly _collectionFileIdMapCache;
|
|
11
13
|
constructor(client: CogniteClient);
|
|
12
14
|
findImageAnnotationsForInstance(asset: InstanceReference<DataSourceType>, collection: DefaultImage360Collection<ClassicDataSourceType>): Promise<Image360AnnotationAssetQueryResult<ClassicDataSourceType>[]>;
|
|
13
15
|
private fetchImageAnnotationsForInstance;
|
|
16
|
+
/**
|
|
17
|
+
* Gets all annotations for a collection
|
|
18
|
+
*/
|
|
19
|
+
private getAllAnnotationsForCollection;
|
|
20
|
+
/**
|
|
21
|
+
* Gets the fileId to entity/revision mapping
|
|
22
|
+
*/
|
|
23
|
+
private getFileIdToEntityRevisionMap;
|
|
14
24
|
private cacheResult;
|
|
15
25
|
getRelevant360ImageAnnotations(annotationSpecifier: Image360AnnotationSpecifier<ClassicDataSourceType>): Promise<ClassicDataSourceType['image360AnnotationType'][]>;
|
|
26
|
+
/**
|
|
27
|
+
* Fetches file info for the given IDs and returns a map of fileId -> externalId.
|
|
28
|
+
*/
|
|
29
|
+
private fetchFileIdToExternalIdMapping;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves the mapping from internal file IDs to external IDs.
|
|
32
|
+
* This is needed to match annotations (which have annotatedResourceId) to descriptors (which may have externalId).
|
|
33
|
+
*/
|
|
34
|
+
resolveFileIdToExternalIdMapping(annotations: AnnotationModel[], descriptors: Image360FileDescriptor[]): Promise<Map<number, string>>;
|
|
16
35
|
getAllImage360AnnotationInfos(source: 'assets', collection: DefaultImage360Collection<ClassicDataSourceType>, annotationFilter: Image360AnnotationFilterDelegate<ClassicDataSourceType>): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[]>;
|
|
17
36
|
getAllImage360AnnotationInfos(source: 'hybrid', collection: DefaultImage360Collection<ClassicDataSourceType>, annotationFilter: Image360AnnotationFilterDelegate<ClassicDataSourceType>): Promise<AssetHybridAnnotationImage360Info[]>;
|
|
18
37
|
getAllImage360AnnotationInfos(source: 'cdm', collection: DefaultImage360Collection<ClassicDataSourceType>, annotationFilter: Image360AnnotationFilterDelegate<ClassicDataSourceType>): Promise<AssetAnnotationImage360Info<DMDataSourceType>[]>;
|
|
19
38
|
getAllImage360AnnotationInfos(source: 'all', collection: DefaultImage360Collection<ClassicDataSourceType>, annotationFilter: Image360AnnotationFilterDelegate<ClassicDataSourceType>): Promise<AssetAnnotationImage360Info<DataSourceType>[]>;
|
|
20
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Builds a mapping from annotatedResourceId (internal file ID) to entity/revision.
|
|
41
|
+
* For legacy descriptors with fileId, uses the fileId directly.
|
|
42
|
+
* For new descriptors with externalId, resolves the mapping via one batched API call.
|
|
43
|
+
*/
|
|
44
|
+
private buildFileIdToEntityRevisionMap;
|
|
21
45
|
private fetchAllAnnotations;
|
|
22
46
|
private listFileAnnotations;
|
|
23
47
|
}
|
|
@@ -32,6 +32,12 @@ export type Image360AnnotationSpecifier<T extends DataSourceType> = {
|
|
|
32
32
|
export type InstanceReference<T extends DataSourceType> = T extends ClassicDataSourceType ? IdEither : DMInstanceRef;
|
|
33
33
|
export interface Image360AnnotationProvider<T extends DataSourceType> {
|
|
34
34
|
getRelevant360ImageAnnotations(annotationSpecifier: Image360AnnotationSpecifier<T>): Promise<T['image360AnnotationType'][]>;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves the mapping from internal file IDs (annotatedResourceId) to external IDs.
|
|
37
|
+
* This is needed to match annotations to face descriptors when descriptors use externalId.
|
|
38
|
+
* Optional - if not implemented, the caller should build mapping from descriptors only.
|
|
39
|
+
*/
|
|
40
|
+
resolveFileIdToExternalIdMapping?(annotations: T['image360AnnotationType'][], descriptors: Image360FileDescriptor[]): Promise<Map<number, string>>;
|
|
35
41
|
findImageAnnotationsForInstance(instanceFilter: Image360AnnotationInstanceReference<T>, collection: DefaultImage360Collection<T>): Promise<Image360AnnotationAssetQueryResult<T>[]>;
|
|
36
42
|
getAllImage360AnnotationInfos(source: 'assets', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetAnnotationImage360Info<ClassicDataSourceType>[]>;
|
|
37
43
|
getAllImage360AnnotationInfos(source: 'hybrid', collection: DefaultImage360Collection<T>, annotationFilter: Image360AnnotationFilterDelegate<T>): Promise<AssetHybridAnnotationImage360Info[]>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2025 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Image360FileDescriptor } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Gets the externalId from a file descriptor, if available.
|
|
7
|
+
* Works with both direct externalId and instanceId.externalId.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getExternalIdFromDescriptor(desc: Image360FileDescriptor): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/reveal",
|
|
3
|
-
"version": "4.29.
|
|
3
|
+
"version": "4.29.4",
|
|
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": {
|