@cognite/reveal 4.19.1-dev.20241024 → 4.19.1-dev.20241028
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 +3 -3
- package/dist/index.js +199 -163
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/Image360Facade.d.ts +10 -9
- package/dist/packages/360-images/src/annotation/Image360Annotation.d.ts +3 -3
- package/dist/packages/360-images/src/annotation/ImageAnnotationObject.d.ts +3 -3
- package/dist/packages/360-images/src/cache/Image360LoadingCache.d.ts +9 -8
- package/dist/packages/360-images/src/collection/DefaultImage360Collection.d.ts +6 -6
- package/dist/packages/360-images/src/collection/Image360Collection.d.ts +7 -7
- package/dist/packages/360-images/src/collection/Image360CollectionFactory.d.ts +4 -3
- package/dist/packages/360-images/src/entity/Image360.d.ts +4 -3
- package/dist/packages/360-images/src/entity/Image360Entity.d.ts +8 -8
- package/dist/packages/360-images/src/entity/Image360Revision.d.ts +3 -2
- package/dist/packages/360-images/src/entity/Image360RevisionEntity.d.ts +4 -4
- package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +2 -2
- package/dist/packages/api/src/api-helpers/Image360ApiHelper.d.ts +9 -9
- package/dist/packages/api/src/public/RevealManager.d.ts +4 -3
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +20 -19
- package/dist/packages/api/src/public/migration/types.d.ts +14 -9
- package/dist/packages/api/src/public/types.d.ts +5 -4
- package/dist/packages/api/src/storage/RevealManagerHelper.d.ts +5 -4
- package/dist/packages/api/src/utilities/ViewStateHelper.d.ts +3 -2
- package/dist/packages/api/src/utilities/utils.d.ts +11 -0
- package/dist/packages/data-providers/index.d.ts +8 -2
- package/dist/packages/data-providers/src/DataSourceType.d.ts +127 -0
- package/dist/packages/data-providers/src/ModelIdentifier.d.ts +2 -0
- package/dist/packages/data-providers/src/PointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/model-identifiers/DMModelIdentifier.d.ts +12 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider.d.ts +3 -3
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/cdfAnnotationsToObjects.d.ts +2 -1
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/CdfPointCloudDMStylableObjectProvider.d.ts +12 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/DummyPointCloudDMStylableObjectProvider.d.ts +9 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudObjects.d.ts +4 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/getDMPointCloudVolumeCollectionQuery.d.ts +81 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/types.d.ts +32 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/utils.d.ts +6 -0
- package/dist/packages/data-providers/src/pointcloud-stylable-object-providers/types.d.ts +25 -22
- package/dist/packages/data-providers/src/requests/fetchDMModelIdFromRevisionId.d.ts +8 -0
- package/dist/packages/data-providers/src/utilities/constants.d.ts +29 -0
- package/dist/packages/data-providers/src/utilities/internalAddModelOptions.d.ts +23 -0
- package/dist/packages/data-providers/src/utilities/utils.d.ts +32 -0
- package/dist/packages/pointcloud-styling/index.d.ts +4 -2
- package/dist/packages/pointcloud-styling/src/AnnotationIdPointCloudObjectCollection.d.ts +3 -3
- package/dist/packages/pointcloud-styling/src/PointCloudDMVolumeCollection.d.ts +19 -0
- package/dist/packages/pointcloud-styling/src/PointCloudObjectCollection.d.ts +15 -3
- package/dist/packages/pointcloud-styling/src/StyledPointCloudVolumeCollection.d.ts +41 -0
- package/dist/packages/pointcloud-styling/src/utils.d.ts +7 -0
- package/dist/packages/pointclouds/index.d.ts +1 -0
- package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +33 -9
- package/dist/packages/pointclouds/src/PointCloudFactory.d.ts +5 -3
- package/dist/packages/pointclouds/src/PointCloudIntersection.d.ts +12 -2
- package/dist/packages/pointclouds/src/PointCloudLoadingStateHandler.d.ts +2 -1
- package/dist/packages/pointclouds/src/PointCloudManager.d.ts +3 -3
- package/dist/packages/pointclouds/src/PointCloudNode.d.ts +8 -7
- package/dist/packages/pointclouds/src/PointCloudPickingHandler.d.ts +3 -32
- package/dist/packages/pointclouds/src/createPointCloudManager.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/Potree.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/loading/EptLoader.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/types/IPotree.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/utils/createObjectIdMaps.d.ts +2 -2
- package/dist/packages/pointclouds/src/typeGuards.d.ts +17 -0
- package/dist/packages/pointclouds/src/types.d.ts +29 -0
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectAppearanceTexture.d.ts +4 -3
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectIdMaps.d.ts +3 -2
- package/dist/packages/tools/src/AxisGizmo/AxisGizmoTool.d.ts +2 -1
- package/dist/packages/tools/src/DebugCameraTool.d.ts +2 -1
- package/dist/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +2 -1
- package/dist/packages/tools/src/Measurement/MeasurementTool.d.ts +2 -1
- package/package.json +1 -1
- package/dist/packages/pointcloud-styling/src/StyledPointCloudObjectCollection.d.ts +0 -13
|
@@ -5,12 +5,14 @@ import { CogniteClient } from '@cognite/sdk';
|
|
|
5
5
|
import { CadModelBudget } from '../../../../cad-geometry-loaders';
|
|
6
6
|
import { PointCloudBudget, PointCloudIntersection } from '../../../../pointclouds';
|
|
7
7
|
import { CameraManager } from '../../../../camera-manager';
|
|
8
|
-
import {
|
|
8
|
+
import { CogniteCadModel } from '../../../../cad-model';
|
|
9
9
|
import { DataSource } from '../../../../data-source';
|
|
10
10
|
import { EdlOptions } from '../../../../rendering';
|
|
11
|
+
import { CommonModelOptions } from '../../../../data-providers';
|
|
11
12
|
import { Image360AnnotationFilterOptions } from '../../../../360-images';
|
|
12
13
|
import type { Vector2, WebGLRenderTarget, WebGLRenderer, Matrix4, Vector3 } from 'three';
|
|
13
14
|
import { CustomObjectIntersection } from '../../../../utilities';
|
|
15
|
+
import { ClassicDataSourceType, DataSourceType, DMDataSourceType } from '../../../../data-providers';
|
|
14
16
|
/**
|
|
15
17
|
* Callback to monitor loaded requests and progress.
|
|
16
18
|
* Use OnLoadingCallback instead of onProgress/onComplete.
|
|
@@ -160,12 +162,15 @@ export interface Cognite3DViewerOptions {
|
|
|
160
162
|
/**
|
|
161
163
|
* @module @cognite/reveal
|
|
162
164
|
*/
|
|
163
|
-
export
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
export type AddModelOptions<T extends DataSourceType = ClassicDataSourceType> = CommonModelOptions & T['modelIdentifier'];
|
|
166
|
+
/**
|
|
167
|
+
* Add model options for models of classic format, identified by modelId and revisionId.
|
|
168
|
+
*/
|
|
169
|
+
export type ClassicAddModelOptions = AddModelOptions<ClassicDataSourceType>;
|
|
170
|
+
/**
|
|
171
|
+
* Add model options for models of DM format, identified by revisionExternalId and revisionSpace.
|
|
172
|
+
*/
|
|
173
|
+
export type DMAddModelOptions = AddModelOptions<DMDataSourceType>;
|
|
169
174
|
export type AddImage360Options = {
|
|
170
175
|
/**
|
|
171
176
|
* An optional transformation which will be applied to all 360 images that are fetched.
|
|
@@ -231,13 +236,13 @@ export type ResolutionOptions = {
|
|
|
231
236
|
* Represents the result from {@link Cognite3DViewer.getIntersectionFromPixel}.
|
|
232
237
|
* @module @cognite/reveal
|
|
233
238
|
*/
|
|
234
|
-
export type Intersection = CadIntersection | PointCloudIntersection
|
|
239
|
+
export type Intersection<T extends DataSourceType = ClassicDataSourceType> = CadIntersection | PointCloudIntersection<T>;
|
|
235
240
|
/**
|
|
236
241
|
* Represents the result from {@link Cognite3DViewer.getAnyIntersectionFromPixel}.
|
|
237
242
|
* @module @cognite/reveal
|
|
238
243
|
* @beta
|
|
239
244
|
*/
|
|
240
|
-
export type AnyIntersection = CadIntersection | PointCloudIntersection | CustomObjectIntersection;
|
|
245
|
+
export type AnyIntersection<T extends DataSourceType = DataSourceType> = CadIntersection | PointCloudIntersection<T> | CustomObjectIntersection;
|
|
241
246
|
/**
|
|
242
247
|
* @module @cognite/reveal
|
|
243
248
|
*/
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Image360, Image360Collection } from '../../../360-images';
|
|
5
5
|
import { CogniteCadModel } from '../../../cad-model';
|
|
6
|
+
import { ClassicDataSourceType, DataSourceType } from '../../../data-providers/src/DataSourceType';
|
|
6
7
|
import { CognitePointCloudModel } from '../../../pointclouds';
|
|
7
8
|
/**
|
|
8
9
|
* Type abstraction for CogniteCadModel or CognitePointCloudModel;.
|
|
9
10
|
*/
|
|
10
|
-
export type CogniteModel = CogniteCadModel | CognitePointCloudModel
|
|
11
|
+
export type CogniteModel<T extends DataSourceType = ClassicDataSourceType> = CogniteCadModel | CognitePointCloudModel<T>;
|
|
11
12
|
export { WellKnownAsprsPointClassCodes } from '../../../pointclouds';
|
|
12
13
|
export { PointShape, PointColorType, PointSizeType } from '../../../rendering';
|
|
13
14
|
/**
|
|
14
15
|
* A tuple of a 360 image and its collection.
|
|
15
16
|
*/
|
|
16
|
-
export type Image360WithCollection = {
|
|
17
|
-
image360Collection: Image360Collection
|
|
18
|
-
image360: Image360
|
|
17
|
+
export type Image360WithCollection<T extends DataSourceType = ClassicDataSourceType> = {
|
|
18
|
+
image360Collection: Image360Collection<T>;
|
|
19
|
+
image360: Image360<T>;
|
|
19
20
|
};
|
|
20
21
|
export * from './migration/types';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { AddModelOptions } from '../public/migration/types';
|
|
6
5
|
import { RevealManager } from '../public/RevealManager';
|
|
7
6
|
import { RevealOptions } from '../public/RevealOptions';
|
|
7
|
+
import { InternalDataSourceType, DataSourceType, AddModelOptionsWithModelRevisionId } from '../../../data-providers';
|
|
8
8
|
import { DataSource } from '../../../data-source';
|
|
9
9
|
import { SceneHandler } from '../../../utilities';
|
|
10
10
|
import { CadNode } from '../../../cad-model';
|
|
@@ -18,8 +18,9 @@ import { CameraManager } from '../../../camera-manager';
|
|
|
18
18
|
*/
|
|
19
19
|
export declare class RevealManagerHelper {
|
|
20
20
|
private readonly _revealManager;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
addPointCloudModel<T extends DataSourceType>(model: AddModelOptionsWithModelRevisionId<T>): Promise<PointCloudNode<T>>;
|
|
22
|
+
addCadModel<T extends InternalDataSourceType>(model: AddModelOptionsWithModelRevisionId<T>): Promise<CadNode>;
|
|
23
|
+
private readonly _type;
|
|
23
24
|
private constructor();
|
|
24
25
|
private constructor();
|
|
25
26
|
/**
|
|
@@ -57,7 +58,7 @@ export declare class RevealManagerHelper {
|
|
|
57
58
|
private static addLocalPointCloudModel;
|
|
58
59
|
/**
|
|
59
60
|
* Add a CDF hosted point cloud model.
|
|
60
|
-
* @param
|
|
61
|
+
* @param identifier
|
|
61
62
|
* @param revealManager
|
|
62
63
|
*/
|
|
63
64
|
private static addCdfPointCloudModel;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Cognite3DViewer } from '../public/migration/Cognite3DViewer';
|
|
2
2
|
import { CogniteClient } from '@cognite/sdk';
|
|
3
3
|
import { SerializableNodeAppearance } from '../../../cad-styling/src/NodeAppearance';
|
|
4
|
+
import { DataSourceType } from '../../../data-providers';
|
|
4
5
|
export type ViewerState = {
|
|
5
6
|
camera?: {
|
|
6
7
|
position: {
|
|
@@ -34,11 +35,11 @@ export type ModelState = {
|
|
|
34
35
|
appearance: SerializableNodeAppearance;
|
|
35
36
|
}[];
|
|
36
37
|
};
|
|
37
|
-
export declare class ViewStateHelper {
|
|
38
|
+
export declare class ViewStateHelper<T extends DataSourceType> {
|
|
38
39
|
private readonly _viewer;
|
|
39
40
|
private readonly _cdfClient;
|
|
40
41
|
private get _cameraManager();
|
|
41
|
-
constructor(viewer: Cognite3DViewer
|
|
42
|
+
constructor(viewer: Cognite3DViewer<T>, cdfClient: CogniteClient);
|
|
42
43
|
getCurrentState(): ViewerState;
|
|
43
44
|
setState(viewerState: ViewerState): Promise<void>;
|
|
44
45
|
private getModelsState;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
+
import { AddModelOptions } from '../public/migration/types';
|
|
6
|
+
import { DataSourceType } from '../../../data-providers';
|
|
7
|
+
import { LocalAddModelOptions } from '../../../data-providers/src/utilities/internalAddModelOptions';
|
|
8
|
+
export declare function getModelAndRevisionId(options: AddModelOptions<DataSourceType> | LocalAddModelOptions, sdk: CogniteClient | undefined): Promise<{
|
|
9
|
+
modelId: number;
|
|
10
|
+
revisionId: number;
|
|
11
|
+
}>;
|
|
@@ -12,13 +12,19 @@ export { LocalModelDataProvider } from './src/model-data-providers/LocalModelDat
|
|
|
12
12
|
export { LocalModelIdentifier } from './src/model-identifiers/LocalModelIdentifier';
|
|
13
13
|
export { LocalModelMetadataProvider } from './src/metadata-providers/LocalModelMetadataProvider';
|
|
14
14
|
export { Local360ImageProvider } from './src/image-360-data-providers/Local360ImageProvider';
|
|
15
|
-
export { ModelIdentifier } from './src/ModelIdentifier';
|
|
15
|
+
export { ModelIdentifier, createModelIdentifier } from './src/ModelIdentifier';
|
|
16
16
|
export { ModelMetadataProvider } from './src/ModelMetadataProvider';
|
|
17
17
|
export { ModelDataProvider } from './src/ModelDataProvider';
|
|
18
|
-
export { PointCloudObjectMetadata, PointCloudObject } from './src/pointcloud-stylable-object-providers/types';
|
|
18
|
+
export { PointCloudObjectMetadata, PointCloudObject, DMInstanceRef } from './src/pointcloud-stylable-object-providers/types';
|
|
19
19
|
export { PointCloudStylableObjectProvider } from './src/PointCloudStylableObjectProvider';
|
|
20
20
|
export { StylableObject, SerializableStylableObject } from './src/pointcloud-stylable-object-providers/StylableObject';
|
|
21
21
|
export { CdfPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/CdfPointCloudStylableObjectProvider';
|
|
22
22
|
export { DummyPointCloudStylableObjectProvider } from './src/pointcloud-stylable-object-providers/DummyPointCloudStylableObjectProvider';
|
|
23
|
+
export { CdfPointCloudDMStylableObjectProvider } from './src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/CdfPointCloudDMStylableObjectProvider';
|
|
24
|
+
export { DummyPointCloudDMStylableObjectProvider } from './src/pointcloud-stylable-object-providers/pointcloud-volume-data-providers/DummyPointCloudDMStylableObjectProvider';
|
|
23
25
|
export { Image360Provider, Image360DataProvider } from './src/Image360Provider';
|
|
24
26
|
export { BinaryFileProvider, JsonFileProvider, File3dFormat, BlobOutputMetadata, Image360Descriptor, Image360FileProvider, Image360Face, Image360Texture, Image360FileDescriptor, ImageAssetLinkAnnotationInfo } from './src/types';
|
|
27
|
+
export { fetchDMModelIdFromRevisionId } from './src/requests/fetchDMModelIdFromRevisionId';
|
|
28
|
+
export { isDMPointCloudVolumeObject, isClassicPointCloudVolumeObject, isDMPointCloudVolume, isClassicPointCloudVolume } from './src/utilities/utils';
|
|
29
|
+
export { DataSourceType, ClassicDataSourceType, DMDataSourceType, ClassicModelIdentifierType, DMModelIdentifierType, isClassicIdentifier, isDMIdentifier, InternalDataSourceType, LocalDataSourceType, LocalModelIdentifierType, isLocalIdentifier, GenericDataSourceType } from './src/DataSourceType';
|
|
30
|
+
export { LocalAddModelOptions, CommonModelOptions, InternalAddModelOptions, AddModelOptionsWithModelRevisionId } from './src/utilities/internalAddModelOptions';
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { AnnotationModel, AnnotationsAssetRef } from '@cognite/sdk';
|
|
5
|
+
import { Image360DataModelIdentifier } from './image-360-data-providers/descriptor-providers/datamodels/Cdf360DataModelsDescriptorProvider';
|
|
6
|
+
import { DMInstanceRef } from './pointcloud-stylable-object-providers/types';
|
|
7
|
+
import { PointCloudAnnotationVolumeCollection, PointCloudDMVolumeCollection } from '../../pointcloud-styling';
|
|
8
|
+
/**
|
|
9
|
+
* Model identifier for classic CDF models, referenced by modelId and revisionId
|
|
10
|
+
*/
|
|
11
|
+
export type ClassicModelIdentifierType = {
|
|
12
|
+
modelId: number;
|
|
13
|
+
revisionId: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Model identifier for DM-based models, referenced by externalId and space of the model revision
|
|
17
|
+
*/
|
|
18
|
+
export type DMModelIdentifierType = {
|
|
19
|
+
revisionExternalId: string;
|
|
20
|
+
revisionSpace: string;
|
|
21
|
+
};
|
|
22
|
+
export type LocalModelIdentifierType = {
|
|
23
|
+
localPath: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Data source type for classic models
|
|
27
|
+
*/
|
|
28
|
+
export type ClassicDataSourceType = {
|
|
29
|
+
/**
|
|
30
|
+
* The classic point cloud model identifier associated with the object which include modelId and revisionId.
|
|
31
|
+
*/
|
|
32
|
+
modelIdentifier: ClassicModelIdentifierType;
|
|
33
|
+
/**
|
|
34
|
+
* The classic point cloud volume metadata containing reference associated with the object which includes annotationId
|
|
35
|
+
* and asset reference if any.
|
|
36
|
+
*/
|
|
37
|
+
pointCloudVolumeMetadata: {
|
|
38
|
+
annotationId: number;
|
|
39
|
+
assetRef?: AnnotationsAssetRef;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Point cloud volume collection type
|
|
43
|
+
*/
|
|
44
|
+
pointCloudCollectionType: PointCloudAnnotationVolumeCollection;
|
|
45
|
+
/**
|
|
46
|
+
* Identifier type for Event- or DM-based 360 images
|
|
47
|
+
*/
|
|
48
|
+
image360Identifier: {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
} | Image360DataModelIdentifier;
|
|
51
|
+
/**
|
|
52
|
+
* Type of classic 360 annotations
|
|
53
|
+
*/
|
|
54
|
+
image360AnnotationType: AnnotationModel;
|
|
55
|
+
/**
|
|
56
|
+
* Marker to make this type inconstructable
|
|
57
|
+
*/
|
|
58
|
+
_never: never;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Data source type for DM models
|
|
62
|
+
*/
|
|
63
|
+
export type DMDataSourceType = {
|
|
64
|
+
/**
|
|
65
|
+
* The CDF point cloud volume metadata containing reference associated with the object which includes externalId, space
|
|
66
|
+
* and asset reference if any.
|
|
67
|
+
*/
|
|
68
|
+
pointCloudVolumeMetadata: {
|
|
69
|
+
volumeInstanceRef: DMInstanceRef;
|
|
70
|
+
assetRef?: DMInstanceRef;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Point cloud volume collection type
|
|
74
|
+
*/
|
|
75
|
+
pointCloudCollectionType: PointCloudDMVolumeCollection;
|
|
76
|
+
/**
|
|
77
|
+
* The DM point cloud model identifier associated with the object, consisting of revision externalId and revision space
|
|
78
|
+
*/
|
|
79
|
+
modelIdentifier: DMModelIdentifierType;
|
|
80
|
+
/**
|
|
81
|
+
* Identifier type for DM 360 collections
|
|
82
|
+
*/
|
|
83
|
+
image360Identifier: Image360DataModelIdentifier;
|
|
84
|
+
/**
|
|
85
|
+
* Type of CoreDM 360 image annotations (to be defined)
|
|
86
|
+
*/
|
|
87
|
+
image360AnnotationType: never;
|
|
88
|
+
/**
|
|
89
|
+
* Marker to make this type inconstructable
|
|
90
|
+
*/
|
|
91
|
+
_never: never;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Data source type for local models
|
|
95
|
+
*/
|
|
96
|
+
export type LocalDataSourceType = {
|
|
97
|
+
modelIdentifier: LocalModelIdentifierType;
|
|
98
|
+
pointCloudVolumeMetadata: any;
|
|
99
|
+
pointCloudCollectionType: any;
|
|
100
|
+
_never: never;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Common data source type
|
|
104
|
+
*/
|
|
105
|
+
export type DataSourceType = ClassicDataSourceType | DMDataSourceType;
|
|
106
|
+
/**
|
|
107
|
+
* A DataSourceType used internally to allow for flexibility and generic testing
|
|
108
|
+
*/
|
|
109
|
+
export type GenericDataSourceType = {
|
|
110
|
+
modelIdentifier: any;
|
|
111
|
+
pointCloudVolumeMetadata: any;
|
|
112
|
+
pointCloudCollectionType: any;
|
|
113
|
+
image360Identifier: any;
|
|
114
|
+
image360AnnotationType: any;
|
|
115
|
+
_never: never;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Internal model identifiers
|
|
119
|
+
*/
|
|
120
|
+
export type InternalModelIdentifier = ClassicModelIdentifierType | DMModelIdentifierType | LocalModelIdentifierType;
|
|
121
|
+
/**
|
|
122
|
+
* Alias for internal + external data source types
|
|
123
|
+
*/
|
|
124
|
+
export type InternalDataSourceType = DataSourceType | LocalDataSourceType;
|
|
125
|
+
export declare function isClassicIdentifier(identifier: InternalModelIdentifier): identifier is ClassicModelIdentifierType;
|
|
126
|
+
export declare function isDMIdentifier(identifier: InternalModelIdentifier): identifier is DMModelIdentifierType;
|
|
127
|
+
export declare function isLocalIdentifier(identifier: InternalModelIdentifier): identifier is LocalModelIdentifierType;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
+
import { ClassicModelIdentifierType, DMModelIdentifierType, LocalModelIdentifierType } from './DataSourceType';
|
|
4
5
|
/**
|
|
5
6
|
* Identifies a 3D model. Typically, implementations will use {@link CdfModelIdentifier}.
|
|
6
7
|
*/
|
|
@@ -10,3 +11,4 @@ export interface ModelIdentifier {
|
|
|
10
11
|
*/
|
|
11
12
|
readonly revealInternalId: symbol;
|
|
12
13
|
}
|
|
14
|
+
export declare function createModelIdentifier(identifier: ClassicModelIdentifierType | (DMModelIdentifierType & ClassicModelIdentifierType) | LocalModelIdentifierType): ModelIdentifier;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { ClassicDataSourceType, DataSourceType } from './DataSourceType';
|
|
5
5
|
import { PointCloudObject } from './pointcloud-stylable-object-providers/types';
|
|
6
|
-
export interface PointCloudStylableObjectProvider {
|
|
7
|
-
getPointCloudObjects(
|
|
6
|
+
export interface PointCloudStylableObjectProvider<T extends DataSourceType = ClassicDataSourceType> {
|
|
7
|
+
getPointCloudObjects(identifier: T['modelIdentifier']): Promise<PointCloudObject<T>[]>;
|
|
8
8
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { ClassicModelIdentifierType, DMModelIdentifierType } from '../DataSourceType';
|
|
5
|
+
import { CdfModelIdentifier } from './CdfModelIdentifier';
|
|
6
|
+
export declare class DMModelIdentifier extends CdfModelIdentifier {
|
|
7
|
+
readonly revealInternalId: symbol;
|
|
8
|
+
readonly revisionExternalId: string;
|
|
9
|
+
readonly revisionSpace: string;
|
|
10
|
+
constructor({ modelId, revisionId, revisionExternalId, revisionSpace }: DMModelIdentifierType & ClassicModelIdentifierType);
|
|
11
|
+
toString(): string;
|
|
12
|
+
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
-
import { ModelIdentifier } from '../ModelIdentifier';
|
|
6
5
|
import { PointCloudObject } from './types';
|
|
7
6
|
import { PointCloudStylableObjectProvider } from '../PointCloudStylableObjectProvider';
|
|
8
|
-
|
|
7
|
+
import { ClassicDataSourceType, ClassicModelIdentifierType } from '../DataSourceType';
|
|
8
|
+
export declare class CdfPointCloudStylableObjectProvider implements PointCloudStylableObjectProvider<ClassicDataSourceType> {
|
|
9
9
|
private readonly _sdk;
|
|
10
10
|
constructor(sdk: CogniteClient);
|
|
11
11
|
private annotationGeometryToRevealShapes;
|
|
12
12
|
private is3dObjectAnnotation;
|
|
13
13
|
private fetchAnnotations;
|
|
14
|
-
getPointCloudObjects(modelIdentifier:
|
|
14
|
+
getPointCloudObjects(modelIdentifier: ClassicModelIdentifierType): Promise<PointCloudObject[]>;
|
|
15
15
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { ClassicDataSourceType, ClassicModelIdentifierType } from '../DataSourceType';
|
|
5
5
|
import { PointCloudStylableObjectProvider } from '../PointCloudStylableObjectProvider';
|
|
6
6
|
import { PointCloudObject } from './types';
|
|
7
|
-
export declare class DummyPointCloudStylableObjectProvider implements PointCloudStylableObjectProvider {
|
|
8
|
-
getPointCloudObjects(_modelIdentifier:
|
|
7
|
+
export declare class DummyPointCloudStylableObjectProvider implements PointCloudStylableObjectProvider<ClassicDataSourceType> {
|
|
8
|
+
getPointCloudObjects(_modelIdentifier: ClassicModelIdentifierType): Promise<PointCloudObject[]>;
|
|
9
9
|
}
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
* Copyright 2022 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import { PointCloudObject, CdfPointCloudObjectAnnotation } from './types';
|
|
5
|
-
|
|
5
|
+
import { DataSourceType } from '../DataSourceType';
|
|
6
|
+
export declare function cdfAnnotationsToObjectInfo<T extends DataSourceType>(annotations: CdfPointCloudObjectAnnotation[]): PointCloudObject<T>[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
+
import { PointCloudStylableObjectProvider } from '../../PointCloudStylableObjectProvider';
|
|
6
|
+
import { PointCloudObject } from '../types';
|
|
7
|
+
import { DMDataSourceType, DMModelIdentifierType } from '../../DataSourceType';
|
|
8
|
+
export declare class CdfPointCloudDMStylableObjectProvider implements PointCloudStylableObjectProvider<DMDataSourceType> {
|
|
9
|
+
private readonly _dmsSdk;
|
|
10
|
+
constructor(sdk: CogniteClient);
|
|
11
|
+
getPointCloudObjects(modelIdentifier: DMModelIdentifierType): Promise<PointCloudObject<DMDataSourceType>[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { DMDataSourceType, DMModelIdentifierType } from '../../DataSourceType';
|
|
5
|
+
import { PointCloudStylableObjectProvider } from '../../PointCloudStylableObjectProvider';
|
|
6
|
+
import { PointCloudObject } from '../types';
|
|
7
|
+
export declare class DummyPointCloudDMStylableObjectProvider implements PointCloudStylableObjectProvider<DMDataSourceType> {
|
|
8
|
+
getPointCloudObjects(_modelIdentifier: DMModelIdentifierType): Promise<PointCloudObject<DMDataSourceType>[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataModelsSdk } from '../../DataModelsSdk';
|
|
2
|
+
import { CdfPointCloudObjectAnnotation } from '../types';
|
|
3
|
+
import { DMModelIdentifierType } from '../../DataSourceType';
|
|
4
|
+
export declare function getDMPointCloudObjects(dmsSdk: DataModelsSdk, modelIdentifier: DMModelIdentifierType): Promise<CdfPointCloudObjectAnnotation[]>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { DMInstanceRef } from '../types';
|
|
5
|
+
declare const getDMPointCloudVolumeQuery: (revisionRef: DMInstanceRef) => {
|
|
6
|
+
readonly with: {
|
|
7
|
+
readonly pointCloudVolumes: {
|
|
8
|
+
readonly nodes: {
|
|
9
|
+
readonly filter: {
|
|
10
|
+
readonly and: [{
|
|
11
|
+
readonly hasData: [{
|
|
12
|
+
readonly externalId: "CognitePointCloudVolume";
|
|
13
|
+
readonly space: "cdf_cdm";
|
|
14
|
+
readonly version: "v1";
|
|
15
|
+
readonly type: "view";
|
|
16
|
+
}];
|
|
17
|
+
}, import("@cognite/sdk").TableExpressionContainsAnyFilterV3];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly limit: 1000;
|
|
21
|
+
};
|
|
22
|
+
readonly object3D: {
|
|
23
|
+
readonly nodes: {
|
|
24
|
+
readonly from: "pointCloudVolumes";
|
|
25
|
+
readonly through: {
|
|
26
|
+
readonly view: {
|
|
27
|
+
readonly externalId: "CognitePointCloudVolume";
|
|
28
|
+
readonly space: "cdf_cdm";
|
|
29
|
+
readonly version: "v1";
|
|
30
|
+
readonly type: "view";
|
|
31
|
+
};
|
|
32
|
+
readonly identifier: "object3D";
|
|
33
|
+
};
|
|
34
|
+
readonly direction: "outwards";
|
|
35
|
+
};
|
|
36
|
+
readonly limit: 1000;
|
|
37
|
+
};
|
|
38
|
+
readonly assets: {
|
|
39
|
+
readonly nodes: {
|
|
40
|
+
readonly from: "object3D";
|
|
41
|
+
readonly through: {
|
|
42
|
+
readonly view: {
|
|
43
|
+
readonly externalId: "CogniteVisualizable";
|
|
44
|
+
readonly space: "cdf_cdm";
|
|
45
|
+
readonly version: "v1";
|
|
46
|
+
readonly type: "view";
|
|
47
|
+
};
|
|
48
|
+
readonly identifier: "object3D";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly limit: 1000;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
readonly select: {
|
|
55
|
+
readonly pointCloudVolumes: {
|
|
56
|
+
readonly sources: [{
|
|
57
|
+
readonly source: {
|
|
58
|
+
readonly externalId: "CognitePointCloudVolume";
|
|
59
|
+
readonly space: "cdf_cdm";
|
|
60
|
+
readonly version: "v1";
|
|
61
|
+
readonly type: "view";
|
|
62
|
+
};
|
|
63
|
+
readonly properties: ["revisions", "volumeReferences", "volumeType", "volume", "object3D"];
|
|
64
|
+
}];
|
|
65
|
+
};
|
|
66
|
+
readonly assets: {
|
|
67
|
+
readonly sources: [{
|
|
68
|
+
readonly source: {
|
|
69
|
+
readonly externalId: "CogniteAsset";
|
|
70
|
+
readonly space: "cdf_cdm";
|
|
71
|
+
readonly version: "v1";
|
|
72
|
+
readonly type: "view";
|
|
73
|
+
};
|
|
74
|
+
readonly properties: ["name", "description", "object3D"];
|
|
75
|
+
}];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export type CdfDMPointCloudVolumeQuery = ReturnType<typeof getDMPointCloudVolumeQuery>;
|
|
80
|
+
export declare function getDMPointCloudVolumeCollectionQuery(revisionExternalId: string, space: string): CdfDMPointCloudVolumeQuery;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { DMInstanceRef } from '../types';
|
|
5
|
+
export type AssetProperties = {
|
|
6
|
+
object3D: DMInstanceRef;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const ASSET_PROPERTIES_LIST: ["name", "description", "object3D"];
|
|
11
|
+
export declare const pointCloudVolumeFilter: {
|
|
12
|
+
readonly hasData: [{
|
|
13
|
+
readonly externalId: "CognitePointCloudVolume";
|
|
14
|
+
readonly space: "cdf_cdm";
|
|
15
|
+
readonly version: "v1";
|
|
16
|
+
readonly type: "view";
|
|
17
|
+
}];
|
|
18
|
+
};
|
|
19
|
+
export declare const POINT_CLOUD_VOLUME_REVISIONS_REFERENCE: ["revisions", "volumeReferences"];
|
|
20
|
+
export declare const POINT_CLOUD_VOLUME_REVISIONS_PROPERTIES_LIST: ["revisions", "volumeReferences", "volumeType", "volume"];
|
|
21
|
+
export declare const POINT_CLOUD_VOLUME_REVISIONS_OBJECT3D_PROPERTIES_LIST: ["revisions", "volumeReferences", "volumeType", "volume", "object3D"];
|
|
22
|
+
export type PointCloudVolumeRevisionProperties = {
|
|
23
|
+
revisions: DMInstanceRef[];
|
|
24
|
+
volumeReferences: string[];
|
|
25
|
+
};
|
|
26
|
+
export type PointCloudVolumeRevisionVolumeProperties = PointCloudVolumeRevisionProperties & {
|
|
27
|
+
volumeType: string;
|
|
28
|
+
volume: number[];
|
|
29
|
+
};
|
|
30
|
+
export type PointCloudVolumeObject3DProperties = PointCloudVolumeRevisionVolumeProperties & {
|
|
31
|
+
object3D: DMInstanceRef;
|
|
32
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { TableExpressionContainsAnyFilterV3 } from '@cognite/sdk';
|
|
5
|
+
import { DMInstanceRef } from '../types';
|
|
6
|
+
export declare function getRevisionContainsAnyFilter(revisionReferences: DMInstanceRef[]): TableExpressionContainsAnyFilterV3;
|
|
@@ -4,36 +4,39 @@
|
|
|
4
4
|
import { StylableObject } from './StylableObject';
|
|
5
5
|
import { IShape } from '../../../utilities';
|
|
6
6
|
import { Box3 } from 'three';
|
|
7
|
-
import { AnnotationsAssetRef } from '@cognite/sdk';
|
|
8
|
-
|
|
7
|
+
import { AnnotationsAssetRef, DirectRelationReference } from '@cognite/sdk';
|
|
8
|
+
import { ClassicDataSourceType, DataSourceType } from '../DataSourceType';
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
* CDF Data model instance reference
|
|
12
|
+
*/
|
|
13
|
+
export type DMInstanceRef = DirectRelationReference;
|
|
14
|
+
type VolumeAnnotation = {
|
|
9
15
|
annotationId: number;
|
|
10
16
|
asset?: AnnotationsAssetRef;
|
|
17
|
+
};
|
|
18
|
+
type VolumeDMReference = {
|
|
19
|
+
instanceRef: DMInstanceRef;
|
|
20
|
+
asset?: DMInstanceRef;
|
|
21
|
+
};
|
|
22
|
+
export type VolumeMetadata = VolumeAnnotation | VolumeDMReference;
|
|
23
|
+
export type CdfPointCloudObjectAnnotation = {
|
|
24
|
+
volumeMetadata: VolumeMetadata;
|
|
11
25
|
region: IShape[];
|
|
12
26
|
};
|
|
27
|
+
export declare function isVolumeAnnotation(volumeMetadata: VolumeMetadata): volumeMetadata is VolumeAnnotation;
|
|
28
|
+
export declare function isVolumeDMReference(volumeMetadata: VolumeMetadata): volumeMetadata is VolumeDMReference;
|
|
13
29
|
/**
|
|
14
30
|
* @public
|
|
15
31
|
* Metadata for a single point cloud object
|
|
16
32
|
*/
|
|
17
|
-
export type PointCloudObjectMetadata = {
|
|
18
|
-
/**
|
|
19
|
-
* The CDF Annotation ID associated with the point cloud object.
|
|
20
|
-
*/
|
|
21
|
-
annotationId: number;
|
|
22
|
-
/**
|
|
23
|
-
* The CDF Asset ID associated with the point cloud object, if any.
|
|
24
|
-
*
|
|
25
|
-
* @deprecated Use {@link PointCloudObjectMetadata.assetRef} instead.
|
|
26
|
-
*/
|
|
27
|
-
assetId?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Asset identifiers for asset associated with this point cloud object, if any.
|
|
30
|
-
*/
|
|
31
|
-
assetRef?: AnnotationsAssetRef;
|
|
32
|
-
/**
|
|
33
|
-
* The bounding box of this annotation
|
|
34
|
-
*/
|
|
33
|
+
export type PointCloudObjectMetadata<T extends DataSourceType = ClassicDataSourceType> = {
|
|
35
34
|
boundingBox: Box3;
|
|
36
|
-
};
|
|
37
|
-
|
|
35
|
+
} & T['pointCloudVolumeMetadata'];
|
|
36
|
+
/**
|
|
37
|
+
* Point cloud object containing point cloud volume or annotation metadata and stylable object
|
|
38
|
+
*/
|
|
39
|
+
export type PointCloudObject<T extends DataSourceType = ClassicDataSourceType> = PointCloudObjectMetadata<T> & {
|
|
38
40
|
stylableObject: StylableObject;
|
|
39
41
|
};
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
5
|
+
export declare function fetchDMModelIdFromRevisionId(revisionExternalId: string, space: string, sdk: CogniteClient | undefined): Promise<{
|
|
6
|
+
modelId: number;
|
|
7
|
+
revisionId: number;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
export declare const CORE_DM_SPACE = "cdf_cdm";
|
|
5
|
+
export declare const CORE_DM_3D_CONTAINER_SPACE = "cdf_cdm_3d";
|
|
6
|
+
export declare const COGNITE_POINT_CLOUD_VOLUME_SOURCE: {
|
|
7
|
+
readonly externalId: "CognitePointCloudVolume";
|
|
8
|
+
readonly space: "cdf_cdm";
|
|
9
|
+
readonly version: "v1";
|
|
10
|
+
readonly type: "view";
|
|
11
|
+
};
|
|
12
|
+
export declare const COGNITE_ASSET_SOURCE: {
|
|
13
|
+
readonly externalId: "CogniteAsset";
|
|
14
|
+
readonly space: "cdf_cdm";
|
|
15
|
+
readonly version: "v1";
|
|
16
|
+
readonly type: "view";
|
|
17
|
+
};
|
|
18
|
+
export declare const COGNITE_VISUALIZABLE_SOURCE: {
|
|
19
|
+
readonly externalId: "CogniteVisualizable";
|
|
20
|
+
readonly space: "cdf_cdm";
|
|
21
|
+
readonly version: "v1";
|
|
22
|
+
readonly type: "view";
|
|
23
|
+
};
|
|
24
|
+
export declare const COGNITE_3D_REVISION_SOURCE: {
|
|
25
|
+
readonly externalId: "Cognite3DRevision";
|
|
26
|
+
readonly space: "cdf_cdm";
|
|
27
|
+
readonly version: "v1";
|
|
28
|
+
readonly type: "view";
|
|
29
|
+
};
|